mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
14 lines
111 KiB
JavaScript
14 lines
111 KiB
JavaScript
(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_3"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_3"]||[]).push([[304],{60090:function(e,t,o){"use strict";o.d(t,{A:function(){return p}});var a=o(9274);const n={key:0,class:"label"},i={class:"text-label"},l={class:"value"};function r(e,t,o,r,s,d){return d.isView?((0,a.openBlock)(),(0,a.createElementBlock)("div",n,[(0,a.createElementVNode)("div",i,[(0,a.renderSlot)(e.$slots,"name",{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(o.name),1)]),!0)]),(0,a.createElementVNode)("div",l,[(0,a.renderSlot)(e.$slots,"value",{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(d.displayValue),1)]),!0)])])):(0,a.renderSlot)(e.$slots,"default",{key:1},void 0,!0)}var s=o(14220),d={name:"InputOrDisplay",props:{name:{type:String,required:!0},value:{type:[Number,String,Array,void 0],default:""},mode:{type:String,default:"edit"}},computed:{isView(){return this.mode===s.nW},displayValue(){return Array.isArray(this.value)&&0===this.value.length?"":this.value}}},c=(o(18071),o(47433));const u=(0,c.A)(d,[["render",r],["__scopeId","data-v-a3d99010"]]);var p=u},39412:function(e,t,o){"use strict";o.d(t,{A:function(){return u}});var a=o(9274);const n={class:"label"},i={class:"text-label"},l={class:"value"};function r(e,t,o,r,s,d){return(0,a.openBlock)(),(0,a.createElementBlock)("div",n,[(0,a.createElementVNode)("div",i,[(0,a.renderSlot)(e.$slots,"name",{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(o.name),1)]),!0)]),(0,a.createElementVNode)("div",l,[(0,a.renderSlot)(e.$slots,"value",{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(o.value),1)]),!0)])])}var s={props:{name:{type:String,required:!0},value:{type:[Number,String,void 0],default:""}}},d=(o(88405),o(47433));const c=(0,d.A)(s,[["render",r],["__scopeId","data-v-357627fa"]]);var u=c},39996:function(e,t,o){"use strict";o.d(t,{A:function(){return j}});var a=o(9274);const n={class:"key-value"},i={key:0,class:"clearfix"},l={key:0,class:"icon icon-info"},r={class:"text-label"},s={key:0,class:"icon icon-info"},d={class:"text-label"},c=(0,a.createElementVNode)("span",null,null,-1),u=(0,a.createElementVNode)("div",{class:"kv-item key text-muted"}," — ",-1),p=(0,a.createElementVNode)("div",{class:"kv-item key text-muted"}," — ",-1),h={class:"kv-item key"},m=["onUpdate:modelValue","disabled","placeholder","data-testid","onPaste"],f=["data-testid"],v={key:0},g={key:1},y=["onUpdate:modelValue","disabled","type","placeholder","data-testid"],b=["data-testid"],w=["disabled","onClick"],k={key:1,class:"footer mt-20"},E=["disabled"],S={key:0,class:"mr-5 icon icon-spinner icon-spin icon-lg"};function x(e,t,o,x,N,C){const B=(0,a.resolveComponent)("Select"),D=(0,a.resolveComponent)("CodeMirror"),_=(0,a.resolveComponent)("TextAreaAutoGrow"),T=(0,a.resolveComponent)("FileSelector"),A=(0,a.resolveDirective)("clean-tooltip");return(0,a.openBlock)(),(0,a.createElementBlock)("div",n,[o.title||e.$slots.title?((0,a.openBlock)(),(0,a.createElementBlock)("div",i,[(0,a.renderSlot)(e.$slots,"title",{},(()=>[(0,a.createElementVNode)("h3",null,[(0,a.createTextVNode)((0,a.toDisplayString)(o.title)+" ",1),o.titleProtip?(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("i",l,null,512)),[[A,o.titleProtip]]):(0,a.createCommentVNode)("",!0)])]))])):(0,a.createCommentVNode)("",!0),(0,a.createElementVNode)("div",{class:"kv-container",style:(0,a.normalizeStyle)(C.containerStyle)},[N.rows.length||C.isView?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:0},[(0,a.createElementVNode)("label",r,[(0,a.createTextVNode)((0,a.toDisplayString)(C._keyLabel)+" ",1),C._protip&&!C.isView&&o.addAllowed?(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("i",s,null,512)),[[A,C._protip]]):(0,a.createCommentVNode)("",!0)]),(0,a.createElementVNode)("label",d,(0,a.toDisplayString)(C._valueLabel),1),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(o.extraColumns,((t,o)=>((0,a.openBlock)(),(0,a.createElementBlock)("label",{key:o},[(0,a.renderSlot)(e.$slots,"label:"+t,{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t),1)]))])))),128)),C.canRemove?(0,a.renderSlot)(e.$slots,"remove",{key:0},(()=>[c])):(0,a.createCommentVNode)("",!0)],64)):(0,a.createCommentVNode)("",!0),!N.rows.length&&C.isView?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[u,p],64)):((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:2},(0,a.renderList)(C.filteredRows,((n,i)=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:i},[(0,a.createElementVNode)("div",h,[(0,a.renderSlot)(e.$slots,"key",{row:n,mode:o.mode,keyName:o.keyName,valueName:o.valueName,queueUpdate:e.queueUpdate,disabled:o.disabled},(()=>[o.keyOptions?((0,a.openBlock)(),(0,a.createBlock)(B,{key:0,ref_for:!0,ref:"key",value:n[o.keyName],"onUpdate:value":[e=>n[o.keyName]=e,e.queueUpdate],searchable:!0,disabled:o.disabled||C.isProtected(n.key),clearable:!1,taggable:o.keyTaggable,options:C.calculateOptions(n[o.keyName]),"data-testid":`select-kv-item-key-${i}`},null,8,["value","onUpdate:value","disabled","taggable","options","data-testid"])):(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("input",{key:1,ref_for:!0,ref:"key","onUpdate:modelValue":e=>n[o.keyName]=e,disabled:C.isView||o.disabled||!o.keyEditable||C.isProtected(n.key),placeholder:C._keyPlaceholder,"data-testid":`input-kv-item-key-${i}`,onInput:t[0]||(t[0]=(...t)=>e.queueUpdate&&e.queueUpdate(...t)),onPaste:e=>C.onPaste(i,e)},null,40,m)),[[a.vModelText,n[o.keyName]]])]))]),(0,a.createElementVNode)("div",{"data-testid":`kv-item-value-${i}`,class:"kv-item value"},[(0,a.renderSlot)(e.$slots,"value",{row:n,mode:o.mode,keyName:o.keyName,valueName:o.valueName,queueUpdate:e.queueUpdate},(()=>[n.supported?n.binary?((0,a.openBlock)(),(0,a.createElementBlock)("div",g,(0,a.toDisplayString)(C.binaryTextSize(n.value)),1)):((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:2,class:(0,a.normalizeClass)(["value-container",{"upload-button":o.parseValueFromFile}])},[o.valueMarkdownMultiline?((0,a.openBlock)(),(0,a.createBlock)(D,{key:0,ref_for:!0,ref:"cm","data-testid":"code-mirror-multiline-field",class:(0,a.normalizeClass)({["focus"]:N.codeMirrorFocus[i]}),value:n[o.valueName],"as-text-area":!0,mode:o.mode,onOnInput:e=>C.onInputMarkdownMultiline(i,e),onOnFocus:e=>C.onFocusMarkdownMultiline(i,e)},null,8,["class","value","mode","onOnInput","onOnFocus"])):o.valueMultiline&&void 0!==n[o.valueName]?((0,a.openBlock)(),(0,a.createBlock)(_,{key:1,value:n[o.valueName],"onUpdate:value":[e=>n[o.valueName]=e,e.queueUpdate],"data-testid":"value-multiline",class:(0,a.normalizeClass)({conceal:o.valueConcealed}),disabled:o.disabled||C.isProtected(n.key),mode:o.mode,placeholder:C._valuePlaceholder,"min-height":40,spellcheck:!1},null,8,["value","onUpdate:value","class","disabled","mode","placeholder"])):(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("input",{key:2,"onUpdate:modelValue":e=>n[o.valueName]=e,disabled:C.isView||o.disabled||C.isProtected(n.key),type:o.valueConcealed?"password":"text",placeholder:C._valuePlaceholder,autocorrect:"off",autocapitalize:"off",spellcheck:"false","data-testid":`input-kv-item-value-${i}`,onInput:t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},null,40,y)),[[a.vModelDynamic,n[o.valueName]]]),o.parseValueFromFile&&o.readAllowed&&!C.isView&&C.isValueFieldEmpty(n[o.valueName])?((0,a.openBlock)(),(0,a.createBlock)(T,{key:3,class:"btn btn-sm role-secondary file-selector",label:e.t("generic.upload"),"include-file-name":!0,onSelected:e=>C.onValueFileSelected(i,e)},null,8,["label","onSelected"])):(0,a.createCommentVNode)("",!0)],2)):((0,a.openBlock)(),(0,a.createElementBlock)("div",v,(0,a.toDisplayString)(e.t("detailText.unsupported",null,!0)),1))]))],8,f),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(o.extraColumns,((t,o)=>((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:`${i}-${o}`,class:"kv-item extra"},[(0,a.renderSlot)(e.$slots,"col:"+t,{row:n,queueUpdate:e.queueUpdate,i:i})])))),128)),C.canRemove?((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:i,class:"kv-item remove","data-testid":`remove-column-${i}`},[(0,a.renderSlot)(e.$slots,"removeButton",{remove:C.remove,row:n,i:i},(()=>[(0,a.createElementVNode)("button",{type:"button",disabled:C.isView||C.isProtected(n.key)||o.disabled,class:"btn role-link",onClick:e=>C.remove(i)},(0,a.toDisplayString)(o.removeLabel||e.t("generic.remove")),9,w)]))],8,b)):(0,a.createCommentVNode)("",!0)],64)))),128))],4),!o.addAllowed&&!o.readAllowed||C.isView?(0,a.createCommentVNode)("",!0):((0,a.openBlock)(),(0,a.createElementBlock)("div",k,[(0,a.renderSlot)(e.$slots,"add",{add:C.add},(()=>[o.addAllowed?((0,a.openBlock)(),(0,a.createElementBlock)("button",{key:0,type:"button",class:"btn role-tertiary add","data-testid":"add_link_button",disabled:o.loading||o.disabled||o.keyOptions&&0===C.filteredKeyOptions.length,onClick:t[2]||(t[2]=e=>C.add())},[o.loading?((0,a.openBlock)(),(0,a.createElementBlock)("i",S)):(0,a.createCommentVNode)("",!0),(0,a.createTextVNode)(" "+(0,a.toDisplayString)(C._addLabel),1)],8,E)):(0,a.createCommentVNode)("",!0),o.readAllowed?((0,a.openBlock)(),(0,a.createBlock)(T,{key:1,disabled:C.isView,class:"role-tertiary",label:e.t("generic.readFromFile"),"include-file-name":!0,onSelected:C.onFileSelected},null,8,["disabled","label","onSelected"])):(0,a.createCommentVNode)("",!0)]))]))])}var N=o(12784),C=o.n(N),B=o(74302),D=o(68851),_=o(4514),T=o(6198),A=o(6879),V=o(76978),O=o(43073),I=o(15677),L=o(14220),M=o(92043),$=o(37534),P=o(46343),U=o.n(P),R={name:"KeyValue",emits:["focusKey","update:value"],components:{CodeMirror:$.A,Select:O.A,TextAreaAutoGrow:A.V,FileSelector:I.A},props:{value:{type:[Array,Object],default:null},defaultValue:{type:[Array,Object],default:null},binaryValueKeys:{type:[Array,Object],default:null},mode:{type:String,default:L.G5},asMap:{type:Boolean,default:!0},initialEmptyRow:{type:Boolean,default:!1},title:{type:String,default:""},titleProtip:{type:String,default:""},protip:{type:[String,Boolean],default:""},keyName:{type:String,default:"key"},keyLabel:{type:String,default:""},keyEditable:{type:Boolean,default:!0},keyOptions:{type:Array,default:null},keyTaggable:{type:Boolean,default:!0},keyOptionUnique:{type:Boolean,default:!1},keyPlaceholder:{type:String,default:""},protectedKeys:{type:Array,default:()=>[]},toggleFilter:{type:Boolean,default:!1},separatorLabel:{type:String,default:""},valueName:{type:String,default:"value"},valueLabel:{type:String,default:""},valuePlaceholder:{type:String,default:""},valueCanBeEmpty:{type:Boolean,default:!1},displayValuesAsBinary:{type:Boolean,default:!1},valueMarkdownMultiline:{type:Boolean,default:!1},valueMultiline:{type:Boolean,default:!0},valueTrim:{type:Boolean,default:!0},handleBase64:{type:Boolean,default:!1},valueConcealed:{type:Boolean,default:!1},supported:{type:Function,default:e=>!0},preserveKeys:{type:Array,default:null},extraColumns:{type:Array,default:()=>[]},defaultAddData:{type:Object,default:()=>{}},addLabel:{type:String,default:""},addIcon:{type:String,default:"icon-plus"},addAllowed:{type:Boolean,default:!0},readIcon:{type:String,default:"icon-upload"},readAllowed:{type:Boolean,default:!0},readAccept:{type:String,default:"*"},readMultiple:{type:Boolean,default:!1},removeLabel:{type:String,default:""},removeIcon:{type:String,default:"icon-minus"},removeAllowed:{type:Boolean,default:!0},fileModifier:{type:Function,default:(e,t)=>({name:e,value:t})},parserSeparators:{type:Array,default:()=>[":","="]},loading:{default:!1,type:Boolean},parseLinesFromFile:{default:!1,type:Boolean},parseValueFromFile:{default:!1,type:Boolean},disabled:{default:!1,type:Boolean}},data(){const e=this.getRows(this.value);return{rows:e,codeMirrorFocus:{},lastUpdated:null}},computed:{_protip(){return this.protip||this.t("keyValue.protip",null,!0)},_keyLabel(){return this.keyLabel||this.t("generic.key")},_keyPlaceholder(){return this.keyPlaceholder||this.t("keyValue.keyPlaceholder")},_valueLabel(){return this.valueLabel||this.t("generic.value")},_valuePlaceholder(){return this.valuePlaceholder||this.t("keyValue.valuePlaceholder")},_addLabel(){return this.addLabel||this.t("generic.add")},isView(){return this.mode===L.nW},containerStyle(){const e=this.canRemove?" 50px":"",t=2+this.extraColumns.length;return`grid-template-columns: repeat(${t}, 1fr)${e};`},usedKeyOptions(){return this.rows.map((e=>e[this.keyName]))},filteredKeyOptions(){return this.keyOptionUnique?this.keyOptions.filter((e=>!this.usedKeyOptions.includes(e.value))):this.keyOptions},canRemove(){return!this.isView&&this.removeAllowed},filteredRows(){return this.rows.filter((e=>!(this.isProtected(e.key)&&!this.toggleFilter)))}},created(){this.queueUpdate=C()(this.update,500)},watch:{value:{deep:!0,handler(e,t){this.valuePropChanged(e,t)}}},methods:{valuePropChanged(e){U()(e,this.lastUpdated)||(this.rows=this.getRows(e))},isProtected(e){return this.protectedKeys&&this.protectedKeys.includes(e)},getRows(e){const t=[];if(this.asMap){const o=e||{};Object.keys(o).forEach((e=>{let a=o[e];const n=(0,_.u)(o[e]),i=(0,M.XC)(n);this.handleBase64&&i&&(a=(0,_.u)(a)),t.push({key:e,value:a,binary:this.displayValuesAsBinary||this.handleBase64&&!i,canEncode:this.handleBase64&&i,supported:!0})}))}else{const o=e||[];for(const e of o){let o=e[this.valueName]||"";const a=(0,_.u)(e[this.valueName]),n=(0,M.XC)(a);this.handleBase64&&n&&(o=(0,_.u)(o));const i={[this.keyName]:e[this.keyName]||"",[this.valueName]:o,binary:this.displayValuesAsBinary||this.handleBase64&&!n,canEncode:this.handleBase64&&n,supported:this.supported(e)};this.preserveKeys?.map((t=>{"undefined"!==typeof e[t]&&(i[t]=e[t])})),t.push(i)}}return t&&!t.length&&this.initialEmptyRow&&t.push({[this.keyName]:"",[this.valueName]:"",binary:!1,canEncode:this.handleBase64,supported:!0}),t},add(e="",t=""){const o={...this.defaultAddData,[this.keyName]:e,[this.valueName]:t};o.binary=!1,o.canEncode=this.handleBase64,o.supported=!0,this.rows.push(o),this.queueUpdate(),this.$nextTick((()=>{if(this.$refs.key){const e=this.$refs.key,t=e[e.length-1];t.focus()}else this.$emit("focusKey")}))},remove(e){(0,D.Wq)(this.rows,e),this.queueUpdate()},removeEmptyRows(){const e=this.rows.filter((e=>e.value.length||e.key.length));this["rows"]=e},onFileSelected(e){const{name:t,value:o}=this.fileModifier(e.name,e.value);if(this.parseLinesFromFile){const e=o.split("\n");e.forEach((e=>{if(e.length){const[t,o]=e.split("=");this.add(t,o)}})),e.length>0&&this.removeEmptyRows()}else this.add(t,o,this.displayValuesAsBinary)},download(e,t){const o=this.rows[e],a=o[this.keyName],n=o[this.valueName];(0,T.PE)(a,n,"application/octet-stream")},update(){let e;if(this.asMap){e={};const t=this.keyName,o=this.valueName;for(const a of this.rows){let n=a[o]||"";const i=(a[t]||"").trim();n&&"object"===(0,B.QP)(n)?e[i]=JSON.parse(JSON.stringify(n)):(n=n||"",this.valueTrim&&(0,M.XC)(n)&&(n=n.trim()),a.canEncode&&(n=(0,_.KA)(n)),i&&(n||this.valueCanBeEmpty)&&(e[i]=n))}}else{const t=this.preserveKeys||[];(0,D.Gj)(t,this.keyName),(0,D.Gj)(t,this.valueName),e=this.rows.map((e=>{let o=e[this.valueName];e.canEncode&&(o=(0,_.KA)(o));const a={[this.keyName]:e[this.keyName],[this.valueName]:o};for(const n of t)"undefined"!==typeof e[n]&&(a[n]=e[n]);return a}))}this.lastUpdated=e,this.$emit("update:value",e)},onPaste(e,t){const o=t.clipboardData.getData("text/plain"),a=o.split("\n"),n=a.map((e=>{const t=this.parserSeparators.find((t=>e.includes(t)));return t?e.split(t):""})).filter((e=>e&&e.length>0));if(0===n.length||1===n.length&&n[0].length<2)return;t.preventDefault();const i=n.map((e=>({[this.keyName]:(e[0]||"").trim(),[this.valueName]:(e[1]||"").trim(),supported:!0,canEncode:this.handleBase64,binary:this.displayValuesAsBinary})));this.rows.splice(e,1,...i),this.queueUpdate()},calculateOptions(e){const t=this.keyOptions.find((t=>t.value===e));return t?[t,...this.filteredKeyOptions]:this.filteredKeyOptions},binaryTextSize(e){const t=this.handleBase64?(0,_.u)(e):e,o=e.length?(0,_.dQ)(t):0;return this.t("detailText.binary",{n:o},!0)},get:V.Jt,onInputMarkdownMultiline(e,t){this.rows=this.rows.map(((o,a)=>a===e?{...o,value:t}:o)),this.queueUpdate()},onFocusMarkdownMultiline(e,t){this.codeMirrorFocus[e]=t},onValueFileSelected(e,t){const{name:o,value:a}=t;this.rows[e][this.keyName]||(this.rows[e][this.keyName]=o),this.rows[e][this.valueName]=a},isValueFieldEmpty(e){return!e||0===e.trim().length}}},F=(o(65570),o(47433));const q=(0,F.A)(R,[["render",x]]);var j=q},74088:function(e,t,o){"use strict";o.d(t,{A:function(){return x}});var a=o(9274);const n=e=>((0,a.pushScopeId)("data-v-680c438c"),e=e(),(0,a.popScopeId)(),e),i={class:"labels"},l={class:"labels__header"},r={key:0},s={class:"mt-10 mb-10"},d=n((()=>(0,a.createElementVNode)("div",{class:"spacer"},null,-1)));function c(e,t,o,n,c,u){const p=(0,a.resolveComponent)("t"),h=(0,a.resolveComponent)("ToggleSwitch"),m=(0,a.resolveComponent)("KeyValue");return(0,a.openBlock)(),(0,a.createElementBlock)("div",{class:(0,a.normalizeClass)(u.containerClass)},[(0,a.createElementVNode)("div",{class:(0,a.normalizeClass)(o.defaultSectionClass)},[(0,a.createElementVNode)("div",i,[(0,a.createElementVNode)("div",l,[o.showLabelTitle?((0,a.openBlock)(),(0,a.createElementBlock)("h3",r,[(0,a.createVNode)(p,{k:"labels.labels.title"})])):(0,a.createCommentVNode)("",!0),o.value.hasSystemLabels?((0,a.openBlock)(),(0,a.createBlock)(h,{key:1,value:c.toggler,"onUpdate:value":t[0]||(t[0]=e=>c.toggler=e),name:"label-system-toggle","on-label":e.t("labels.labels.show")},null,8,["value","on-label"])):(0,a.createCommentVNode)("",!0)]),(0,a.createElementVNode)("p",s,[(0,a.createVNode)(p,{k:"labels.labels.description"})]),(0,a.createElementVNode)("div",{class:(0,a.normalizeClass)(u.columnsClass)},[(0,a.renderSlot)(e.$slots,"labels",{toggler:c.toggler},(()=>[(0,a.createVNode)(m,{key:"labels",value:o.value.labels,"protected-keys":o.value.systemLabels||[],"toggle-filter":c.toggler,"add-label":e.t("labels.addLabel"),mode:o.mode,"read-allowed":!1,"value-can-be-empty":!0,"onUpdate:value":t[1]||(t[1]=e=>o.value.setLabels(e))},null,8,["value","protected-keys","toggle-filter","add-label","mode"])]),!0)],2)])],2),d,o.showAnnotations?((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:0,class:(0,a.normalizeClass)(u.sectionClass)},[(0,a.createVNode)(m,{key:"annotations",value:o.value.annotations,"add-label":e.t("labels.addAnnotation"),mode:o.mode,"protected-keys":o.value.systemAnnotations||[],"toggle-filter":c.toggler,title:e.t("labels.annotations.title"),"title-protip":o.annotationTitleTooltip,"read-allowed":!1,"value-can-be-empty":!0,"onUpdate:value":t[2]||(t[2]=e=>o.value.setAnnotations(e))},null,8,["value","add-label","mode","protected-keys","toggle-filter","title","title-protip"])],2)):(0,a.createCommentVNode)("",!0)],2)}var u=o(39996);const p=e=>((0,a.pushScopeId)("data-v-05c40fdb"),e=e(),(0,a.popScopeId)(),e),h={class:"toggle-container"},m={class:"switch hand"},f=["checked"],v=p((()=>(0,a.createElementVNode)("span",{class:"slider round"},null,-1)));function g(e,t,o,n,i,l){return(0,a.openBlock)(),(0,a.createElementBlock)("span",h,[(0,a.createElementVNode)("span",{class:(0,a.normalizeClass)(["label no-select hand",{active:!e.state}]),onClick:t[0]||(t[0]=t=>e.toggle(!1))},(0,a.toDisplayString)(e.offLabel),3),(0,a.createElementVNode)("label",m,[(0,a.createElementVNode)("input",{type:"checkbox",checked:e.state,onInput:t[1]||(t[1]=t=>e.toggle(null))},null,40,f),v]),(0,a.createElementVNode)("span",{class:(0,a.normalizeClass)(["label no-select hand",{active:e.state}]),onClick:t[2]||(t[2]=t=>e.toggle(!0))},(0,a.toDisplayString)(e.onLabel),3)])}var y=(0,a.defineComponent)({props:{value:{type:[Boolean,String,Number],default:!1},offValue:{type:[Boolean,String,Number],default:!1},onValue:{type:[Boolean,String,Number],default:!0},offLabel:{type:String,default:""},onLabel:{type:String,default:""}},emits:["update:value"],data(){return{state:!1}},watch:{value:{handler(){this.state=this.value===this.onValue},immediate:!0}},methods:{toggle(e){this.state=null===e?!this.state:e,this.$emit("update:value",this.state?this.onValue:this.offValue)}}}),b=(o(16839),o(47433));const w=(0,b.A)(y,[["render",g],["__scopeId","data-v-05c40fdb"]]);var k=w,E={components:{ToggleSwitch:k,KeyValue:u.A},props:{value:{type:Object,required:!0},mode:{type:String,required:!0},displaySideBySide:{type:Boolean,default:!1},defaultContainerClass:{type:String,default:""},defaultSectionClass:{type:String,default:""},labelTitleTooltip:{type:String,default:""},annotationTitleTooltip:{type:String,default:""},showAnnotations:{type:Boolean,default:!0},showLabelTitle:{type:Boolean,default:!0}},data(){return{toggler:!1}},computed:{containerClass(){return`${this.displaySideBySide?"row":""} ${this.defaultContainerClass}`.trim()},sectionClass(){return`${this.displaySideBySide?"col span-6":"row"} ${this.defaultSectionClass}`.trim()},columnsClass(){return(""+(this.displaySideBySide?"col span-6":"row")).trim()}}};o(53788);const S=(0,b.A)(E,[["render",c],["__scopeId","data-v-680c438c"]]);var x=S},51270:function(e,t,o){"use strict";o.d(t,{A:function(){return M}});var a=o(9274);const n=e=>((0,a.pushScopeId)("data-v-023836b7"),e=e(),(0,a.popScopeId)(),e),i=n((()=>(0,a.createElementVNode)("i",{class:"icon icon-x"},null,-1))),l=[i],r={key:0},s=n((()=>(0,a.createElementVNode)("span",null,null,-1))),d=["data-testid"],c={key:0},u=["data-testid"],p={key:0},h=["onUpdate:modelValue","mode","data-testid"],m=["data-testid"],f={key:0},v={key:1,class:"no-value"},g=n((()=>(0,a.createElementVNode)("label",{class:"text-muted"},"…",-1))),y=[g],b=["data-testid"],w={key:0},k=["onUpdate:modelValue","mode","disabled","data-testid"],E={key:3,class:"remove-container"},S=["disabled","data-testid","onClick"],x={key:2,class:"mt-20"};function N(e,t,o,n,i,g){const N=(0,a.resolveComponent)("LabeledSelect"),C=(0,a.resolveComponent)("Select"),B=(0,a.resolveComponent)("t");return(0,a.openBlock)(),(0,a.createElementBlock)("div",null,[o.showRemove&&!g.isView?((0,a.openBlock)(),(0,a.createElementBlock)("button",{key:0,type:"button",class:"btn role-link remove-expression",onClick:t[0]||(t[0]=t=>e.$emit("remove"))},l)):(0,a.createCommentVNode)("",!0),i.rules.length?((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:1,class:(0,a.normalizeClass)(["match-expression-header",{view:g.isView,"match-expression-header-matching":o.matchingSelectorDisplay}])},[o.matchingSelectorDisplay?((0,a.openBlock)(),(0,a.createElementBlock)("label",r,(0,a.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.matchType")),1)):(0,a.createCommentVNode)("",!0),(0,a.createElementVNode)("label",null,(0,a.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.key")),1),(0,a.createElementVNode)("label",null,(0,a.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.operator")),1),(0,a.createElementVNode)("label",null,(0,a.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.value")),1),s],2)):(0,a.createCommentVNode)("",!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(i.rules,((e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:n,class:(0,a.normalizeClass)(["match-expression-row",{view:g.isView,"mb-10":n!==i.rules.length-1,"match-expression-row-matching":o.matchingSelectorDisplay}])},[o.matchingSelectorDisplay?((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:0,"data-testid":`input-match-type-field-${n}`},[g.isView?((0,a.openBlock)(),(0,a.createElementBlock)("div",c,(0,a.toDisplayString)(e.matching),1)):((0,a.openBlock)(),(0,a.createBlock)(N,{key:1,value:e.matching,"onUpdate:value":t=>e.matching=t,mode:o.mode,options:g.matchingSelectOptions,"data-testid":`input-match-type-field-control-${n}`,onSelecting:g.update},null,8,["value","onUpdate:value","mode","options","data-testid","onSelecting"]))],8,d)):(0,a.createCommentVNode)("",!0),(0,a.createElementVNode)("div",{"data-testid":`input-match-expression-key-${n}`},[g.isView?((0,a.openBlock)(),(0,a.createElementBlock)("div",p,(0,a.toDisplayString)(e.key),1)):g.hasKeySelectOptions?((0,a.openBlock)(),(0,a.createBlock)(N,{key:2,value:e.key,"onUpdate:value":t=>e.key=t,mode:o.mode,options:o.keysSelectOptions,"data-testid":`input-match-expression-key-control-select-${n}`},null,8,["value","onUpdate:value","mode","options","data-testid"])):(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("input",{key:1,"onUpdate:modelValue":t=>e.key=t,mode:o.mode,"data-testid":`input-match-expression-key-control-${n}`,onInput:t[1]||(t[1]=(...e)=>g.update&&g.update(...e))},null,40,h)),[[a.vModelText,e.key]])],8,u),(0,a.createElementVNode)("div",{"data-testid":`input-match-expression-operator-${n}`},[g.isView?((0,a.openBlock)(),(0,a.createElementBlock)("div",f,(0,a.toDisplayString)(e.operator),1)):((0,a.openBlock)(),(0,a.createBlock)(C,{key:1,value:e.operator,"onUpdate:value":[t=>e.operator=t,g.update],class:"operator single",options:i.ops,clearable:!1,reduce:e=>e.value,mode:o.mode,"data-testid":`input-match-expression-operator-control-${n}`},null,8,["value","onUpdate:value","options","reduce","mode","data-testid"]))],8,m),"Exists"===e.operator||"DoesNotExist"===e.operator?((0,a.openBlock)(),(0,a.createElementBlock)("div",v,y)):((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:2,"data-testid":`input-match-expression-values-${n}`},[g.isView?((0,a.openBlock)(),(0,a.createElementBlock)("div",w,(0,a.toDisplayString)(e.values),1)):(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("input",{key:1,"onUpdate:modelValue":t=>e.values=t,mode:o.mode,disabled:"Exists"===e.operator||"DoesNotExist"===e.operator,"data-testid":`input-match-expression-values-control-${n}`,onInput:t[2]||(t[2]=(...e)=>g.update&&g.update(...e))},null,40,k)),[[a.vModelText,e.values]])],8,b)),o.showRemoveButton?((0,a.openBlock)(),(0,a.createElementBlock)("div",E,[g.isView?(0,a.createCommentVNode)("",!0):((0,a.openBlock)(),(0,a.createElementBlock)("button",{key:0,type:"button",class:"btn role-link",style:{padding:"0px"},disabled:"view"===o.mode,"data-testid":`input-match-expression-remove-control-${n}`,onClick:t=>g.removeRule(e)},[(0,a.createVNode)(B,{k:"generic.remove"})],8,S))])):(0,a.createCommentVNode)("",!0)],2)))),128)),!g.isView&&o.showAddButton?((0,a.openBlock)(),(0,a.createElementBlock)("div",x,[(0,a.createElementVNode)("button",{type:"button",class:"btn role-tertiary add","data-testid":"input-match-expression-add-rule",onClick:t[3]||(t[3]=(...e)=>g.addRule&&g.addRule(...e))},[(0,a.createVNode)(B,{k:"workload.scheduling.affinity.matchExpressions.addRule"})])])):(0,a.createCommentVNode)("",!0)])}var C=o(35664),B=o(43073),D=o(65359),_=o(68851),T=o(76978),A=o(38823),V=o(40408),O={emits:["update:value","remove"],components:{Select:B.A,LabeledSelect:V.A},props:{value:{type:[Array,Object],default:()=>[]},mode:{type:String,default:"edit"},type:{type:String,default:C.NW},matchingSelectorDisplay:{type:Boolean,default:!1},initialEmptyRow:{type:Boolean,default:!1},showAddButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},keysSelectOptions:{type:Array,default:()=>[]}},data(){const e=this.$store.getters["i18n/t"],t=[{label:e("workload.scheduling.affinity.matchExpressions.in"),value:"In"},{label:e("workload.scheduling.affinity.matchExpressions.notIn"),value:"NotIn"},{label:e("workload.scheduling.affinity.matchExpressions.exists"),value:"Exists"},{label:e("workload.scheduling.affinity.matchExpressions.doesNotExist"),value:"DoesNotExist"}],o=[{label:e("workload.scheduling.affinity.matchExpressions.in"),value:"In"},{label:e("workload.scheduling.affinity.matchExpressions.notIn"),value:"NotIn"},{label:e("workload.scheduling.affinity.matchExpressions.exists"),value:"Exists"},{label:e("workload.scheduling.affinity.matchExpressions.doesNotExist"),value:"DoesNotExist"},{label:e("workload.scheduling.affinity.matchExpressions.lessThan"),value:"Lt"},{label:e("workload.scheduling.affinity.matchExpressions.greaterThan"),value:"Gt"}],a=this.type===C.NW?o:t;let n;if(this.matchingSelectorDisplay){const e={matchFields:[],matchExpressions:[]};["matchFields","matchExpressions"].forEach((t=>{e[t]=this.parseRules(this.value[t],t)})),n=[...e.matchFields,...e.matchExpressions]}else(0,_.cy)(this.value)?(n=[...this.value],n=this.parseRules(n)):(n=(0,A.C6)(this.value.matchLabels,this.value.matchExpressions),n=this.parseRules(n));if(!n.length&&this.initialEmptyRow&&!this.isView){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),n.push(e)}return{ops:a,rules:n,custom:[]}},computed:{isView(){return"view"===this.mode},node(){return C.NW},pod(){return C.Sm},hasKeySelectOptions(){return!!this.keysSelectOptions?.length},matchingSelectOptions(){return[{label:this.t("workload.scheduling.affinity.matchExpressions.label"),value:"matchExpressions"},{label:this.t("workload.scheduling.affinity.matchFields.label"),value:"matchFields"}]},...(0,D.L8)({t:"i18n/t"})},methods:{parseRules(e,t){return e?.length?e.map((e=>{const o=(0,T.o8)(e);return o.values&&"string"!==typeof o.values&&(o.values=o.values.join(", ")),t&&(o.matching=t),o})):[]},removeRule(e){(0,_.Gj)(this.rules,e),this.update()},addRule(){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),this.rules.push(e)},update(){this.$nextTick((()=>{const e=this.rules.map((e=>{const t={key:e.key,operator:e.operator};this.matchingSelectorDisplay&&(t.matching=e.matching);let o=(e.values||"").trim();return"Exists"!==e.operator&&"DoesNotExist"!==e.operator||(o=null),null!==o&&(t.values=o.split(/\s*,\s*/)),t})).filter((e=>!!e));(0,_.cy)(this.value)||this.matchingSelectorDisplay?this.$emit("update:value",e):this.$emit("update:value",(0,A.CR)(e))}))}}},I=(o(93071),o(47433));const L=(0,I.A)(O,[["render",N],["__scopeId","data-v-023836b7"]]);var M=L},76655:function(e,t,o){"use strict";o.d(t,{A:function(){return O}});var a=o(9274);const n={class:"row mb-20"},i={key:0,class:"row"},l={class:"col span-6"};function r(e,t,o,r,s,d){const c=(0,a.resolveComponent)("RadioGroup"),u=(0,a.resolveComponent)("LabeledSelect"),p=(0,a.resolveComponent)("NodeAffinity");return(0,a.openBlock)(),(0,a.createElementBlock)("div",null,[(0,a.createElementVNode)("div",n,[(0,a.createVNode)(c,{value:s.selectNode,"onUpdate:value":t[0]||(t[0]=e=>s.selectNode=e),name:"selectNode",options:d.selectNodeOptions,mode:o.mode,onInput:d.update},null,8,["value","options","mode","onInput"])]),"nodeSelector"===s.selectNode?((0,a.openBlock)(),(0,a.createElementBlock)("div",i,[(0,a.createElementVNode)("div",l,[(0,a.createVNode)(u,{value:s.nodeName,"onUpdate:value":t[1]||(t[1]=e=>s.nodeName=e),label:e.t("workload.scheduling.affinity.nodeName"),options:o.nodes||[],mode:o.mode,multiple:!1,loading:o.loading,onInput:d.update},null,8,["value","label","options","mode","loading","onInput"])])])):"affinity"===s.selectNode?((0,a.openBlock)(),(0,a.createBlock)(p,{key:1,value:s.nodeAffinity,"onUpdate:value":t[2]||(t[2]=e=>s.nodeAffinity=e),mode:o.mode,onInput:d.update},null,8,["value","mode","onInput"])):(0,a.createCommentVNode)("",!0)])}var s=o(65359),d=o(10196),c=o(40408);const u={class:"col span-12"},p={class:"row"},h={class:"col span-9"},m={key:0,class:"col span-3"};function f(e,t,o,n,i,l){const r=(0,a.resolveComponent)("LabeledSelect"),s=(0,a.resolveComponent)("LabeledInput"),d=(0,a.resolveComponent)("MatchExpressions"),c=(0,a.resolveComponent)("ArrayListGrouped");return(0,a.openBlock)(),(0,a.createElementBlock)("div",{class:"row","onUpdate:value":t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},[(0,a.createElementVNode)("div",u,[(0,a.createVNode)(c,{value:e.allSelectorTerms,"onUpdate:value":t[0]||(t[0]=t=>e.allSelectorTerms=t),class:"mt-20",mode:o.mode,"default-add-value":{matchExpressions:[]},"add-label":e.t("workload.scheduling.affinity.addNodeSelector"),onRemove:l.remove},{default:(0,a.withCtx)((t=>[(0,a.createElementVNode)("div",p,[(0,a.createElementVNode)("div",h,[(0,a.createVNode)(r,{options:l.affinityOptions,value:l.priorityDisplay(t.row.value),label:e.t("workload.scheduling.affinity.priority"),mode:o.mode,"data-testid":`node-affinity-priority-index${t.i}`,"onUpdate:value":e=>l.changePriority(t.row.value)},null,8,["options","value","label","mode","data-testid","onUpdate:value"])]),"weight"in t.row.value?((0,a.openBlock)(),(0,a.createElementBlock)("div",m,[(0,a.createVNode)(s,{value:t.row.value.weight,"onUpdate:value":[e=>t.row.value.weight=e,l.update],valueModifiers:{number:!0},mode:o.mode,type:"number",min:"1",max:"100",label:e.t("workload.scheduling.affinity.weight.label"),placeholder:e.t("workload.scheduling.affinity.weight.placeholder"),"data-testid":`node-affinity-weight-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"])])):(0,a.createCommentVNode)("",!0)]),(0,a.createVNode)(d,{value:o.matchingSelectorDisplay?t.row.value:t.row.value.matchExpressions,"matching-selector-display":o.matchingSelectorDisplay,mode:o.mode,class:"col span-12 mt-20",type:l.node,"show-remove":!1,"data-testid":`node-affinity-expressions-index${t.i}`,"onUpdate:value":e=>l.updateExpressions(t.row.value,e)},null,8,["value","matching-selector-display","mode","type","data-testid","onUpdate:value"])])),_:1},8,["value","mode","add-label","onRemove"])])],32)}var v=o(12784),g=o.n(v),y=o(14220),b=o(76978),w=o(35664),k=o(51270),E=o(79380),S=o(92043),x=o(31097),N={emits:["update:value"],components:{ArrayListGrouped:x.A,MatchExpressions:k.A,LabeledSelect:c.A,LabeledInput:E.o},props:{value:{type:Object,default:()=>({})},mode:{type:String,default:"create"},matchingSelectorDisplay:{type:Boolean,default:!1}},data(){if(this.value.required)return{nodeSelectorTerms:this.value.required.nodeSelectorTerms};{const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:t={}}=this.value,{nodeSelectorTerms:o=[]}=t,a=[...e,...o].map((e=>{const t=(0,b.o8)(e);return t._id=(0,S.vx)(4),e.preference&&(Object.assign(t,e.preference),delete t.preference),t}));return{allSelectorTerms:a,weightedNodeSelectorTerms:e,defaultWeight:1,rerenderNums:(0,S.vx)(4)}}},computed:{...(0,s.L8)({t:"i18n/t"}),isView(){return this.mode===y.nW},hasWeighted(){return!!this.weightedNodeSelectorTerms},node(){return w.NW},affinityOptions(){const e=[this.t("workload.scheduling.affinity.preferred"),this.t("workload.scheduling.affinity.required")];return e}},created(){this.queueUpdate=g()(this.update,500)},methods:{update(){const e={},t={nodeSelectorTerms:[]},o=[];this.allSelectorTerms.forEach((e=>{const a={...e};if(a.matchExpressions&&(a.matchExpressions=(a.matchExpressions||[]).map((e=>{const t={...e};return delete t.matching,t}))),a.matchFields&&(a.matchFields=(a.matchFields||[]).map((e=>{const t={...e};return delete t.matching,t}))),a.weight){const e={weight:a.weight,preference:a};delete e.preference.weight,o.push(e)}else t.nodeSelectorTerms.push(a)})),o.length&&(e.preferredDuringSchedulingIgnoredDuringExecution=o),t.nodeSelectorTerms.length&&(e.requiredDuringSchedulingIgnoredDuringExecution=t),this.$emit("update:value",e)},remove(){this.rerenderNums=(0,S.vx)(4),this.queueUpdate()},changePriority(e){e.weight?delete e["weight"]:e["weight"]=1,this.update()},priorityDisplay(e){return"weight"in e?this.t("workload.scheduling.affinity.preferred"):this.t("workload.scheduling.affinity.required")},updateExpressions(e,t){const o={matchFields:[],matchExpressions:[]};t.length&&(t.forEach((e=>{o[e.matching||"matchExpressions"].push(e)})),e["matchFields"]=o.matchFields,e["matchExpressions"]=o.matchExpressions,this.update())},get:b.Jt,isEmpty:b.Im}},C=o(47433);const B=(0,C.A)(N,[["render",f]]);var D=B,_=o(11518),T=o(2841),A={components:{RadioGroup:d.z,LabeledSelect:c.A,NodeAffinity:D},props:{value:{type:Object,default:()=>({})},nodes:{type:Array,default:()=>[]},mode:{type:String,default:"create"},loading:{default:!1,type:Boolean}},data(){const e=this.$store.getters["currentProduct"].inStore===_.T;let{nodeName:t=""}=this.value;const{affinity:o={},nodeSelector:a={}}=this.value,{nodeAffinity:n={}}=o;let i=null;return this.value.nodeName?i="nodeSelector":e&&this.value?.nodeSelector?.[T.yA]?(i="nodeSelector",t=a[T.yA]):(0,b.Im)(n)||(i="affinity"),n.requiredDuringSchedulingIgnoredDuringExecution||(n["requiredDuringSchedulingIgnoredDuringExecution"]={nodeSelectorTerms:[]}),n.preferredDuringSchedulingIgnoredDuringExecution||(n["preferredDuringSchedulingIgnoredDuringExecution"]=[]),{selectNode:i,nodeName:t,nodeAffinity:n,nodeSelector:a}},computed:{...(0,s.L8)({t:"i18n/t"}),isView(){return this.mode===y.nW},isHarvester(){return this.$store.getters["currentProduct"].inStore===_.T},selectNodeOptions(){const e=this.isHarvester?"harvester.virtualMachine":"workload",t=[{label:this.t(`${e}.scheduling.affinity.anyNode`),value:null},{label:this.t(`${e}.scheduling.affinity.specificNode`),value:"nodeSelector"},{label:this.t(`${e}.scheduling.affinity.schedulingRules`),value:"affinity"}];return t}},methods:{update(){const{nodeName:e,nodeSelector:t,nodeAffinity:o}=this;switch(this.selectNode){case"nodeSelector":this.isHarvester?Object.assign(this.value,{nodeSelector:{[T.yA]:e}}):Object.assign(this.value,{nodeSelector:t,nodeName:e}),this.value?.affinity?.nodeAffinity&&delete this.value.affinity.nodeAffinity;break;case"affinity":delete this.value.nodeName,delete this.value.nodeSelector,this.value.affinity?Object.assign(this.value.affinity,{nodeAffinity:o}):Object.assign(this.value,{affinity:{nodeAffinity:o}});break;default:delete this.value.nodeName,delete this.value.nodeSelector,this.value?.affinity?.nodeAffinity&&delete this.value.affinity.nodeAffinity}},isEmpty:b.Im},watch:{"value.nodeSelector":{handler(e){if(this.isHarvester&&e?.[T.yA]){this.selectNode="nodeSelector";const t=e[T.yA];this.nodeName=t;const o=this.nodes.map((e=>e.value));t&&!o.includes(t)&&(this.$store.dispatch("growl/error",{title:this.$store.getters["i18n/t"]("harvester.vmTemplate.tips.notExistNode.title",{name:t}),message:this.$store.getters["i18n/t"]("harvester.vmTemplate.tips.notExistNode.message")},{root:!0}),delete this.value.nodeSelector,this["nodeName"]="",this["selectNode"]=null)}}}}};const V=(0,C.A)(A,[["render",r]]);var O=V},21414:function(e,t,o){"use strict";o.d(t,{A:function(){return b}});var a=o(9274);const n=e=>((0,a.pushScopeId)("data-v-03da7481"),e=e(),(0,a.popScopeId)(),e),i={class:"password"},l={key:0,class:"addon"},r={key:1,class:"addon"},s={key:0,class:"mt-10 genPassword"},d=n((()=>(0,a.createElementVNode)("i",{class:"icon icon-refresh"},null,-1)));function c(e,t,o,n,c,u){const p=(0,a.resolveComponent)("LabeledInput");return(0,a.openBlock)(),(0,a.createElementBlock)("div",i,[(0,a.createVNode)(p,(0,a.mergeProps)({ref:"input",value:u.password,"onUpdate:value":t[3]||(t[3]=e=>u.password=e)},u.attributes,{type:o.isRandom||c.reveal?"text":"password",readonly:o.isRandom,label:o.label,required:o.required,disabled:o.isRandom,"ignore-password-managers":o.ignorePasswordManagers,mode:o.mode,onBlur:t[4]||(t[4]=t=>e.$emit("blur",t))}),{suffix:(0,a.withCtx)((()=>[o.isRandom?((0,a.openBlock)(),(0,a.createElementBlock)("div",l,[(0,a.createElementVNode)("a",{href:"#",onClick:t[0]||(t[0]=(0,a.withModifiers)((e=>u.copyTextToClipboard(u.password)),["prevent","stop"]))},(0,a.toDisplayString)(e.t("action.copy")),1)])):((0,a.openBlock)(),(0,a.createElementBlock)("div",r,[c.reveal?((0,a.openBlock)(),(0,a.createElementBlock)("a",{key:0,tabindex:"-1",href:"#",onClick:t[1]||(t[1]=(0,a.withModifiers)((e=>c.reveal=!1),["prevent","stop"]))},(0,a.toDisplayString)(e.t("action.hide")),1)):((0,a.openBlock)(),(0,a.createElementBlock)("a",{key:1,tabindex:"-1",href:"#",onClick:t[2]||(t[2]=(0,a.withModifiers)((e=>c.reveal=!0),["prevent","stop"]))},(0,a.toDisplayString)(e.t("action.show")),1))]))])),_:1},16,["value","type","readonly","label","required","disabled","ignore-password-managers","mode"]),o.isRandom?((0,a.openBlock)(),(0,a.createElementBlock)("div",s,[(0,a.createElementVNode)("a",{href:"#",onClick:t[5]||(t[5]=(0,a.withModifiers)(((...e)=>u.generatePassword&&u.generatePassword(...e)),["prevent","stop"]))},[d,(0,a.createTextVNode)(" "+(0,a.toDisplayString)(e.t("changePassword.newGeneratedPassword")),1)])])):(0,a.createCommentVNode)("",!0)])}var u=o(65359),p=o(79380),h=o(92043),m=o(48881),f=o(14220),v={emits:["update:value","blur"],components:{LabeledInput:p.o},props:{value:{default:"",type:String},isRandom:{default:!1,type:Boolean},label:{default:"",type:String},name:{default:"",type:String},autocomplete:{type:String,default:""},required:{default:!1,type:Boolean},ignorePasswordManagers:{default:!1,type:Boolean},mode:{type:String,default:f.YQ}},data(){return{reveal:!1}},computed:{...(0,u.L8)({t:"i18n/t"}),password:{get(){return this.value},set(e){this.$emit("update:value",e)}},attributes(){const e={};return this.name&&(e.id=this.name,e.name=this.name),this.autocomplete&&(e.autocomplete=this.autocomplete),e}},watch:{isRandom(){this.isRandom&&this.generatePassword()}},created(){this.isRandom&&this.generatePassword()},methods:{copyTextToClipboard:m.e,generatePassword(){this.password=(0,h.vx)(16,h.LQ.ALPHA_NUM)},show(e){this.reveal=e},focus(){this.$refs.input.$refs.value.focus()}}},g=(o(22209),o(47433));const y=(0,g.A)(v,[["render",c],["__scopeId","data-v-03da7481"]]);var b=y},19413:function(e,t,o){"use strict";o.d(t,{A:function(){return V}});var a=o(9274);const n={class:"col span-12"},i={class:"row mt-20 mb-20"},l={class:"col span-6"},r={class:"col span-6"},s={class:"row"},d={key:0,class:"row mt-10 mb-20"},c={class:"row mt-20"},u={class:"col span-9"},p={key:0,class:"col span-3"};function h(e,t,o,h,m,f){const v=(0,a.resolveComponent)("LabeledSelect"),g=(0,a.resolveComponent)("RadioGroup"),y=(0,a.resolveComponent)("LabeledInput"),b=(0,a.resolveComponent)("MatchExpressions"),w=(0,a.resolveComponent)("ArrayListGrouped");return(0,a.openBlock)(),(0,a.createElementBlock)("div",{style:{width:"100%"},class:"row","onUpdate:value":t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},[(0,a.createElementVNode)("div",n,[(0,a.createVNode)(w,{value:m.allSelectorTerms,"onUpdate:value":t[0]||(t[0]=e=>m.allSelectorTerms=e),class:"mt-20","default-add-value":m.defaultAddValue,mode:o.mode,"add-label":f.addLabel,onRemove:f.remove},{default:(0,a.withCtx)((t=>[(0,a.createElementVNode)("div",i,[(0,a.createElementVNode)("div",l,[(0,a.createVNode)(v,{mode:o.mode,options:[e.t("workload.scheduling.affinity.affinityOption"),e.t("workload.scheduling.affinity.antiAffinityOption")],value:t.row.value._anti?e.t("workload.scheduling.affinity.antiAffinityOption"):e.t("workload.scheduling.affinity.affinityOption"),label:e.t("workload.scheduling.affinity.type"),"data-testid":`pod-affinity-type-index${t.i}`,"onUpdate:value":e=>t.row.value._anti=!t.row.value._anti},null,8,["mode","options","value","label","data-testid","onUpdate:value"])]),(0,a.createElementVNode)("div",r,[(0,a.createVNode)(v,{mode:o.mode,options:[e.t("workload.scheduling.affinity.preferred"),e.t("workload.scheduling.affinity.required")],value:f.priorityDisplay(t.row.value),label:e.t("workload.scheduling.affinity.priority"),"data-testid":`pod-affinity-priority-index${t.i}`,"onUpdate:value":e=>f.changePriority(t.row.value,t.i)},null,8,["mode","options","value","label","data-testid","onUpdate:value"])])]),(0,a.createElementVNode)("div",s,[(0,a.createVNode)(g,{options:f.namespaceSelectionOptions,labels:f.namespaceSelectionLabels,name:`namespaces-${t.row.value._id}`,mode:o.mode,value:t.row.value._namespaceOption,"data-testid":`pod-affinity-namespacetype-index${t.i}`,"onUpdate:value":e=>f.changeNamespaceMode(e,t.row.value,t.i)},null,8,["options","labels","name","mode","value","data-testid","onUpdate:value"])]),t.row.value._namespaceOption===m.NAMESPACE_SELECTION_OPTION_VALUES.SELECTED?((0,a.openBlock)(),(0,a.createElementBlock)("div",d,[f.hasNamespaces&&!o.forceInputNamespaceSelection?((0,a.openBlock)(),(0,a.createBlock)(v,{key:0,value:t.row.value.namespaces,"onUpdate:value":[e=>t.row.value.namespaces=e,e=>f.updateNamespaces(t.row.value,t.row.value.namespaces)],mode:o.mode,multiple:!0,taggable:!0,options:f.allNamespacesOptions,label:f.labeledInputNamespaceLabel,"data-testid":`pod-affinity-namespace-select-index${t.i}`},null,8,["value","onUpdate:value","mode","options","label","data-testid"])):((0,a.openBlock)(),(0,a.createBlock)(y,{key:1,value:t.row.value._namespaces,"onUpdate:value":[e=>t.row.value._namespaces=e,e=>f.updateNamespaces(t.row.value,t.row.value._namespaces)],mode:o.mode,label:f.labeledInputNamespaceLabel,placeholder:e.t("harvesterManager.affinity.namespaces.placeholder"),"data-testid":`pod-affinity-namespace-input-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"]))])):(0,a.createCommentVNode)("",!0),(0,a.createVNode)(b,{mode:o.mode,class:"col span-12 mt-20",type:f.pod,value:f.get(t.row.value,"labelSelector.matchExpressions"),"show-remove":!1,"data-testid":`pod-affinity-expressions-index${t.i}`,"onUpdate:value":e=>f.updateLabelSelector(e,t)},null,8,["mode","type","value","data-testid","onUpdate:value"]),(0,a.createElementVNode)("div",c,[(0,a.createElementVNode)("div",u,[f.hasNodes?((0,a.openBlock)(),(0,a.createBlock)(v,{key:0,value:t.row.value.topologyKey,"onUpdate:value":[e=>t.row.value.topologyKey=e,f.update],taggable:!0,searchable:!0,"close-on-select":!1,mode:o.mode,required:"",label:e.t("workload.scheduling.affinity.topologyKey.label"),placeholder:f.topologyKeyPlaceholder,options:f.existingNodeLabels,disabled:"view"===o.mode,loading:o.loading,"data-testid":`pod-affinity-topology-select-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","options","disabled","loading","data-testid"])):((0,a.openBlock)(),(0,a.createBlock)(y,{key:1,value:t.row.value.topologyKey,"onUpdate:value":[e=>t.row.value.topologyKey=e,f.update],mode:o.mode,label:e.t("workload.scheduling.affinity.topologyKey.label"),placeholder:f.topologyKeyPlaceholder,required:"","data-testid":`pod-affinity-topology-input-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"]))]),"weight"in t.row.value?((0,a.openBlock)(),(0,a.createElementBlock)("div",p,[(0,a.createVNode)(y,{value:t.row.value.weight,"onUpdate:value":[e=>t.row.value.weight=e,f.update],valueModifiers:{number:!0},mode:o.mode,type:"number",min:"1",max:"100",label:e.t("workload.scheduling.affinity.weight.label"),placeholder:e.t("workload.scheduling.affinity.weight.placeholder"),"data-testid":`pod-affinity-weight-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"])])):(0,a.createCommentVNode)("",!0)])])),_:1},8,["value","default-add-value","mode","add-label","onRemove"])])],32)}var m=o(65359),f=o(14220),v=o(76978),g=o(35664),y=o(51270),b=o(40408),w=o(10196),k=o(79380),E=o(92043),S=o(74302),x=o(12784),N=o.n(x),C=o(31097),B=o(68851);const D={POD:"pod",ALL:"all",SELECTED:"selected"};var _={emits:["update"],components:{ArrayListGrouped:C.A,MatchExpressions:y.A,LabeledSelect:b.A,RadioGroup:w.z,LabeledInput:k.o},props:{value:{type:Object,default:()=>({})},field:{type:String,default:"affinity"},mode:{type:String,default:"create"},nodes:{type:Array,default:()=>[]},namespaces:{type:Array,default:null},allNamespacesOptionAvailable:{default:!1,type:Boolean},forceInputNamespaceSelection:{default:!1,type:Boolean},removeLabeledInputNamespaceLabel:{default:!1,type:Boolean},overwriteLabels:{type:Object,default:null},loading:{default:!1,type:Boolean}},data(){this.value[this.field]||(this.value[this.field]={});const{podAffinity:e={},podAntiAffinity:t={}}=this.value[this.field],o=[...e.preferredDuringSchedulingIgnoredDuringExecution||[],...e.requiredDuringSchedulingIgnoredDuringExecution||[]].map((e=>{let t=(0,v.o8)(e);return t._id=(0,E.vx)(4),t._anti=!1,e.podAffinityTerm?(Object.assign(t,e.podAffinityTerm),t=this.parsePodAffinityTerm(t),delete t.podAffinityTerm):t=this.parsePodAffinityTerm(t),t})),a=[...t.preferredDuringSchedulingIgnoredDuringExecution||[],...t.requiredDuringSchedulingIgnoredDuringExecution||[]].map((e=>{let t=(0,v.o8)(e);return t._id=(0,E.vx)(4),t._anti=!0,e.podAffinityTerm?(Object.assign(t,e.podAffinityTerm),t=this.parsePodAffinityTerm(t),delete t.podAffinityTerm):t=this.parsePodAffinityTerm(t),t})),n=[...o,...a];return{allSelectorTerms:n,defaultWeight:1,rerenderNums:(0,E.vx)(4),NAMESPACE_SELECTION_OPTION_VALUES:D,defaultAddValue:{_namespaceOption:D.POD,matchExpressions:[],namespaces:null,_namespaces:null}}},computed:{...(0,m.L8)({t:"i18n/t"}),isView(){return this.mode===f.nW},pod(){return g.Sm},node(){return g.NW},labeledInputNamespaceLabel(){return this.removeLabeledInputNamespaceLabel?"":this.overwriteLabels?.namespaceInputLabel||this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")},allNamespacesOptions(){const e=this.$store.getters["currentStore"](g.CU),t=this.namespaces||this.$store.getters[`${e}/all`](g.CU),o=(0,S.Ul)(t.map((e=>({label:e.nameDisplay,value:e.id}))),"label");return o},existingNodeLabels(){return(0,B.oQ)(this.nodes)},hasNodes(){return this.nodes.length},namespaceSelectionOptions(){return this.allNamespacesOptionAvailable?[D.POD,D.ALL,D.SELECTED]:[D.POD,D.SELECTED]},namespaceSelectionLabels(){return this.overwriteLabels?.namespaceSelectionLabels?this.overwriteLabels?.namespaceSelectionLabels:this.allNamespacesOptionAvailable?[this.t("workload.scheduling.affinity.thisPodNamespace"),this.t("workload.scheduling.affinity.allNamespaces"),this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")]:[this.t("workload.scheduling.affinity.thisPodNamespace"),this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")]},addLabel(){return this.overwriteLabels?.addLabel||this.t("podAffinity.addLabel")},topologyKeyPlaceholder(){return this.overwriteLabels?.topologyKeyPlaceholder||this.t("workload.scheduling.affinity.topologyKey.placeholder")},hasNamespaces(){return this.allNamespacesOptions.length}},created(){this.queueUpdate=N()(this.update,500)},methods:{parsePodAffinityTerm(e){return e.namespaceSelector&&"object"===typeof e.namespaceSelector&&!Object.keys(e.namespaceSelector).length&&this.allNamespacesOptionAvailable?e._namespaceOption=D.ALL:e.namespaces?.length?e._namespaceOption=D.SELECTED:e._namespaceOption=D.POD,e._namespaces=(e.namespaces||[]).toString(),e},update(){const e={requiredDuringSchedulingIgnoredDuringExecution:[],preferredDuringSchedulingIgnoredDuringExecution:[]},t={requiredDuringSchedulingIgnoredDuringExecution:[],preferredDuringSchedulingIgnoredDuringExecution:[]};this.allSelectorTerms.forEach((o=>{if(o._anti)if(o.weight){const e={podAffinityTerm:{...o},weight:o.weight||this.defaultWeight};delete e.podAffinityTerm.weight,t.preferredDuringSchedulingIgnoredDuringExecution.push(e)}else t.requiredDuringSchedulingIgnoredDuringExecution.push(o);else if(o.weight){const t={podAffinityTerm:o,weight:o.weight||this.defaultWeight};e.preferredDuringSchedulingIgnoredDuringExecution.push(t)}else e.requiredDuringSchedulingIgnoredDuringExecution.push(o)})),Object.assign(this.value[this.field],{podAffinity:e,podAntiAffinity:t}),this.$emit("update",this.value)},remove(){this.rerenderNums=(0,E.vx)(4),this.queueUpdate()},changePriority(e,t){e.weight?delete e.weight:e.weight=this.defaultWeight,this.allSelectorTerms[t]=(0,v.o8)(e),this.queueUpdate()},priorityDisplay(e){return"weight"in e?this.t("workload.scheduling.affinity.preferred"):this.t("workload.scheduling.affinity.required")},changeNamespaceMode(e,t,o){switch(t["_namespaceOption"]=e,e){case D.POD:t.namespaces=null,t._namespaces=null,(t.namespaceSelector||null===t.namespaceSelector)&&delete t.namespaceSelector;break;case D.ALL:t.namespaceSelector={},(t.namespaces||null===t.namespaces)&&delete t.namespaces,(t._namespaces||null===t._namespaces)&&delete t._namespaces;break;default:t["namespaces"]=[],t["_namespaces"]="",(t.namespaceSelector||null===t.namespaceSelector)&&delete t.namespaceSelector;break}this.allSelectorTerms[o]=t,this.queueUpdate()},updateNamespaces(e,t){let o=t;"string"===typeof t&&(o=t.split(",").map((e=>e.trim())).filter((e=>e?.length))),e["namespaces"]=o,this.queueUpdate()},updateLabelSelector(e,t){this.set(t.row.value,"labelSelector.matchExpressions",e),this.queueUpdate()},isEmpty:v.Im,get:v.Jt,set:v.hZ}},T=(o(35567),o(47433));const A=(0,T.A)(_,[["render",h]]);var V=A},48377:function(e,t,o){"use strict";o.d(t,{A:function(){return A}});var a=o(9274);const n={class:"mt-20"};function i(e,t,o,i,l,r){const s=(0,a.resolveComponent)("Conditions"),d=(0,a.resolveComponent)("Tab"),c=(0,a.resolveComponent)("SortableTable"),u=(0,a.resolveComponent)("RelatedResources"),p=(0,a.resolveComponent)("Tabbed"),h=(0,a.resolveDirective)("t");return(0,a.openBlock)(),(0,a.createBlock)(p,(0,a.mergeProps)(e.$attrs,{"default-tab":o.defaultTab,onChanged:r.tabChange}),{default:(0,a.withCtx)((()=>[(0,a.renderSlot)(e.$slots,"default"),l.showConditions?((0,a.openBlock)(),(0,a.createBlock)(d,{key:0,"label-key":"resourceTabs.conditions.tab",name:"conditions",weight:-1,"display-alert-icon":r.conditionsHaveIssues},{default:(0,a.withCtx)((()=>[(0,a.createVNode)(s,{value:o.value},null,8,["value"])])),_:1},8,["display-alert-icon"])):(0,a.createCommentVNode)("",!0),r.showEvents?((0,a.openBlock)(),(0,a.createBlock)(d,{key:1,"label-key":"resourceTabs.events.tab",name:"events",weight:-2},{default:(0,a.withCtx)((()=>["events"===l.selectedTab?((0,a.openBlock)(),(0,a.createBlock)(c,{key:0,rows:r.events,headers:r.eventHeaders,"key-field":"id",search:!1,"table-actions":!1,"row-actions":!1,"default-sort-by":"date"},null,8,["rows","headers"])):(0,a.createCommentVNode)("",!0)])),_:1})):(0,a.createCommentVNode)("",!0),r.showRelated?((0,a.openBlock)(),(0,a.createBlock)(d,{key:2,name:"related","label-key":"resourceTabs.related.tab",weight:-3},{default:(0,a.withCtx)((()=>[(0,a.withDirectives)((0,a.createElementVNode)("h3",null,null,512),[[h,"resourceTabs.related.from"]]),(0,a.createVNode)(u,{"ignore-types":[o.value.type],value:o.value,direction:"from"},null,8,["ignore-types","value"]),(0,a.withDirectives)((0,a.createElementVNode)("h3",n,null,512),[[h,"resourceTabs.related.to"]]),(0,a.createVNode)(u,{"ignore-types":[o.value.type],value:o.value,direction:"to"},null,8,["ignore-types","value"])])),_:1})):(0,a.createCommentVNode)("",!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(l.extensionTabs,((e,t)=>((0,a.openBlock)(),(0,a.createBlock)(d,{key:`${e.name}${t}`,name:e.name,label:e.label,"label-key":e.labelKey,weight:e.weight,tooltip:e.tooltip,"show-header":e.showHeader,"display-alert-icon":e.displayAlertIcon,error:e.error,badge:e.badge},{default:(0,a.withCtx)((()=>[((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(e.component),{resource:o.value},null,8,["resource"]))])),_:2},1032,["name","label","label-key","weight","tooltip","show-header","display-alert-icon","error","badge"])))),128))])),_:3},16,["default-tab","onChanged"])}var l=o(81594),r=o(49584),s=o(91825);function d(e,t,o,n,i,l){const r=(0,a.resolveComponent)("SortableTable");return(0,a.openBlock)(),(0,a.createBlock)(r,{headers:l.headers,rows:l.rows,"key-field":"condition","default-sort-by":"condition","table-actions":!1,"row-actions":!1,search:!1},{"cell:condition":(0,a.withCtx)((({row:e})=>[(0,a.createElementVNode)("span",{class:(0,a.normalizeClass)({"text-error":e.error})},(0,a.toDisplayString)(e.condition),3)])),"cell:status":(0,a.withCtx)((({row:e})=>[(0,a.createElementVNode)("span",{class:(0,a.normalizeClass)({"text-error":e.error})},(0,a.toDisplayString)(e.status),3)])),_:1},8,["headers","rows"])}var c=o(30142),u={components:{SortableTable:c.A},props:{value:{type:Object,default:()=>({})}},computed:{headers(){return[{name:"condition",labelKey:"tableHeaders.condition",value:"condition",width:150,sort:"condition",dashIfEmpty:!0},{name:"status",labelKey:"tableHeaders.status",value:"status",width:75,sort:"status",dashIfEmpty:!0},{name:"time",labelKey:"tableHeaders.updated",value:"time",sort:"time",formatter:"LiveDate",formatterOpts:{addSuffix:!0},width:125,dashIfEmpty:!0},{name:"message",labelKey:"tableHeaders.message",value:"message",sort:["message"],dashIfEmpty:!0}]},rows(){return(this.value.status?.conditions||[]).map((e=>{let t=e.message||"";return e.reason&&(t=`[${e.reason}] ${t}`.trim()),{condition:e.type||"Unknown",status:e.status||"Unknown",error:e.error,time:e.lastProbeTime||e.lastUpdateTime||e.lastTransitionTime,message:t}}))}}},p=o(47433);const h=(0,p.A)(u,[["render",d]]);var m=h,f=o(35664),v=o(14220);function g(e,t,o,n,i,l){const r=(0,a.resolveComponent)("BadgeState"),s=(0,a.resolveComponent)("ResourceTable");return(0,a.openBlock)(),(0,a.createBlock)(s,{schema:null,rows:l.rows,headers:l.headers,search:!1,"table-actions":!1,namespaced:!0,"mangle-action-resources":l.getRealResources,"paging-label":"sortableTable.paging.generic",groupable:!1},{"cell:state":(0,a.withCtx)((({row:e})=>[e.real?((0,a.openBlock)(),(0,a.createBlock)(r,{key:0,value:e.real},null,8,["value"])):((0,a.openBlock)(),(0,a.createBlock)(r,{key:1,value:e},null,8,["value"]))])),_:1},8,["rows","headers","mangle-action-resources"])}var y=o(81651),b=o(89631),w=o(68774),k=o(74302),E=o(27278),S=o(23005),x={components:{ResourceTable:y.A,BadgeState:S.j},props:{value:{type:Object,required:!0},rel:{type:String,default:null},direction:{type:String,default:"to"},ignoreTypes:{type:Array,default:()=>[]}},data(){return{loadedResources:1}},computed:{filteredRelationships(){let e=this.value?.metadata?.relationships||[];return e=e.filter((e=>{const t=e[`${this.direction}Type`];return!(!t||this.ignoreTypes.includes(t))&&(!this.rel||e.rel===this.rel)})),e},rows(){if(this.loadedResources<1)return;const e=this.$store.getters["clusterId"],t=this.$store.getters["currentStore"](),o=[];for(const a of this.filteredRelationships){const n=a.state||"active",i=(0,b.uU)(n,a.error,a.transitioning),l=a[`${this.direction}Type`],r=this.$store.getters[`${t}/schemaFor`](l);let s=a[`${this.direction}Id`];if(!s)continue;let d=null;const c=s.indexOf("/"),u=`${l}/${d}/${s}`;c>0&&(d=s.substr(0,c),s=s.substr(c+1));const p={name:`c-cluster-product-resource${d?"-namespace":""}-id`,params:{product:E.o,cluster:"management"===t?"local":e,resource:l,namespace:d,id:s}};o.push({type:l,real:this.$store.getters[`${t}/byId`](l,a[`${this.direction}Id`]),id:a[`${this.direction}Id`],state:n,metadata:{namespace:d,name:s},_key:u,name:s,namespace:d,nameDisplay:s,nameSort:(0,k.RY)(s).toLowerCase(),stateColor:i,detailLocation:p,typeDisplay:this.$store.getters["type-map/labelFor"](r),stateDisplay:(0,b.ch)(n),stateBackground:i.replace("text-","bg-"),groupByLabel:d})}return o},headers(){return[w.c4,w.ZE,w.o_,w.CU]}},methods:{async getRealResources(e){const t=this.$store.getters["currentStore"](),o=await Promise.allSettled(e.map((e=>this.$store.dispatch(`${t}/find`,{type:e.type,id:e.id})))),a=[];for(let n=0;n<o.length;n++)"fulfilled"===o[n].status&&a.push(o[n].value);return this.loadedResources++,a}}};const N=(0,p.A)(x,[["render",g]]);var C=N,B=o(31915),D=o(25659),_={name:"ResourceTabs",components:{Tabbed:l.A,Tab:r.A,Conditions:m,SortableTable:c.A,RelatedResources:C},mixins:[s.A],props:{value:{type:Object,default:()=>({})},mode:{type:String,default:v.nW},defaultTab:{type:String,default:null},needConditions:{type:Boolean,default:!0},needEvents:{type:Boolean,default:!0},needRelated:{type:Boolean,default:!0},extensionParams:{type:Object,default:null}},data(){const e=this.$store.getters["currentStore"](f.ll);return{hasEvents:this.$store.getters[`${e}/schemaFor`](f.ll),allEvents:[],selectedTab:this.defaultTab,didLoadEvents:!1,extensionTabs:(0,D.A)(this,B.c7.TAB,B.lX.RESOURCE_DETAIL,this.$route,this,this.extensionParams),inStore:e,showConditions:!1}},beforeUnmount(){this.$store.dispatch("cluster/forgetType",f.ll)},fetch(){this.setShowConditions()},computed:{showEvents(){return this.isView&&this.needEvents&&this.hasEvents},showRelated(){return this.isView&&this.needRelated},eventHeaders(){return[{name:"type",label:this.t("tableHeaders.type"),value:"eventType",sort:"eventType"},{name:"reason",label:this.t("tableHeaders.reason"),value:"reason",sort:"reason"},{name:"date",label:this.t("tableHeaders.updated"),value:"date",sort:"date:desc",formatter:"LiveDate",formatterOpts:{addSuffix:!0},width:125},{name:"message",label:this.t("tableHeaders.message"),value:"message",sort:"message"}]},events(){return this.allEvents.filter((e=>e.involvedObject?.uid===this.value?.metadata?.uid)).map((e=>({reason:`${e.reason||this.t("generic.unknown")}${e.count>1?` (${e.count})`:""}`.trim(),message:e.message||this.t("generic.unknown"),date:e.lastTimestamp||e.firstTimestamp||e.metadata.creationTimestamp,eventType:e.eventType})))},conditionsHaveIssues(){return!!this.showConditions&&this.value.status?.conditions?.filter((e=>!(0,b.rv)(e))).some((e=>e.error))}},methods:{tabChange(e){if(this.selectedTab=e?.selectedName,!this.didLoadEvents&&"events"===this.selectedTab){const e=this.$store.getters["currentStore"](f.ll);this.$store.dispatch(`${e}/findAll`,{type:f.ll}).then((e=>{this.allEvents=e,this.didLoadEvents=!0}))}},async setShowConditions(){this.isView&&this.needConditions&&this.value?.type&&this.schema?.fetchResourceFields&&(await this.schema.fetchResourceFields(),this.showConditions=this.$store.getters[`${this.inStore}/pathExistsInSchema`](this.value.type,"status.conditions"))}}};const T=(0,p.A)(_,[["render",i]]);var A=T},77290:function(e,t,o){"use strict";o.d(t,{A:function(){return u}});var a=o(9274);function n(e,t,o,n,i,l){const r=(0,a.resolveComponent)("LabeledInput");return(0,a.openBlock)(),(0,a.createBlock)(r,(0,a.mergeProps)({ref:"value",value:l.displayValue},e.$attrs,{type:"number",min:o.min,mode:o.mode,label:o.label,delay:o.delay,"label-key":o.labelKey,tooltip:o.tooltip,"tooltip-key":o.tooltipKey,required:o.required,placeholder:o.placeholder,"hide-arrows":o.hideArrows,onChange:t[0]||(t[0]=e=>l.update(e.target.value)),onBlur:t[1]||(t[1]=e=>l.update(e.target.value))}),{suffix:(0,a.withCtx)((()=>[l.displayUnit?((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:0,class:(0,a.normalizeClass)(["addon",{"with-tooltip":o.tooltip||o.tooltipKey}])},(0,a.toDisplayString)(l.displayUnit),3)):(0,a.createCommentVNode)("",!0)])),_:1},16,["value","min","mode","label","delay","label-key","tooltip","tooltip-key","required","placeholder","hide-arrows"])}var i=o(95799),l=o(79380),r=o(14220),s={components:{LabeledInput:l.o},emits:["update:value","update:validation","change","blur"],props:{outputAs:{type:String,default:"number"},outputModifier:{type:Boolean,default:!1},inputExponent:{type:Number,default:0},baseUnit:{type:String,default:"B"},hideArrows:{type:Boolean,default:!1},increment:{type:Number,default:1e3},suffix:{type:String,default:null},mode:{type:String,default:r.G5},value:{type:[Number,String],default:null},label:{type:String,default:null},labelKey:{type:String,default:null},tooltip:{type:[String,Object],default:null},tooltipKey:{type:String,default:null},required:{type:Boolean,default:!1},min:{type:[Number,String],default:0},placeholder:{type:[String,Number],default:""},delay:{type:Number,default:0},positive:{type:Boolean,default:!1}},computed:{unit(){let e;return e=this.inputExponent>=0?i.QN[this.inputExponent]:i.kq[-1*this.inputExponent],1024===this.increment&&e&&(e+="i"),e},parsedValue(){return"string"===typeof this.value?(0,i.ao)(this.value):this.value},displayValue(){let e="";return(this.parsedValue||0===this.parsedValue)&&(e=(0,i.Mo)(this.parsedValue,{increment:this.increment,addSuffix:!1,maxExponent:this.inputExponent,minExponent:this.inputExponent})),e},displayUnit(){return this.suffix?this.suffix:this.unit+this.baseUnit}},methods:{focus(){const e=this.$refs.value;e&&e.focus()},update(e){let t=""===e?null:e;this.positive&&e<0&&(t=0),this.outputModifier?t=null===t?null:`${e}${this.unit}`:"string"===this.outputAs?t=null===t?"":`${e}`:t&&(t=this.unit?(0,i.ao)(`${t}${this.unit}`):parseInt(t)),this.$emit("update:value",t)}}},d=(o(99738),o(47433));const c=(0,d.A)(s,[["render",n],["__scopeId","data-v-de90d6f0"]]);var u=c},68454:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".node-selector{position:relative}",""]),t["default"]=r},40439:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".label[data-v-a3d99010]{display:flex;flex-direction:column}.label .value[data-v-a3d99010]{font-size:14px;line-height:18px}",""]),t["default"]=r},15829:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".label[data-v-357627fa]{display:flex;flex-direction:column}.label .value[data-v-357627fa]{font-size:14px;line-height:18px}",""]),t["default"]=r},42722:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".key-value{width:100%}.key-value .file-selector.role-link{text-transform:none;padding:0}.key-value .kv-container{display:grid;align-items:center;-moz-column-gap:20px;column-gap:20px}.key-value .kv-container label{margin-bottom:0}.key-value .kv-container .kv-item{width:100%;margin:10px 0 10px 0}.key-value .kv-container .kv-item.extra,.key-value .kv-container .kv-item.key{align-self:flex-start}.key-value .kv-container .kv-item.value .value-container.upload-button{position:relative;display:flex;justify-content:right;align-items:center}.key-value .kv-container .kv-item.value .value-container .file-selector{position:absolute;margin-right:5px}.key-value .kv-container .kv-item.value textarea{padding:10px 10px 10px 10px}.key-value .kv-container .kv-item .text-monospace:not(.conceal){font-family:monospace,monospace}.key-value .remove{text-align:center}.key-value .remove BUTTON{padding:0}.key-value .title{margin-bottom:10px}.key-value .title .read-from-file{float:right}.key-value input{height:40px;line-height:1}.key-value .footer .protip{float:right;padding:5px 0}.key-value .download{text-align:right}.key-value .copy-value{padding:0 0 0 10px}",""]),t["default"]=r},85692:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".labels__header[data-v-680c438c]{display:flex;justify-content:space-between}",""]),t["default"]=r},39823:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".operator .vs__dropdown-option[data-v-023836b7]{padding:3px 6px 3px 6px!important}.remove-expression[data-v-023836b7]{padding:8px;position:absolute;margin-bottom:10px;right:0;top:0;z-index:2}.remove-expression i[data-v-023836b7]{font-size:2em}.remove-container[data-v-023836b7]{display:flex;justify-content:center}.match-expression-header[data-v-023836b7],.match-expression-row[data-v-023836b7]{display:grid;grid-template-columns:1fr 1fr 1fr;margin:5px 0;grid-gap:1.75%}.match-expression-header>LABEL[data-v-023836b7],.match-expression-row>LABEL[data-v-023836b7]{margin:0}.match-expression-header[data-v-023836b7]:not(.view),.match-expression-row[data-v-023836b7]:not(.view){grid-template-columns:repeat(3,1fr) 50px}.match-expression-row>div>input[data-v-023836b7]{min-height:40px!important}.match-expression-header-matching[data-v-023836b7],.match-expression-row-matching[data-v-023836b7]{grid-template-columns:1fr 1fr 1fr 1fr}.match-expression-header-matching[data-v-023836b7]:not(.view),.match-expression-row-matching[data-v-023836b7]:not(.view){grid-template-columns:1fr 1fr 1fr 1fr 100px}",""]),t["default"]=r},37729:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".password[data-v-03da7481]{display:flex;flex-direction:column}.password .labeled-input .addon[data-v-03da7481]{padding-left:12px;min-width:65px}.password .genPassword[data-v-03da7481]{display:flex;justify-content:flex-end}",""]),t["default"]=r},49530:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,".addon.with-tooltip[data-v-de90d6f0]{position:relative;right:30px}",""]),t["default"]=r},76167:function(e,t,o){"use strict";o.r(t);var a=o(36758),n=o.n(a),i=o(40935),l=o.n(i),r=l()(n());r.push([e.id,'.toggle-container[data-v-05c40fdb]{align-items:center;display:flex}.toggle-container span[data-v-05c40fdb]:first-child{padding-right:6px}.toggle-container span[data-v-05c40fdb]:last-child{padding-left:6px}.switch[data-v-05c40fdb]{position:relative;display:inline-block;width:48px;height:24px}.switch input[data-v-05c40fdb]{opacity:0;width:0;height:0}.slider[data-v-05c40fdb]{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--checkbox-disabled-bg)}.slider[data-v-05c40fdb],.slider[data-v-05c40fdb]:before{position:absolute;transition:.4s}.slider[data-v-05c40fdb]:before{content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:var(--checkbox-tick)}input:checked+.slider[data-v-05c40fdb]{background-color:var(--checkbox-ticked-bg)}input:focus+.slider[data-v-05c40fdb]{box-shadow:0 0 1px var(--checkbox-ticked-bg)}input:checked+.slider[data-v-05c40fdb]:before{transform:translateX(24px)}.slider.round[data-v-05c40fdb]{border-radius:34px}.slider.round[data-v-05c40fdb]:before{border-radius:50%}',""]),t["default"]=r},24989:function(e,t,o){"use strict";o.d(t,{J:function(){return a}});const a={OPAQUE:"Opaque",SERVICE_ACCT:"kubernetes.io/service-account-token",DOCKER_JSON:"kubernetes.io/dockerconfigjson",BASIC:"kubernetes.io/basic-auth",SSH:"kubernetes.io/ssh-auth",TLS:"kubernetes.io/tls",BOOTSTRAP:"bootstrap.kubernetes.io/token",ISTIO_TLS:"istio.io/key-and-cert",HELM_RELEASE:"helm.sh/release.v1",FLEET_CLUSTER:"fleet.cattle.io/cluster-registration-values",CLOUD_CREDENTIAL:"provisioning.cattle.io/cloud-credential",RKE_AUTH_CONFIG:"rke.cattle.io/auth-config"}},98285:function(e,t,o){"use strict";o.d(t,{H:function(){return qt}});var a=o(9274);
|
|
/*!
|
|
* vue-draggable-next v2.2.0
|
|
* (c) 2023 Anish George
|
|
* @license MIT
|
|
*/
|
|
/**!
|
|
* Sortable 1.14.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/
|
|
function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function l(e){return l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},s.apply(this,arguments)}function d(e,t){if(null==e)return{};var o,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)o=i[a],t.indexOf(o)>=0||(n[o]=e[o]);return n}function c(e,t){if(null==e)return{};var o,a,n=d(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)o=i[a],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var u="1.14.0";function p(e){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var h=p(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),m=p(/Edge/i),f=p(/firefox/i),v=p(/safari/i)&&!p(/chrome/i)&&!p(/android/i),g=p(/iP(ad|od|hone)/i),y=p(/chrome/i)&&p(/android/i),b={capture:!1,passive:!1};function w(e,t,o){e.addEventListener(t,o,!h&&b)}function k(e,t,o){e.removeEventListener(t,o,!h&&b)}function E(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(o){return!1}return!1}}function S(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function x(e,t,o,a){if(e){o=o||document;do{if(null!=t&&(">"===t[0]?e.parentNode===o&&E(e,t):E(e,t))||a&&e===o)return e;if(e===o)break}while(e=S(e))}return null}var N,C=/\s+/g;function B(e,t,o){if(e&&t)if(e.classList)e.classList[o?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(C," ").replace(" "+t+" "," ");e.className=(a+(o?" "+t:"")).replace(C," ")}}function D(e,t,o){var a=e&&e.style;if(a){if(void 0===o)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),void 0===t?o:o[t];t in a||-1!==t.indexOf("webkit")||(t="-webkit-"+t),a[t]=o+("string"===typeof o?"":"px")}}function _(e,t){var o="";if("string"===typeof e)o=e;else do{var a=D(e,"transform");a&&"none"!==a&&(o=a+" "+o)}while(!t&&(e=e.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(o)}function T(e,t,o){if(e){var a=e.getElementsByTagName(t),n=0,i=a.length;if(o)for(;n<i;n++)o(a[n],n);return a}return[]}function A(){var e=document.scrollingElement;return e||document.documentElement}function V(e,t,o,a,n){if(e.getBoundingClientRect||e===window){var i,l,r,s,d,c,u;if(e!==window&&e.parentNode&&e!==A()?(i=e.getBoundingClientRect(),l=i.top,r=i.left,s=i.bottom,d=i.right,c=i.height,u=i.width):(l=0,r=0,s=window.innerHeight,d=window.innerWidth,c=window.innerHeight,u=window.innerWidth),(t||o)&&e!==window&&(n=n||e.parentNode,!h))do{if(n&&n.getBoundingClientRect&&("none"!==D(n,"transform")||o&&"static"!==D(n,"position"))){var p=n.getBoundingClientRect();l-=p.top+parseInt(D(n,"border-top-width")),r-=p.left+parseInt(D(n,"border-left-width")),s=l+i.height,d=r+i.width;break}}while(n=n.parentNode);if(a&&e!==window){var m=_(n||e),f=m&&m.a,v=m&&m.d;m&&(l/=v,r/=f,u/=f,c/=v,s=l+c,d=r+u)}return{top:l,left:r,bottom:s,right:d,width:u,height:c}}}function O(e,t,o){var a=U(e,!0),n=V(e)[t];while(a){var i=V(a)[o],l=void 0;if(l="top"===o||"left"===o?n>=i:n<=i,!l)return a;if(a===A())break;a=U(a,!1)}return!1}function I(e,t,o,a){var n=0,i=0,l=e.children;while(i<l.length){if("none"!==l[i].style.display&&l[i]!==We.ghost&&(a||l[i]!==We.dragged)&&x(l[i],o.draggable,e,!1)){if(n===t)return l[i];n++}i++}return null}function L(e,t){var o=e.lastElementChild;while(o&&(o===We.ghost||"none"===D(o,"display")||t&&!E(o,t)))o=o.previousElementSibling;return o||null}function M(e,t){var o=0;if(!e||!e.parentNode)return-1;while(e=e.previousElementSibling)"TEMPLATE"===e.nodeName.toUpperCase()||e===We.clone||t&&!E(e,t)||o++;return o}function $(e){var t=0,o=0,a=A();if(e)do{var n=_(e),i=n.a,l=n.d;t+=e.scrollLeft*i,o+=e.scrollTop*l}while(e!==a&&(e=e.parentNode));return[t,o]}function P(e,t){for(var o in e)if(e.hasOwnProperty(o))for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[o][a])return Number(o);return-1}function U(e,t){if(!e||!e.getBoundingClientRect)return A();var o=e,a=!1;do{if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var n=D(o);if(o.clientWidth<o.scrollWidth&&("auto"==n.overflowX||"scroll"==n.overflowX)||o.clientHeight<o.scrollHeight&&("auto"==n.overflowY||"scroll"==n.overflowY)){if(!o.getBoundingClientRect||o===document.body)return A();if(a||t)return o;a=!0}}}while(o=o.parentNode);return A()}function R(e,t){if(e&&t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function F(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function q(e,t){return function(){if(!N){var o=arguments,a=this;1===o.length?e.call(a,o[0]):e.apply(a,o),N=setTimeout((function(){N=void 0}),t)}}}function j(){clearTimeout(N),N=void 0}function K(e,t,o){e.scrollLeft+=t,e.scrollTop+=o}function X(e){var t=window.Polymer,o=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):o?o(e).clone(!0)[0]:e.cloneNode(!0)}var H="Sortable"+(new Date).getTime();function Y(){var e,t=[];return{captureAnimationState:function(){if(t=[],this.options.animation){var e=[].slice.call(this.el.children);e.forEach((function(e){if("none"!==D(e,"display")&&e!==We.ghost){t.push({target:e,rect:V(e)});var o=i({},t[t.length-1].rect);if(e.thisAnimationDuration){var a=_(e,!0);a&&(o.top-=a.f,o.left-=a.e)}e.fromRect=o}}))}},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(P(t,{target:e}),1)},animateAll:function(o){var a=this;if(!this.options.animation)return clearTimeout(e),void("function"===typeof o&&o());var n=!1,i=0;t.forEach((function(e){var t=0,o=e.target,l=o.fromRect,r=V(o),s=o.prevFromRect,d=o.prevToRect,c=e.rect,u=_(o,!0);u&&(r.top-=u.f,r.left-=u.e),o.toRect=r,o.thisAnimationDuration&&F(s,r)&&!F(l,r)&&(c.top-r.top)/(c.left-r.left)===(l.top-r.top)/(l.left-r.left)&&(t=W(c,s,d,a.options)),F(r,l)||(o.prevFromRect=l,o.prevToRect=r,t||(t=a.options.animation),a.animate(o,c,r,t)),t&&(n=!0,i=Math.max(i,t),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),t),o.thisAnimationDuration=t)})),clearTimeout(e),n?e=setTimeout((function(){"function"===typeof o&&o()}),i):"function"===typeof o&&o(),t=[]},animate:function(e,t,o,a){if(a){D(e,"transition",""),D(e,"transform","");var n=_(this.el),i=n&&n.a,l=n&&n.d,r=(t.left-o.left)/(i||1),s=(t.top-o.top)/(l||1);e.animatingX=!!r,e.animatingY=!!s,D(e,"transform","translate3d("+r+"px,"+s+"px,0)"),this.forRepaintDummy=z(e),D(e,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),D(e,"transform","translate3d(0,0,0)"),"number"===typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){D(e,"transition",""),D(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),a)}}}}function z(e){return e.offsetWidth}function W(e,t,o,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-o.top,2)+Math.pow(t.left-o.left,2))*a.animation}var G=[],Q={initializeByDefault:!0},J={mount:function(e){for(var t in Q)Q.hasOwnProperty(t)&&!(t in e)&&(e[t]=Q[t]);G.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),G.push(e)},pluginEvent:function(e,t,o){var a=this;this.eventCanceled=!1,o.cancel=function(){a.eventCanceled=!0};var n=e+"Global";G.forEach((function(a){t[a.pluginName]&&(t[a.pluginName][n]&&t[a.pluginName][n](i({sortable:t},o)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](i({sortable:t},o)))}))},initializePlugins:function(e,t,o,a){for(var n in G.forEach((function(a){var n=a.pluginName;if(e.options[n]||a.initializeByDefault){var i=new a(e,t,e.options);i.sortable=e,i.options=e.options,e[n]=i,s(o,i.defaults)}})),e.options)if(e.options.hasOwnProperty(n)){var i=this.modifyOption(e,n,e.options[n]);"undefined"!==typeof i&&(e.options[n]=i)}},getEventProperties:function(e,t){var o={};return G.forEach((function(a){"function"===typeof a.eventProperties&&s(o,a.eventProperties.call(t[a.pluginName],e))})),o},modifyOption:function(e,t,o){var a;return G.forEach((function(n){e[n.pluginName]&&n.optionListeners&&"function"===typeof n.optionListeners[t]&&(a=n.optionListeners[t].call(e[n.pluginName],o))})),a}};function Z(e){var t=e.sortable,o=e.rootEl,a=e.name,n=e.targetEl,l=e.cloneEl,r=e.toEl,s=e.fromEl,d=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,p=e.newDraggableIndex,f=e.originalEvent,v=e.putSortable,g=e.extraEventProperties;if(t=t||o&&o[H],t){var y,b=t.options,w="on"+a.charAt(0).toUpperCase()+a.substr(1);!window.CustomEvent||h||m?(y=document.createEvent("Event"),y.initEvent(a,!0,!0)):y=new CustomEvent(a,{bubbles:!0,cancelable:!0}),y.to=r||o,y.from=s||o,y.item=n||o,y.clone=l,y.oldIndex=d,y.newIndex=c,y.oldDraggableIndex=u,y.newDraggableIndex=p,y.originalEvent=f,y.pullMode=v?v.lastPutMode:void 0;var k=i(i({},g),J.getEventProperties(a,t));for(var E in k)y[E]=k[E];o&&o.dispatchEvent(y),b[w]&&b[w].call(t,y)}}var ee=["evt"],te=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.evt,n=c(o,ee);J.pluginEvent.bind(We)(e,t,i({dragEl:ae,parentEl:ne,ghostEl:ie,rootEl:le,nextEl:re,lastDownEl:se,cloneEl:de,cloneHidden:ce,dragStarted:Se,putSortable:ve,activeSortable:We.active,originalEvent:a,oldIndex:ue,oldDraggableIndex:he,newIndex:pe,newDraggableIndex:me,hideGhostForTarget:Xe,unhideGhostForTarget:He,cloneNowHidden:function(){ce=!0},cloneNowShown:function(){ce=!1},dispatchSortableEvent:function(e){oe({sortable:t,name:e,originalEvent:a})}},n))};function oe(e){Z(i({putSortable:ve,cloneEl:de,targetEl:ae,rootEl:le,oldIndex:ue,oldDraggableIndex:he,newIndex:pe,newDraggableIndex:me},e))}var ae,ne,ie,le,re,se,de,ce,ue,pe,he,me,fe,ve,ge,ye,be,we,ke,Ee,Se,xe,Ne,Ce,Be,De=!1,_e=!1,Te=[],Ae=!1,Ve=!1,Oe=[],Ie=!1,Le=[],Me="undefined"!==typeof document,$e=g,Pe=m||h?"cssFloat":"float",Ue=Me&&!y&&!g&&"draggable"in document.createElement("div"),Re=function(){if(Me){if(h)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Fe=function(e,t){var o=D(e),a=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),n=I(e,0,t),i=I(e,1,t),l=n&&D(n),r=i&&D(i),s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+V(n).width,d=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+V(i).width;if("flex"===o.display)return"column"===o.flexDirection||"column-reverse"===o.flexDirection?"vertical":"horizontal";if("grid"===o.display)return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&l["float"]&&"none"!==l["float"]){var c="left"===l["float"]?"left":"right";return!i||"both"!==r.clear&&r.clear!==c?"horizontal":"vertical"}return n&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||s>=a&&"none"===o[Pe]||i&&"none"===o[Pe]&&s+d>a)?"vertical":"horizontal"},qe=function(e,t,o){var a=o?e.left:e.top,n=o?e.right:e.bottom,i=o?e.width:e.height,l=o?t.left:t.top,r=o?t.right:t.bottom,s=o?t.width:t.height;return a===l||n===r||a+i/2===l+s/2},je=function(e,t){var o;return Te.some((function(a){var n=a[H].options.emptyInsertThreshold;if(n&&!L(a)){var i=V(a),l=e>=i.left-n&&e<=i.right+n,r=t>=i.top-n&&t<=i.bottom+n;return l&&r?o=a:void 0}})),o},Ke=function(e){function t(e,o){return function(a,n,i,l){var r=a.options.group.name&&n.options.group.name&&a.options.group.name===n.options.group.name;if(null==e&&(o||r))return!0;if(null==e||!1===e)return!1;if(o&&"clone"===e)return e;if("function"===typeof e)return t(e(a,n,i,l),o)(a,n,i,l);var s=(o?a:n).options.group.name;return!0===e||"string"===typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var o={},a=e.group;a&&"object"==l(a)||(a={name:a}),o.name=a.name,o.checkPull=t(a.pull,!0),o.checkPut=t(a.put),o.revertClone=a.revertClone,e.group=o},Xe=function(){!Re&&ie&&D(ie,"display","none")},He=function(){!Re&&ie&&D(ie,"display","")};Me&&document.addEventListener("click",(function(e){if(_e)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),_e=!1,!1}),!0);var Ye=function(e){if(ae){e=e.touches?e.touches[0]:e;var t=je(e.clientX,e.clientY);if(t){var o={};for(var a in e)e.hasOwnProperty(a)&&(o[a]=e[a]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[H]._onDragOver(o)}}},ze=function(e){ae&&ae.parentNode[H]._isOutsideThisEl(e.target)};function We(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[H]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Fe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.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:!1!==We.supportPointer&&"PointerEvent"in window&&!v,emptyInsertThreshold:5};for(var a in J.initializePlugins(this,e,o),o)!(a in t)&&(t[a]=o[a]);for(var n in Ke(t),this)"_"===n.charAt(0)&&"function"===typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!t.forceFallback&&Ue,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Te.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,Y())}function Ge(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Qe(e,t,o,a,n,i,l,r){var s,d,c=e[H],u=c.options.onMove;return!window.CustomEvent||h||m?(s=document.createEvent("Event"),s.initEvent("move",!0,!0)):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=o,s.draggedRect=a,s.related=n||t,s.relatedRect=i||V(t),s.willInsertAfter=r,s.originalEvent=l,e.dispatchEvent(s),u&&(d=u.call(c,s,l)),d}function Je(e){e.draggable=!1}function Ze(){Ie=!1}function et(e,t,o){var a=V(I(o.el,0,o.options,!0)),n=10;return t?e.clientX<a.left-n||e.clientY<a.top&&e.clientX<a.right:e.clientY<a.top-n||e.clientY<a.bottom&&e.clientX<a.left}function tt(e,t,o){var a=V(L(o.el,o.options.draggable)),n=10;return t?e.clientX>a.right+n||e.clientX<=a.right&&e.clientY>a.bottom&&e.clientX>=a.left:e.clientX>a.right&&e.clientY>a.top||e.clientX<=a.right&&e.clientY>a.bottom+n}function ot(e,t,o,a,n,i,l,r){var s=a?e.clientY:e.clientX,d=a?o.height:o.width,c=a?o.top:o.left,u=a?o.bottom:o.right,p=!1;if(!l)if(r&&Ce<d*n){if(!Ae&&(1===Ne?s>c+d*i/2:s<u-d*i/2)&&(Ae=!0),Ae)p=!0;else if(1===Ne?s<c+Ce:s>u-Ce)return-Ne}else if(s>c+d*(1-n)/2&&s<u-d*(1-n)/2)return at(t);return p=p||l,p&&(s<c+d*i/2||s>u-d*i/2)?s>c+d/2?1:-1:0}function at(e){return M(ae)<M(e)?1:-1}function nt(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,o=t.length,a=0;while(o--)a+=t.charCodeAt(o);return a.toString(36)}function it(e){Le.length=0;var t=e.getElementsByTagName("input"),o=t.length;while(o--){var a=t[o];a.checked&&Le.push(a)}}function lt(e){return setTimeout(e,0)}function rt(e){return clearTimeout(e)}We.prototype={constructor:We,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(xe=null)},_getDirection:function(e,t){return"function"===typeof this.options.direction?this.options.direction.call(this,e,t,ae):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,o=this.el,a=this.options,n=a.preventOnFilter,i=e.type,l=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,r=(l||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||r,d=a.filter;if(it(o),!ae&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||a.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!v||!r||"SELECT"!==r.tagName.toUpperCase())&&(r=x(r,a.draggable,o,!1),(!r||!r.animated)&&se!==r)){if(ue=M(r),he=M(r,a.draggable),"function"===typeof d){if(d.call(this,e,r,this))return oe({sortable:t,rootEl:s,name:"filter",targetEl:r,toEl:o,fromEl:o}),te("filter",t,{evt:e}),void(n&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(a){if(a=x(s,a.trim(),o,!1),a)return oe({sortable:t,rootEl:a,name:"filter",targetEl:r,fromEl:o,toEl:o}),te("filter",t,{evt:e}),!0})),d))return void(n&&e.cancelable&&e.preventDefault());a.handle&&!x(s,a.handle,o,!1)||this._prepareDragStart(e,l,r)}}},_prepareDragStart:function(e,t,o){var a,n=this,i=n.el,l=n.options,r=i.ownerDocument;if(o&&!ae&&o.parentNode===i){var s=V(o);if(le=i,ae=o,ne=ae.parentNode,re=ae.nextSibling,se=o,fe=l.group,We.dragged=ae,ge={target:ae,clientX:(t||e).clientX,clientY:(t||e).clientY},ke=ge.clientX-s.left,Ee=ge.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ae.style["will-change"]="all",a=function(){te("delayEnded",n,{evt:e}),We.eventCanceled?n._onDrop():(n._disableDelayedDragEvents(),!f&&n.nativeDraggable&&(ae.draggable=!0),n._triggerDragStart(e,t),oe({sortable:n,name:"choose",originalEvent:e}),B(ae,l.chosenClass,!0))},l.ignore.split(",").forEach((function(e){T(ae,e.trim(),Je)})),w(r,"dragover",Ye),w(r,"mousemove",Ye),w(r,"touchmove",Ye),w(r,"mouseup",n._onDrop),w(r,"touchend",n._onDrop),w(r,"touchcancel",n._onDrop),f&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ae.draggable=!0),te("delayStart",this,{evt:e}),!l.delay||l.delayOnTouchOnly&&!t||this.nativeDraggable&&(m||h))a();else{if(We.eventCanceled)return void this._onDrop();w(r,"mouseup",n._disableDelayedDrag),w(r,"touchend",n._disableDelayedDrag),w(r,"touchcancel",n._disableDelayedDrag),w(r,"mousemove",n._delayedDragTouchMoveHandler),w(r,"touchmove",n._delayedDragTouchMoveHandler),l.supportPointer&&w(r,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(a,l.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ae&&Je(ae),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;k(e,"mouseup",this._disableDelayedDrag),k(e,"touchend",this._disableDelayedDrag),k(e,"touchcancel",this._disableDelayedDrag),k(e,"mousemove",this._delayedDragTouchMoveHandler),k(e,"touchmove",this._delayedDragTouchMoveHandler),k(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):w(document,t?"touchmove":"mousemove",this._onTouchMove):(w(ae,"dragend",this),w(le,"dragstart",this._onDragStart));try{document.selection?lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(o){}},_dragStarted:function(e,t){if(De=!1,le&&ae){te("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",ze);var o=this.options;!e&&B(ae,o.dragClass,!1),B(ae,o.ghostClass,!0),We.active=this,e&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ye){this._lastX=ye.clientX,this._lastY=ye.clientY,Xe();var e=document.elementFromPoint(ye.clientX,ye.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(ye.clientX,ye.clientY),e===t)break;t=e}if(ae.parentNode[H]._isOutsideThisEl(e),t)do{if(t[H]){var o=void 0;if(o=t[H]._onDragOver({clientX:ye.clientX,clientY:ye.clientY,target:e,rootEl:t}),o&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);He()}},_onTouchMove:function(e){if(ge){var t=this.options,o=t.fallbackTolerance,a=t.fallbackOffset,n=e.touches?e.touches[0]:e,i=ie&&_(ie,!0),l=ie&&i&&i.a,r=ie&&i&&i.d,s=$e&&Be&&$(Be),d=(n.clientX-ge.clientX+a.x)/(l||1)+(s?s[0]-Oe[0]:0)/(l||1),c=(n.clientY-ge.clientY+a.y)/(r||1)+(s?s[1]-Oe[1]:0)/(r||1);if(!We.active&&!De){if(o&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(ie){i?(i.e+=d-(be||0),i.f+=c-(we||0)):i={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");D(ie,"webkitTransform",u),D(ie,"mozTransform",u),D(ie,"msTransform",u),D(ie,"transform",u),be=d,we=c,ye=n}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:le,t=V(ae,!0,$e,!0,e),o=this.options;if($e){Be=e;while("static"===D(Be,"position")&&"none"===D(Be,"transform")&&Be!==document)Be=Be.parentNode;Be!==document.body&&Be!==document.documentElement?(Be===document&&(Be=A()),t.top+=Be.scrollTop,t.left+=Be.scrollLeft):Be=A(),Oe=$(Be)}ie=ae.cloneNode(!0),B(ie,o.ghostClass,!1),B(ie,o.fallbackClass,!0),B(ie,o.dragClass,!0),D(ie,"transition",""),D(ie,"transform",""),D(ie,"box-sizing","border-box"),D(ie,"margin",0),D(ie,"top",t.top),D(ie,"left",t.left),D(ie,"width",t.width),D(ie,"height",t.height),D(ie,"opacity","0.8"),D(ie,"position",$e?"absolute":"fixed"),D(ie,"zIndex","100000"),D(ie,"pointerEvents","none"),We.ghost=ie,e.appendChild(ie),D(ie,"transform-origin",ke/parseInt(ie.style.width)*100+"% "+Ee/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,a=e.dataTransfer,n=o.options;te("dragStart",this,{evt:e}),We.eventCanceled?this._onDrop():(te("setupClone",this),We.eventCanceled||(de=X(ae),de.draggable=!1,de.style["will-change"]="",this._hideClone(),B(de,this.options.chosenClass,!1),We.clone=de),o.cloneId=lt((function(){te("clone",o),We.eventCanceled||(o.options.removeCloneOnHide||le.insertBefore(de,ae),o._hideClone(),oe({sortable:o,name:"clone"}))})),!t&&B(ae,n.dragClass,!0),t?(_e=!0,o._loopId=setInterval(o._emulateDragOver,50)):(k(document,"mouseup",o._onDrop),k(document,"touchend",o._onDrop),k(document,"touchcancel",o._onDrop),a&&(a.effectAllowed="move",n.setData&&n.setData.call(o,a,ae)),w(document,"drop",o),D(ae,"transform","translateZ(0)")),De=!0,o._dragStartId=lt(o._dragStarted.bind(o,t,e)),w(document,"selectstart",o),Se=!0,v&&D(document.body,"user-select","none"))},_onDragOver:function(e){var t,o,a,n,l=this.el,r=e.target,s=this.options,d=s.group,c=We.active,u=fe===d,p=s.sort,h=ve||c,m=this,f=!1;if(!Ie){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),r=x(r,s.draggable,l,!0),P("dragOver"),We.eventCanceled)return f;if(ae.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return R(!1);if(_e=!1,c&&!s.disabled&&(u?p||(a=ne!==le):ve===this||(this.lastPutMode=fe.checkPull(this,c,ae,e))&&d.checkPut(this,c,ae,e))){if(n="vertical"===this._getDirection(e,r),t=V(ae),P("dragOverValid"),We.eventCanceled)return f;if(a)return ne=le,U(),this._hideClone(),P("revert"),We.eventCanceled||(re?le.insertBefore(ae,re):le.appendChild(ae)),R(!0);var v=L(l,s.draggable);if(!v||tt(e,n,this)&&!v.animated){if(v===ae)return R(!1);if(v&&l===e.target&&(r=v),r&&(o=V(r)),!1!==Qe(le,l,ae,t,r,o,e,!!r))return U(),l.appendChild(ae),ne=l,F(),R(!0)}else if(v&&et(e,n,this)){var g=I(l,0,s,!0);if(g===ae)return R(!1);if(r=g,o=V(r),!1!==Qe(le,l,ae,t,r,o,e,!1))return U(),l.insertBefore(ae,g),ne=l,F(),R(!0)}else if(r.parentNode===l){o=V(r);var y,b,w=0,k=ae.parentNode!==l,E=!qe(ae.animated&&ae.toRect||t,r.animated&&r.toRect||o,n),S=n?"top":"left",N=O(r,"top","top")||O(ae,"top","top"),C=N?N.scrollTop:void 0;if(xe!==r&&(y=o[S],Ae=!1,Ve=!E&&s.invertSwap||k),w=ot(e,r,o,n,E?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Ve,xe===r),0!==w){var _=M(ae);do{_-=w,b=ne.children[_]}while(b&&("none"===D(b,"display")||b===ie))}if(0===w||b===r)return R(!1);xe=r,Ne=w;var T=r.nextElementSibling,A=!1;A=1===w;var $=Qe(le,l,ae,t,r,o,e,A);if(!1!==$)return 1!==$&&-1!==$||(A=1===$),Ie=!0,setTimeout(Ze,30),U(),A&&!T?l.appendChild(ae):r.parentNode.insertBefore(ae,A?T:r),N&&K(N,0,C-N.scrollTop),ne=ae.parentNode,void 0===y||Ve||(Ce=Math.abs(y-V(r)[S])),F(),R(!0)}if(l.contains(ae))return R(!1)}return!1}function P(s,d){te(s,m,i({evt:e,isOwner:u,axis:n?"vertical":"horizontal",revert:a,dragRect:t,targetRect:o,canSort:p,fromSortable:h,target:r,completed:R,onMove:function(o,a){return Qe(le,l,ae,t,o,V(o),e,a)},changed:F},d))}function U(){P("dragOverAnimationCapture"),m.captureAnimationState(),m!==h&&h.captureAnimationState()}function R(t){return P("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(m),m!==h&&(B(ae,ve?ve.options.ghostClass:c.options.ghostClass,!1),B(ae,s.ghostClass,!0)),ve!==m&&m!==We.active?ve=m:m===We.active&&ve&&(ve=null),h===m&&(m._ignoreWhileAnimating=r),m.animateAll((function(){P("dragOverAnimationComplete"),m._ignoreWhileAnimating=null})),m!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(r===ae&&!ae.animated||r===l&&!r.animated)&&(xe=null),s.dragoverBubble||e.rootEl||r===document||(ae.parentNode[H]._isOutsideThisEl(e.target),!t&&Ye(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function F(){pe=M(ae),me=M(ae,s.draggable),oe({sortable:m,name:"change",toEl:l,newIndex:pe,newDraggableIndex:me,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){k(document,"mousemove",this._onTouchMove),k(document,"touchmove",this._onTouchMove),k(document,"pointermove",this._onTouchMove),k(document,"dragover",Ye),k(document,"mousemove",Ye),k(document,"touchmove",Ye)},_offUpEvents:function(){var e=this.el.ownerDocument;k(e,"mouseup",this._onDrop),k(e,"touchend",this._onDrop),k(e,"pointerup",this._onDrop),k(e,"touchcancel",this._onDrop),k(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;pe=M(ae),me=M(ae,o.draggable),te("drop",this,{evt:e}),ne=ae&&ae.parentNode,pe=M(ae),me=M(ae,o.draggable),We.eventCanceled||(De=!1,Ve=!1,Ae=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rt(this.cloneId),rt(this._dragStartId),this.nativeDraggable&&(k(document,"drop",this),k(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),v&&D(document.body,"user-select",""),D(ae,"transform",""),e&&(Se&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(le===ne||ve&&"clone"!==ve.lastPutMode)&&de&&de.parentNode&&de.parentNode.removeChild(de),ae&&(this.nativeDraggable&&k(ae,"dragend",this),Je(ae),ae.style["will-change"]="",Se&&!De&&B(ae,ve?ve.options.ghostClass:this.options.ghostClass,!1),B(ae,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:ne,newIndex:null,newDraggableIndex:null,originalEvent:e}),le!==ne?(pe>=0&&(oe({rootEl:ne,name:"add",toEl:ne,fromEl:le,originalEvent:e}),oe({sortable:this,name:"remove",toEl:ne,originalEvent:e}),oe({rootEl:ne,name:"sort",toEl:ne,fromEl:le,originalEvent:e}),oe({sortable:this,name:"sort",toEl:ne,originalEvent:e})),ve&&ve.save()):pe!==ue&&pe>=0&&(oe({sortable:this,name:"update",toEl:ne,originalEvent:e}),oe({sortable:this,name:"sort",toEl:ne,originalEvent:e})),We.active&&(null!=pe&&-1!==pe||(pe=ue,me=he),oe({sortable:this,name:"end",toEl:ne,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){te("nulling",this),le=ae=ne=ie=re=de=se=ce=ge=ye=Se=pe=me=ue=he=xe=Ne=ve=fe=We.dragged=We.ghost=We.clone=We.active=null,Le.forEach((function(e){e.checked=!0})),Le.length=be=we=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ae&&(this._onDragOver(e),Ge(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],o=this.el.children,a=0,n=o.length,i=this.options;a<n;a++)e=o[a],x(e,i.draggable,this.el,!1)&&t.push(e.getAttribute(i.dataIdAttr)||nt(e));return t},sort:function(e,t){var o={},a=this.el;this.toArray().forEach((function(e,t){var n=a.children[t];x(n,this.options.draggable,a,!1)&&(o[e]=n)}),this),t&&this.captureAnimationState(),e.forEach((function(e){o[e]&&(a.removeChild(o[e]),a.appendChild(o[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return x(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(void 0===t)return o[e];var a=J.modifyOption(this,e,t);o[e]="undefined"!==typeof a?a:t,"group"===e&&Ke(o)},destroy:function(){te("destroy",this);var e=this.el;e[H]=null,k(e,"mousedown",this._onTapStart),k(e,"touchstart",this._onTapStart),k(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(k(e,"dragover",this),k(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Te.splice(Te.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ce){if(te("hideClone",this),We.eventCanceled)return;D(de,"display","none"),this.options.removeCloneOnHide&&de.parentNode&&de.parentNode.removeChild(de),ce=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ce){if(te("showClone",this),We.eventCanceled)return;ae.parentNode!=le||this.options.group.revertClone?re?le.insertBefore(de,re):le.appendChild(de):le.insertBefore(de,ae),this.options.group.revertClone&&this.animate(ae,de),D(de,"display",""),ce=!1}}else this._hideClone()}},Me&&w(document,"touchmove",(function(e){(We.active||De)&&e.cancelable&&e.preventDefault()})),We.utils={on:w,off:k,css:D,find:T,is:function(e,t){return!!x(e,t,e,!1)},extend:R,throttle:q,closest:x,toggleClass:B,clone:X,index:M,nextTick:lt,cancelNextTick:rt,detectDirection:Fe,getChild:I},We.get=function(e){return e[H]},We.mount=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(We.utils=i(i({},We.utils),e.utils)),J.mount(e)}))},We.create=function(e,t){return new We(e,t)},We.version=u;var st,dt,ct,ut,pt,ht,mt=[],ft=!1;function vt(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"===typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):t.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?k(document,"dragover",this._handleAutoScroll):(k(document,"pointermove",this._handleFallbackAutoScroll),k(document,"touchmove",this._handleFallbackAutoScroll),k(document,"mousemove",this._handleFallbackAutoScroll)),yt(),gt(),j()},nulling:function(){pt=dt=st=ft=ht=ct=ut=null,mt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var o=this,a=(e.touches?e.touches[0]:e).clientX,n=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(a,n);if(pt=e,t||this.options.forceAutoScrollFallback||m||h||v){bt(e,this.options,i,t);var l=U(i,!0);!ft||ht&&a===ct&&n===ut||(ht&&yt(),ht=setInterval((function(){var i=U(document.elementFromPoint(a,n),!0);i!==l&&(l=i,gt()),bt(e,o.options,i,t)}),10),ct=a,ut=n)}else{if(!this.options.bubbleScroll||U(i,!0)===A())return void gt();bt(e,this.options,U(i,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}function gt(){mt.forEach((function(e){clearInterval(e.pid)})),mt=[]}function yt(){clearInterval(ht)}var bt=q((function(e,t,o,a){if(t.scroll){var n,i=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,s=t.scrollSpeed,d=A(),c=!1;dt!==o&&(dt=o,gt(),st=t.scroll,n=t.scrollFn,!0===st&&(st=U(o,!0)));var u=0,p=st;do{var h=p,m=V(h),f=m.top,v=m.bottom,g=m.left,y=m.right,b=m.width,w=m.height,k=void 0,E=void 0,S=h.scrollWidth,x=h.scrollHeight,N=D(h),C=h.scrollLeft,B=h.scrollTop;h===d?(k=b<S&&("auto"===N.overflowX||"scroll"===N.overflowX||"visible"===N.overflowX),E=w<x&&("auto"===N.overflowY||"scroll"===N.overflowY||"visible"===N.overflowY)):(k=b<S&&("auto"===N.overflowX||"scroll"===N.overflowX),E=w<x&&("auto"===N.overflowY||"scroll"===N.overflowY));var _=k&&(Math.abs(y-i)<=r&&C+b<S)-(Math.abs(g-i)<=r&&!!C),T=E&&(Math.abs(v-l)<=r&&B+w<x)-(Math.abs(f-l)<=r&&!!B);if(!mt[u])for(var O=0;O<=u;O++)mt[O]||(mt[O]={});mt[u].vx==_&&mt[u].vy==T&&mt[u].el===h||(mt[u].el=h,mt[u].vx=_,mt[u].vy=T,clearInterval(mt[u].pid),0==_&&0==T||(c=!0,mt[u].pid=setInterval(function(){a&&0===this.layer&&We.active._onTouchMove(pt);var t=mt[this.layer].vy?mt[this.layer].vy*s:0,o=mt[this.layer].vx?mt[this.layer].vx*s:0;"function"===typeof n&&"continue"!==n.call(We.dragged.parentNode[H],o,t,e,pt,mt[this.layer].el)||K(mt[this.layer].el,o,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==d&&(p=U(p,!1)));ft=c}}),30),wt=function(e){var t=e.originalEvent,o=e.putSortable,a=e.dragEl,n=e.activeSortable,i=e.dispatchSortableEvent,l=e.hideGhostForTarget,r=e.unhideGhostForTarget;if(t){var s=o||n;l();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);r(),s&&!s.el.contains(c)&&(i("spill"),this.onSpill({dragEl:a,putSortable:o}))}};function kt(){}function Et(){}function St(){return"undefined"!==typeof window?window.console:o.g.console}kt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var a=I(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:wt},s(kt,{pluginName:"revertOnSpill"}),Et.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable,a=o||this.sortable;a.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),a.animateAll()},drop:wt},s(Et,{pluginName:"removeOnSpill"}),We.mount(new vt),We.mount(Et,kt);const xt=St();function Nt(e){const t=Object.create(null);return function(o){const a=t[o];return a||(t[o]=e(o))}}const Ct=/-(\w)/g,Bt=Nt((e=>e.replace(Ct,((e,t)=>t?t.toUpperCase():""))));function Dt(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function _t(e,t,o){const a=0===o?e.children[0]:e.children[o-1].nextSibling;e.insertBefore(t,a)}function Tt(e,t){return Object.values(e).indexOf(t)}function At(e,t,o,a){if(!e)return[];const n=Object.values(e),i=t.length-a,l=[...t].map(((e,t)=>t>=i?n.length:n.indexOf(e)));return l}function Vt(e,t){this.$nextTick((()=>this.$emit(e.toLowerCase(),t)))}function Ot(e){return t=>{null!==this.realList&&this["onDrag"+e](t),Vt.call(this,e,t)}}function It(e){return["transition-group","TransitionGroup"].includes(e)}function Lt(e){if(!e||1!==e.length)return!1;const[{type:t}]=e;return!!t&&It(t.name)}function Mt(e,t){return t?{...t.props,...t.attrs}:e}const $t=["Start","Add","Remove","Update","End"],Pt=["Choose","Unchoose","Sort","Filter","Clone"],Ut=["Move",...$t,...Pt].map((e=>"on"+e));let Rt=null;const Ft={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},qt=(0,a.defineComponent)({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...$t.map((e=>e.toLowerCase())),...Pt.map((e=>e.toLowerCase()))],props:Ft,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const e=this.$slots.default?this.$slots.default():null,t=Mt(this.$attrs,this.componentData);return e?(this.transitionMode=Lt(e),(0,a.h)(this.getTag(),t,e)):(0,a.h)(this.getTag(),t,[])},created(){null!==this.list&&null!==this.modelValue&&xt.error("list props are mutually exclusive! Please set one.")},mounted(){const e={};$t.forEach((t=>{e["on"+t]=Ot.call(this,t)})),Pt.forEach((t=>{e["on"+t]=Vt.bind(this,t)}));const t=Object.keys(this.$attrs).reduce(((e,t)=>(e[Bt(t)]=this.$attrs[t],e)),{}),o=Object.assign({},t,e,{onMove:(e,t)=>this.onDragMove(e,t)});!("draggable"in o)&&(o.draggable=">*");const a=1===this.$el.nodeType?this.$el:this.$el.parentElement;this._sortable=new We(a,o),a.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{void 0!==this._sortable&&this._sortable.destroy()}catch(e){}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(e){this.updateOptions(e)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?(0,a.resolveComponent)(this.component):this.tag},updateOptions(e){for(var t in e){const o=Bt(t);-1===Ut.indexOf(o)&&this._sortable.option(o,e[t])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=At(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(e){const t=Tt(this.getChildrenNodes()||[],e);if(-1===t)return null;const o=this.realList[t];return{index:t,element:o}},emitChanges(e){this.$nextTick((()=>{this.$emit("change",e)}))},alterList(e){if(this.list)return void e(this.list);const t=[...this.modelValue];e(t),this.$emit("update:modelValue",t)},spliceList(){const e=e=>e.splice(...arguments);this.alterList(e)},updatePosition(e,t){const o=o=>o.splice(t,0,o.splice(e,1)[0]);this.alterList(o)},getVmIndex(e){const t=this.visibleIndexes,o=t.length;return e>o-1?o:t[e]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(e){if(!this.noTransitionOnDrag||!this.transitionMode)return;var t=this.getChildrenNodes();t[e].data=null;const o=this.getComponent();o.children=[],o.kept=void 0},onDragStart(e){this.computeIndexes(),this.context=this.getUnderlyingVm(e.item),this.context&&(e.item._underlying_vm_=this.clone(this.context.element),Rt=e.item)},onDragAdd(e){const t=e.item._underlying_vm_;if(void 0===t)return;Dt(e.item);const o=this.getVmIndex(e.newIndex);this.spliceList(o,0,t),this.computeIndexes();const a={element:t,newIndex:o};this.emitChanges({added:a})},onDragRemove(e){if(_t(this.$el,e.item,e.oldIndex),"clone"===e.pullMode)return void Dt(e.clone);if(!this.context)return;const t=this.context.index;this.spliceList(t,1);const o={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:o})},onDragUpdate(e){Dt(e.item),_t(e.from,e.item,e.oldIndex);const t=this.context.index,o=this.getVmIndex(e.newIndex);this.updatePosition(t,o);const a={element:this.context.element,oldIndex:t,newIndex:o};this.emitChanges({moved:a})},updateProperty(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},onDragMove(e,t){const o=this.move;if(!o||!this.realList)return!0;const a=this.getRelatedContextFromMoveEvent(e),n=this.context,i=this.computeFutureIndex(a,e);Object.assign(n,{futureIndex:i});const l=Object.assign({},e,{relatedContext:a,draggedContext:n});return o(l,t)},onDragEnd(){this.computeIndexes(),Rt=null},getTrargetedComponent(e){return e.__draggable_component__},getRelatedContextFromMoveEvent({to:e,related:t}){const o=this.getTrargetedComponent(e);if(!o)return{component:o};const a=o.realList,n={list:a,component:o};if(e!==t&&a&&o.getUnderlyingVm){const e=o.getUnderlyingVm(t);if(e)return Object.assign(e,n)}return n},computeFutureIndex(e,t){const o=[...t.to.children].filter((e=>"none"!==e.style["display"]));if(0===o.length)return 0;const a=o.indexOf(t.related),n=e.component.getVmIndex(a),i=-1!==o.indexOf(Rt);return i||!t.willInsertAfter?n:n+1}}})},35567:function(e,t,o){var a=o(68454);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("4ba94651",a,!0,{sourceMap:!1,shadowMode:!1})},18071:function(e,t,o){var a=o(40439);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("a1c3e378",a,!0,{sourceMap:!1,shadowMode:!1})},88405:function(e,t,o){var a=o(15829);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("0b86ac08",a,!0,{sourceMap:!1,shadowMode:!1})},65570:function(e,t,o){var a=o(42722);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("641cbe26",a,!0,{sourceMap:!1,shadowMode:!1})},53788:function(e,t,o){var a=o(85692);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("2f431e88",a,!0,{sourceMap:!1,shadowMode:!1})},93071:function(e,t,o){var a=o(39823);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("3af37976",a,!0,{sourceMap:!1,shadowMode:!1})},22209:function(e,t,o){var a=o(37729);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("910fdbae",a,!0,{sourceMap:!1,shadowMode:!1})},99738:function(e,t,o){var a=o(49530);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("193727f5",a,!0,{sourceMap:!1,shadowMode:!1})},16839:function(e,t,o){var a=o(76167);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var n=o(74825).A;n("9dfdd65e",a,!0,{sourceMap:!1,shadowMode:!1})}}]);
|
|
//# sourceMappingURL=harvester-1.0.3.umd.min.304.js.map
|