wg-webui-fr/appwg/ui/dist/js/Clients.c3e03423.js
2024-09-20 10:55:18 +02:00

2 lines
31 KiB
JavaScript
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["Clients"],{"368e":function(t,e,i){},"3c93":function(t,e,i){},"58f3":function(t,e,i){"use strict";i.r(e);var s=i("a75b"),n=function(){var t=this,e=t._self._c;return e(s["a"],[e("Clients")],1)},a=[],o=i("8336"),l=i("b0af"),r=i("99d9"),c=i("cc20"),h=i("62ad"),d=i("2b5d"),u=i("a523"),v=(i("368e"),i("480e")),p=i("4ad4"),m=i("b848"),f=i("75eb"),g=(i("3c93"),i("a9ad")),b=i("7560"),y=i("f2e7"),C=i("58df"),w=Object(C["a"])(g["a"],b["a"],y["a"]).extend({name:"v-overlay",props:{absolute:Boolean,color:{type:String,default:"#212121"},dark:{type:Boolean,default:!0},opacity:{type:[Number,String],default:.46},value:{default:!0},zIndex:{type:[Number,String],default:5}},computed:{__scrim(){const t=this.setBackgroundColor(this.color,{staticClass:"v-overlay__scrim",style:{opacity:this.computedOpacity}});return this.$createElement("div",t)},classes(){return{"v-overlay--absolute":this.absolute,"v-overlay--active":this.isActive,...this.themeClasses}},computedOpacity(){return Number(this.isActive?this.opacity:0)},styles(){return{zIndex:this.zIndex}}},methods:{genContent(){return this.$createElement("div",{staticClass:"v-overlay__content"},this.$slots.default)}},render(t){const e=[this.__scrim];return this.isActive&&e.push(this.genContent()),t("div",{staticClass:"v-overlay",on:this.$listeners,class:this.classes,style:this.styles},e)}}),_=w,k=i("80d2"),x=i("2b0e"),$=x["a"].extend().extend({name:"overlayable",props:{hideOverlay:Boolean,overlayColor:String,overlayOpacity:[Number,String]},data(){return{animationFrame:0,overlay:null}},watch:{hideOverlay(t){this.isActive&&(t?this.removeOverlay():this.genOverlay())}},beforeDestroy(){this.removeOverlay()},methods:{createOverlay(){const t=new _({propsData:{absolute:this.absolute,value:!1,color:this.overlayColor,opacity:this.overlayOpacity}});t.$mount();const e=this.absolute?this.$el.parentNode:document.querySelector("[data-app]");e&&e.insertBefore(t.$el,e.firstChild),this.overlay=t},genOverlay(){if(this.hideScroll(),!this.hideOverlay)return this.overlay||this.createOverlay(),this.animationFrame=requestAnimationFrame(()=>{this.overlay&&(void 0!==this.activeZIndex?this.overlay.zIndex=String(this.activeZIndex-1):this.$el&&(this.overlay.zIndex=Object(k["p"])(this.$el)),this.overlay.value=!0)}),!0},removeOverlay(t=!0){this.overlay&&(Object(k["a"])(this.overlay.$el,"transitionend",()=>{this.overlay&&this.overlay.$el&&this.overlay.$el.parentNode&&!this.overlay.value&&!this.isActive&&(this.overlay.$el.parentNode.removeChild(this.overlay.$el),this.overlay.$destroy(),this.overlay=null)}),cancelAnimationFrame(this.animationFrame),this.overlay.value=!1),t&&this.showScroll()},scrollListener(t){if("key"in t){if(["INPUT","TEXTAREA","SELECT"].includes(t.target.tagName)||t.target.isContentEditable)return;const e=[k["r"].up,k["r"].pageup],i=[k["r"].down,k["r"].pagedown];if(e.includes(t.keyCode))t.deltaY=-1;else{if(!i.includes(t.keyCode))return;t.deltaY=1}}(t.target===this.overlay||"keydown"!==t.type&&t.target===document.body||this.checkPath(t))&&t.preventDefault()},hasScrollbar(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const e=window.getComputedStyle(t);return(["auto","scroll"].includes(e.overflowY)||"SELECT"===t.tagName)&&t.scrollHeight>t.clientHeight||["auto","scroll"].includes(e.overflowX)&&t.scrollWidth>t.clientWidth},shouldScroll(t,e){if(t.hasAttribute("data-app"))return!1;const i=e.shiftKey||e.deltaX?"x":"y",s="y"===i?e.deltaY:e.deltaX||e.deltaY;let n,a;"y"===i?(n=0===t.scrollTop,a=t.scrollTop+t.clientHeight===t.scrollHeight):(n=0===t.scrollLeft,a=t.scrollLeft+t.clientWidth===t.scrollWidth);const o=s<0,l=s>0;return!(n||!o)||(!(a||!l)||!(!n&&!a||!t.parentNode)&&this.shouldScroll(t.parentNode,e))},isInside(t,e){return t===e||null!==t&&t!==document.body&&this.isInside(t.parentNode,e)},checkPath(t){const e=Object(k["f"])(t);if("keydown"===t.type&&e[0]===document.body){const e=this.$refs.dialog,i=window.getSelection().anchorNode;return!(e&&this.hasScrollbar(e)&&this.isInside(i,e))||!this.shouldScroll(e,t)}for(let i=0;i<e.length;i++){const s=e[i];if(s===document)return!0;if(s===document.documentElement)return!0;if(s===this.$refs.content)return!0;if(this.hasScrollbar(s))return!this.shouldScroll(s,t)}return!0},hideScroll(){this.$vuetify.breakpoint.smAndDown?document.documentElement.classList.add("overflow-y-hidden"):(Object(k["b"])(window,"wheel",this.scrollListener,{passive:!1}),window.addEventListener("keydown",this.scrollListener))},showScroll(){document.documentElement.classList.remove("overflow-y-hidden"),window.removeEventListener("wheel",this.scrollListener),window.removeEventListener("keydown",this.scrollListener)}}}),A=i("e4d3"),S=i("21be"),I=i("a293"),O=i("d9bd");const E=Object(C["a"])(m["a"],f["a"],$,A["a"],S["a"],p["a"]);var T=E.extend({name:"v-dialog",directives:{ClickOutside:I["a"]},props:{dark:Boolean,disabled:Boolean,fullscreen:Boolean,light:Boolean,maxWidth:[String,Number],noClickAnimation:Boolean,origin:{type:String,default:"center center"},persistent:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,transition:{type:[String,Boolean],default:"dialog-transition"},width:[String,Number]},data(){return{activatedBy:null,animate:!1,animateTimeout:-1,stackMinZIndex:200,previousActiveElement:null}},computed:{classes(){return{[("v-dialog "+this.contentClass).trim()]:!0,"v-dialog--active":this.isActive,"v-dialog--persistent":this.persistent,"v-dialog--fullscreen":this.fullscreen,"v-dialog--scrollable":this.scrollable,"v-dialog--animated":this.animate}},contentClasses(){return{"v-dialog__content":!0,"v-dialog__content--active":this.isActive}},hasActivator(){return Boolean(!!this.$slots.activator||!!this.$scopedSlots.activator)}},watch:{isActive(t){var e;t?(this.show(),this.hideScroll()):(this.removeOverlay(),this.unbind(),null===(e=this.previousActiveElement)||void 0===e||e.focus())},fullscreen(t){this.isActive&&(t?(this.hideScroll(),this.removeOverlay(!1)):(this.showScroll(),this.genOverlay()))}},created(){this.$attrs.hasOwnProperty("full-width")&&Object(O["e"])("full-width",this)},beforeMount(){this.$nextTick(()=>{this.isBooted=this.isActive,this.isActive&&this.show()})},beforeDestroy(){"undefined"!==typeof window&&this.unbind()},methods:{animateClick(){this.animate=!1,this.$nextTick(()=>{this.animate=!0,window.clearTimeout(this.animateTimeout),this.animateTimeout=window.setTimeout(()=>this.animate=!1,150)})},closeConditional(t){const e=t.target;return!(this._isDestroyed||!this.isActive||this.$refs.content.contains(e)||this.overlay&&e&&!this.overlay.$el.contains(e))&&this.activeZIndex>=this.getMaxZIndex()},hideScroll(){this.fullscreen?document.documentElement.classList.add("overflow-y-hidden"):$.options.methods.hideScroll.call(this)},show(){!this.fullscreen&&!this.hideOverlay&&this.genOverlay(),this.$nextTick(()=>{this.$nextTick(()=>{var t,e;(null===(t=this.$refs.dialog)||void 0===t?void 0:t.contains(document.activeElement))||(this.previousActiveElement=document.activeElement,null===(e=this.$refs.dialog)||void 0===e||e.focus()),this.bind()})})},bind(){window.addEventListener("focusin",this.onFocusin)},unbind(){window.removeEventListener("focusin",this.onFocusin)},onClickOutside(t){this.$emit("click:outside",t),this.persistent?this.noClickAnimation||this.animateClick():this.isActive=!1},onKeydown(t){if(t.keyCode===k["r"].esc&&!this.getOpenDependents().length)if(this.persistent)this.noClickAnimation||this.animateClick();else{this.isActive=!1;const t=this.getActivator();this.$nextTick(()=>t&&t.focus())}this.$emit("keydown",t)},onFocusin(t){if(!t||!this.retainFocus)return;const e=t.target;if(e&&this.$refs.dialog&&![document,this.$refs.dialog].includes(e)&&!this.$refs.dialog.contains(e)&&this.activeZIndex>=this.getMaxZIndex()&&!this.getOpenDependentElements().some(t=>t.contains(e))){const t=this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])'),e=[...t].find(t=>!t.hasAttribute("disabled")&&!t.matches('[tabindex="-1"]'));e&&e.focus()}},genContent(){return this.showLazyContent(()=>[this.$createElement(v["a"],{props:{root:!0,light:this.light,dark:this.dark}},[this.$createElement("div",{class:this.contentClasses,attrs:{role:"dialog","aria-modal":this.hideOverlay?void 0:"true",...this.getScopeIdAttrs()},on:{keydown:this.onKeydown},style:{zIndex:this.activeZIndex},ref:"content"},[this.genTransition()])])])},genTransition(){const t=this.genInnerContent();return this.transition?this.$createElement("transition",{props:{name:this.transition,origin:this.origin,appear:!0}},[t]):t},genInnerContent(){const t={class:this.classes,attrs:{tabindex:this.isActive?0:void 0},ref:"dialog",directives:[{name:"click-outside",value:{handler:this.onClickOutside,closeConditional:this.closeConditional,include:this.getOpenDependentElements}},{name:"show",value:this.isActive}],style:{transformOrigin:this.origin}};return this.fullscreen||(t.style={...t.style,maxWidth:Object(k["g"])(this.maxWidth),width:Object(k["g"])(this.width)}),this.$createElement("div",t,this.getContentSlot())}},render(t){return t("div",{staticClass:"v-dialog__container",class:{"v-dialog__container--attached":""===this.attach||!0===this.attach||"attach"===this.attach}},[this.genActivator(),this.genContent()])}}),B=i("7e2b"),P=i("3206"),D=Object(C["a"])(B["a"],Object(P["b"])("form")).extend({name:"v-form",provide(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:()=>({inputs:[],watchers:[],errorBag:{}}),watch:{errorBag:{handler(t){const e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput(t){const e=t=>t.$watch("hasError",e=>{this.$set(this.errorBag,t._uid,e)},{immediate:!0}),i={_uid:t._uid,valid:()=>{},shouldValidate:()=>{}};return this.lazyValidation?i.shouldValidate=t.$watch("shouldValidate",s=>{s&&(this.errorBag.hasOwnProperty(t._uid)||(i.valid=e(t)))}):i.valid=e(t),i},validate(){return 0===this.inputs.filter(t=>!t.validate(!0)).length},reset(){this.inputs.forEach(t=>t.reset()),this.resetErrorBag()},resetErrorBag(){this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)},resetValidation(){this.inputs.forEach(t=>t.resetValidation()),this.resetErrorBag()},register(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister(t){const e=this.inputs.find(e=>e._uid===t._uid);if(!e)return;const i=this.watchers.find(t=>t._uid===e._uid);i&&(i.valid(),i.shouldValidate()),this.watchers=this.watchers.filter(t=>t._uid!==e._uid),this.inputs=this.inputs.filter(t=>t._uid!==e._uid),this.$delete(this.errorBag,e._uid)}},render(t){return t("form",{staticClass:"v-form",attrs:{novalidate:!0,...this.attrs$},on:{submit:t=>this.$emit("submit",t)}},this.$slots.default)}}),V=i("132d"),j=i("adda"),L=i("da13"),N=i("8270"),z=i("5d23"),Y=i("0fd9"),X=i("b974"),F=i("2fa4"),R=(i("ec29"),i("9d01"),i("c37a")),M=i("5607"),q=x["a"].extend({name:"rippleable",directives:{ripple:M["a"]},props:{ripple:{type:[Boolean,Object],default:!0}},methods:{genRipple(t={}){return this.ripple?(t.staticClass="v-input--selection-controls__ripple",t.directives=t.directives||[],t.directives.push({name:"ripple",value:{center:!0}}),this.$createElement("div",t)):null}}}),K=i("8547");function W(t){t.preventDefault()}var H=Object(C["a"])(R["a"],q,K["a"]).extend({name:"selectable",model:{prop:"inputValue",event:"change"},props:{id:String,inputValue:null,falseValue:null,trueValue:null,multiple:{type:Boolean,default:null},label:String},data(){return{hasColor:this.inputValue,lazyValue:this.inputValue}},computed:{computedColor(){if(this.isActive)return this.color?this.color:this.isDark&&!this.appIsDark?"white":"primary"},isMultiple(){return!0===this.multiple||null===this.multiple&&Array.isArray(this.internalValue)},isActive(){const t=this.value,e=this.internalValue;return this.isMultiple?!!Array.isArray(e)&&e.some(e=>this.valueComparator(e,t)):void 0===this.trueValue||void 0===this.falseValue?t?this.valueComparator(t,e):Boolean(e):this.valueComparator(e,this.trueValue)},isDirty(){return this.isActive},rippleState(){return this.isDisabled||this.validationState?this.validationState:void 0}},watch:{inputValue(t){this.lazyValue=t,this.hasColor=t}},methods:{genLabel(){const t=R["a"].options.methods.genLabel.call(this);return t?(t.data.on={click:W},t):t},genInput(t,e){return this.$createElement("input",{attrs:Object.assign({"aria-checked":this.isActive.toString(),disabled:this.isDisabled,id:this.computedId,role:t,type:t},e),domProps:{value:this.value,checked:this.isActive},on:{blur:this.onBlur,change:this.onChange,focus:this.onFocus,keydown:this.onKeydown,click:W},ref:"input"})},onClick(t){this.onChange(),this.$emit("click",t)},onChange(){if(!this.isInteractive)return;const t=this.value;let e=this.internalValue;if(this.isMultiple){Array.isArray(e)||(e=[]);const i=e.length;e=e.filter(e=>!this.valueComparator(e,t)),e.length===i&&e.push(t)}else e=void 0!==this.trueValue&&void 0!==this.falseValue?this.valueComparator(e,this.trueValue)?this.falseValue:this.trueValue:t?this.valueComparator(e,t)?null:t:!e;this.validate(!0,e),this.internalValue=e,this.hasColor=e},onFocus(t){this.isFocused=!0,this.$emit("focus",t)},onBlur(t){this.isFocused=!1,this.$emit("blur",t)},onKeydown(t){}}});const U=t=>{const{touchstartX:e,touchendX:i,touchstartY:s,touchendY:n}=t,a=.5,o=16;t.offsetX=i-e,t.offsetY=n-s,Math.abs(t.offsetY)<a*Math.abs(t.offsetX)&&(t.left&&i<e-o&&t.left(t),t.right&&i>e+o&&t.right(t)),Math.abs(t.offsetX)<a*Math.abs(t.offsetY)&&(t.up&&n<s-o&&t.up(t),t.down&&n>s+o&&t.down(t))};function Z(t,e){const i=t.changedTouches[0];e.touchstartX=i.clientX,e.touchstartY=i.clientY,e.start&&e.start(Object.assign(t,e))}function J(t,e){const i=t.changedTouches[0];e.touchendX=i.clientX,e.touchendY=i.clientY,e.end&&e.end(Object.assign(t,e)),U(e)}function G(t,e){const i=t.changedTouches[0];e.touchmoveX=i.clientX,e.touchmoveY=i.clientY,e.move&&e.move(Object.assign(t,e))}function Q(t){const e={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:t.left,right:t.right,up:t.up,down:t.down,start:t.start,move:t.move,end:t.end};return{touchstart:t=>Z(t,e),touchend:t=>J(t,e),touchmove:t=>G(t,e)}}function tt(t,e,i){const s=e.value,n=s.parent?t.parentElement:t,a=s.options||{passive:!0};if(!n)return;const o=Q(e.value);n._touchHandlers=Object(n._touchHandlers),n._touchHandlers[i.context._uid]=o,Object(k["s"])(o).forEach(t=>{n.addEventListener(t,o[t],a)})}function et(t,e,i){const s=e.value.parent?t.parentElement:t;if(!s||!s._touchHandlers)return;const n=s._touchHandlers[i.context._uid];Object(k["s"])(n).forEach(t=>{s.removeEventListener(t,n[t])}),delete s._touchHandlers[i.context._uid]}const it={inserted:tt,unbind:et};var st=it,nt=i("0789"),at=i("490a"),ot=H.extend({name:"v-switch",directives:{Touch:st},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...R["a"].options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){return this.hasError&&this.shouldValidate?"error":this.hasSuccess?"success":null!==this.hasColor?this.computedColor:void 0},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...e}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...e}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(nt["c"],{},[!1===this.loading?null:this.$slots.progress||this.$createElement(at["a"],{props:{color:!0===this.loading||""===this.loading?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===k["r"].left&&this.isActive||t.keyCode===k["r"].right&&!this.isActive)&&this.onChange()}}}),lt=i("8654"),rt=(i("9734"),i("16b7")),ct=i("f573"),ht=Object(C["a"])(g["a"],rt["a"],m["a"],ct["a"]).extend({name:"v-tooltip",props:{closeDelay:{type:[Number,String],default:0},disabled:Boolean,openDelay:{type:[Number,String],default:0},openOnHover:{type:Boolean,default:!0},openOnFocus:{type:Boolean,default:!0},tag:{type:String,default:"span"},transition:String},data:()=>({calculatedMinWidth:0,closeDependents:!1}),computed:{calculatedLeft(){const{activator:t,content:e}=this.dimensions,i=!this.bottom&&!this.left&&!this.top&&!this.right,s=!1!==this.attach?t.offsetLeft:t.left;let n=0;return this.top||this.bottom||i?n=s+t.width/2-e.width/2:(this.left||this.right)&&(n=s+(this.right?t.width:-e.width)+(this.right?10:-10)),this.nudgeLeft&&(n-=parseInt(this.nudgeLeft)),this.nudgeRight&&(n+=parseInt(this.nudgeRight)),this.calcXOverflow(n,this.dimensions.content.width)+"px"},calculatedTop(){const{activator:t,content:e}=this.dimensions,i=!1!==this.attach?t.offsetTop:t.top;let s=0;return this.top||this.bottom?s=i+(this.bottom?t.height:-e.height)+(this.bottom?10:-10):(this.left||this.right)&&(s=i+t.height/2-e.height/2),this.nudgeTop&&(s-=parseInt(this.nudgeTop)),this.nudgeBottom&&(s+=parseInt(this.nudgeBottom)),!1===this.attach&&(s+=this.pageYOffset),this.calcYOverflow(s)+"px"},classes(){return{"v-tooltip--top":this.top,"v-tooltip--right":this.right,"v-tooltip--bottom":this.bottom,"v-tooltip--left":this.left,"v-tooltip--attached":""===this.attach||!0===this.attach||"attach"===this.attach}},computedTransition(){return this.transition?this.transition:this.isActive?"scale-transition":"fade-transition"},offsetY(){return this.top||this.bottom},offsetX(){return this.left||this.right},styles(){return{left:this.calculatedLeft,maxWidth:Object(k["g"])(this.maxWidth),minWidth:Object(k["g"])(this.minWidth),top:this.calculatedTop,zIndex:this.zIndex||this.activeZIndex}}},beforeMount(){this.$nextTick(()=>{this.value&&this.callActivate()})},mounted(){"v-slot"===Object(k["o"])(this,"activator",!0)&&Object(O["b"])("v-tooltip's activator slot must be bound, try '<template #activator=\"data\"><v-btn v-on=\"data.on>'",this)},methods:{activate(){this.updateDimensions(),requestAnimationFrame(this.startTransition)},deactivate(){this.runDelay("close")},genActivatorListeners(){const t=p["a"].options.methods.genActivatorListeners.call(this);return this.openOnFocus&&(t.focus=t=>{this.getActivator(t),this.runDelay("open")},t.blur=t=>{this.getActivator(t),this.runDelay("close")}),t.keydown=t=>{t.keyCode===k["r"].esc&&(this.getActivator(t),this.runDelay("close"))},t},genActivatorAttributes(){return{"aria-haspopup":!0,"aria-expanded":String(this.isActive)}},genTransition(){const t=this.genContent();return this.computedTransition?this.$createElement("transition",{props:{name:this.computedTransition}},[t]):t},genContent(){return this.$createElement("div",this.setBackgroundColor(this.color,{staticClass:"v-tooltip__content",class:{[this.contentClass]:!0,menuable__content__active:this.isActive,"v-tooltip__content--fixed":this.activatorFixed},style:this.styles,attrs:this.getScopeIdAttrs(),directives:[{name:"show",value:this.isContentActive}],ref:"content"}),this.getContentSlot())}},render(t){return t(this.tag,{staticClass:"v-tooltip",class:this.classes},[this.showLazyContent(()=>[this.genTransition()]),this.genActivator()])}}),dt=function(){var t=this,e=t._self._c;return e(u["a"],[e(Y["a"],[e(h["a"],{attrs:{cols:"12"}},[e(l["a"],{attrs:{dark:""}},[e(L["a"],[e(z["a"],[e(z["c"],{staticClass:"headline"},[t._v("Clients")])],1),e(o["a"],{attrs:{color:"success"},on:{click:t.startAddClient}},[t._v(" Ajout nouveau client "),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-account-multiple-plus-outline")])],1)],1),e(Y["a"],t._l(t.clients,(function(i,s){return e(h["a"],{key:s,attrs:{sm12:"",lg6:""}},[e(l["a"],{staticClass:"mx-auto",attrs:{color:i.enable?"#1F7087":"warning",raised:"",shaped:""}},[e(L["a"],[e(z["a"],[e(z["c"],{staticClass:"headline"},[t._v(t._s(i.name))]),e(z["b"],[t._v(t._s(i.email))]),e(z["b"],[t._v("Created: "+t._s(t._f("formatDate")(i.created)))]),e(z["b"],[t._v("Updated: "+t._s(t._f("formatDate")(i.updated)))])],1),e(N["a"],{attrs:{tile:"",size:"150"}},[e(j["a"],{attrs:{src:`${t.apiBaseUrl}/client/${i.id}/config?qrcode=true`}})],1)],1),e(r["b"],{staticClass:"text--primary"},t._l(i.address,(function(i,s){return e(c["a"],{key:s,attrs:{color:"indigo","text-color":"white"}},[e(V["a"],{attrs:{left:""}},[t._v("mdi-ip-network")]),t._v(" "+t._s(i)+" ")],1)})),1),e(r["a"],[e(ht,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:s}){return[e(o["a"],t._g({attrs:{text:"",href:`${t.apiBaseUrl}/client/${i.id}/config?qrcode=false`}},s),[e("span",{staticClass:"d-none d-lg-flex"},[t._v("Télécharger")]),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-cloud-download-outline")])],1)]}}],null,!0)},[e("span",[t._v("Télécharger")])]),e(ht,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:s}){return[e(o["a"],t._g({attrs:{text:""},on:{click:function(e){return e.stopPropagation(),t.startUpdateClient(i)}}},s),[e("span",{staticClass:"d-none d-lg-flex"},[t._v("Editer")]),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-square-edit-outline")])],1)]}}],null,!0)},[e("span",[t._v("Editer")])]),e(ht,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:s}){return[e(o["a"],t._g({attrs:{text:""},on:{click:function(e){return t.deleteClient(i)}}},s),[e("span",{staticClass:"d-none d-lg-flex"},[t._v("Supprimer")]),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-trash-can-outline")])],1)]}}],null,!0)},[e("span",[t._v("Supprimer")])]),e(ht,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:s}){return[e(o["a"],t._g({attrs:{text:""},on:{click:function(e){return t.sendEmailClient(i.id)}}},s),[e("span",{staticClass:"d-none d-lg-flex"},[t._v("Envoyer message")]),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-email-send-outline")])],1)]}}],null,!0)},[e("span",[t._v("Envoyer message")])]),e(F["a"]),e(ht,{attrs:{right:""},scopedSlots:t._u([{key:"activator",fn:function({on:s}){return[e(ot,t._g({attrs:{dark:"",color:"success"},on:{change:function(e){return t.updateClient(i)}},model:{value:i.enable,callback:function(e){t.$set(i,"enable",e)},expression:"client.enable"}},s))]}}],null,!0)},[e("span",[t._v(" "+t._s(i.enable?"Désactiver":"Activer")+" ce client")])])],1)],1)],1)})),1)],1)],1)],1),t.client?e(T,{attrs:{"max-width":"550"},model:{value:t.dialogAddClient,callback:function(e){t.dialogAddClient=e},expression:"dialogAddClient"}},[e(l["a"],[e(r["c"],{staticClass:"headline"},[t._v("Ajout nouveau client")]),e(r["b"],[e(Y["a"],[e(h["a"],{attrs:{cols:"12"}},[e(D,{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(lt["a"],{attrs:{label:"Nom convivial",rules:[t=>!!t||"Nom client est requis"],required:""},model:{value:t.client.name,callback:function(e){t.$set(t.client,"name",e)},expression:"client.name"}}),e(lt["a"],{attrs:{label:"Client messagerie",rules:[t=>/.+@.+\..+/.test(t)||""===t||"Adresse non valide"]},model:{value:t.client.email,callback:function(e){t.$set(t.client,"email",e)},expression:"client.email"}}),e(X["a"],{attrs:{items:t.server.address,label:"Adresse IP client choisie parmi les réseaux suivants",rules:[t=>!!t||"Réseau requis"],multiple:"",chips:"","persistent-hint":"",required:""},model:{value:t.client.address,callback:function(e){t.$set(t.client,"address",e)},expression:"client.address"}}),e(d["a"],{attrs:{chips:"",hint:"Saisir le CIDR IPv4 ou IPv6 et appuyez sur touche Entrée",label:"IP autorisés",multiple:"",dark:""},scopedSlots:t._u([{key:"selection",fn:function({attrs:i,item:s,select:n,selected:a}){return[e(c["a"],t._b({attrs:{"input-value":a,close:""},on:{click:n,"click:close":function(e){t.client.allowedIPs.splice(t.client.allowedIPs.indexOf(s),1)}}},"v-chip",i,!1),[e("strong",[t._v(t._s(s))]),t._v("  ")])]}}],null,!1,1095272819),model:{value:t.client.allowedIPs,callback:function(e){t.$set(t.client,"allowedIPs",e)},expression:"client.allowedIPs"}}),e(ot,{attrs:{color:"red",inset:"",label:t.client.enable?"Activer client après création":"Désactiver client après création"},model:{value:t.client.enable,callback:function(e){t.$set(t.client,"enable",e)},expression:"client.enable"}}),e(ot,{attrs:{color:"red",inset:"",label:"Ignorer le keepalive persistant global: "+(t.client.ignorePersistentKeepalive?"Oui":"NON")},model:{value:t.client.ignorePersistentKeepalive,callback:function(e){t.$set(t.client,"ignorePersistentKeepalive",e)},expression:"client.ignorePersistentKeepalive"}})],1)],1)],1)],1),e(r["a"],[e(F["a"]),e(o["a"],{attrs:{disabled:!t.valid,color:"success"},on:{click:function(e){return t.addClient(t.client)}}},[t._v(" Valider "),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-check-outline")])],1),e(o["a"],{attrs:{color:"primary"},on:{click:function(e){t.dialogAddClient=!1}}},[t._v(" Abandon "),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-close-circle-outline")])],1)],1)],1)],1):t._e(),t.client?e(T,{attrs:{"max-width":"550"},model:{value:t.dialogEditClient,callback:function(e){t.dialogEditClient=e},expression:"dialogEditClient"}},[e(l["a"],[e(r["c"],{staticClass:"headline"},[t._v("Edition client")]),e(r["b"],[e(Y["a"],[e(h["a"],{attrs:{cols:"12"}},[e(D,{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(lt["a"],{attrs:{label:"Nom convivial",rules:[t=>!!t||"Nom client est requis"],required:""},model:{value:t.client.name,callback:function(e){t.$set(t.client,"name",e)},expression:"client.name"}}),e(lt["a"],{attrs:{label:"Messagerie",rules:[t=>/.+@.+\..+/.test(t)||""===t||"Adresse non valide"],required:""},model:{value:t.client.email,callback:function(e){t.$set(t.client,"email",e)},expression:"client.email"}}),e(d["a"],{attrs:{chips:"",hint:"Saisir le CIDR IPv4 ou IPv6 et appuyez sur touche Entrée",label:"Adresses",multiple:"",dark:""},scopedSlots:t._u([{key:"selection",fn:function({attrs:i,item:s,select:n,selected:a}){return[e(c["a"],t._b({attrs:{"input-value":a,close:""},on:{click:n,"click:close":function(e){t.client.address.splice(t.client.address.indexOf(s),1)}}},"v-chip",i,!1),[e("strong",[t._v(t._s(s))]),t._v("  ")])]}}],null,!1,3626235027),model:{value:t.client.address,callback:function(e){t.$set(t.client,"address",e)},expression:"client.address"}}),e(d["a"],{attrs:{chips:"",hint:"Saisir le CIDR IPv4 ou IPv6 et appuyez sur touche Entrée",label:"IP autorisés",multiple:"",dark:""},scopedSlots:t._u([{key:"selection",fn:function({attrs:i,item:s,select:n,selected:a}){return[e(c["a"],t._b({attrs:{"input-value":a,close:""},on:{click:n,"click:close":function(e){t.client.allowedIPs.splice(t.client.allowedIPs.indexOf(s),1)}}},"v-chip",i,!1),[e("strong",[t._v(t._s(s))]),t._v("  ")])]}}],null,!1,1095272819),model:{value:t.client.allowedIPs,callback:function(e){t.$set(t.client,"allowedIPs",e)},expression:"client.allowedIPs"}}),e(ot,{attrs:{color:"red",inset:"",label:"Ignorer le keepalive persistant global: "+(t.client.ignorePersistentKeepalive?"Oui":"NON")},model:{value:t.client.ignorePersistentKeepalive,callback:function(e){t.$set(t.client,"ignorePersistentKeepalive",e)},expression:"client.ignorePersistentKeepalive"}})],1)],1)],1)],1),e(r["a"],[e(F["a"]),e(o["a"],{attrs:{disabled:!t.valid,color:"success"},on:{click:function(e){return t.updateClient(t.client)}}},[t._v(" Valider "),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-check-outline")])],1),e(o["a"],{attrs:{color:"primary"},on:{click:function(e){t.dialogEditClient=!1}}},[t._v(" Abandon "),e(V["a"],{attrs:{right:"",dark:""}},[t._v("mdi-close-circle-outline")])],1)],1)],1)],1):t._e(),e("Notification",{attrs:{notification:t.notification}})],1)},ut=[],vt=i("5ce5"),pt=i("2b9d"),mt={name:"Clients",components:{Notification:pt["a"]},data:()=>({api:null,apiBaseUrl:vt["a"],clients:[],notification:{show:!1,color:"",text:""},dialogAddClient:!1,dialogEditClient:!1,client:null,server:null,valid:!1}),mounted(){this.api=new vt["b"],this.getClients(),this.getServer()},methods:{getClients(){this.api.get("/client").then(t=>{this.clients=t}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})},getServer(){this.api.get("/server").then(t=>{this.server=t}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})},startAddClient(){this.dialogAddClient=!0,this.client={name:"",email:"",enable:!0,allowedIPs:["0.0.0.0/0","::/0"],address:this.server.address}},addClient(t){if(t.allowedIPs.length<1)this.notify("error","Veuillez fournir au moins une adresse CIDR valide pour les adresses IP autorisées du client.");else{for(let e=0;e<t.allowedIPs.length;e++)if(0===this.$isCidr(t.allowedIPs[e]))return void this.notify("error","Un CIDR invalide a été détecté, veuillez corriger avant de soumettre");this.dialogAddClient=!1,this.api.post("/client",t).then(t=>{this.notify("success",`Client ${t.name} ajouté avec succès`),this.getClients()}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})}},deleteClient(t){confirm(`Voulez-vous vraiment supprimer ${t.name} ?`)&&this.api.delete("/client/"+t.id).then(t=>{this.notify("success","Client supprimé avec succès"),this.getClients()}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})},sendEmailClient(t){this.api.get(`/client/${t}/email`).then(t=>{this.notify("success","Courriel envoyé avec succès"),this.getClients()}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})},startUpdateClient(t){this.client=t,this.dialogEditClient=!0},updateClient(t){if(t.allowedIPs.length<1)this.notify("error","Veuillez fournir au moins une adresse CIDR valide pour les adresses IP autorisées du client");else{for(let e=0;e<t.allowedIPs.length;e++)if(0===this.$isCidr(t.allowedIPs[e]))return void this.notify("error","Un CIDR invalide a été détecté, veuillez corriger avant de soumettre");if(t.address.length<1)this.notify("error","Veuillez fournir au moins une adresse CIDR valide pour le client");else{for(let e=0;e<t.address.length;e++)if(0===this.$isCidr(t.address[e]))return void this.notify("error","Un CIDR invalide a été détecté, veuillez corriger avant de soumettre");this.dialogEditClient=!1,this.api.patch("/client/"+t.id,t).then(t=>{this.notify("success",`Client ${t.name} mise à jour réussie`),this.getClients()}).catch(t=>{this.notify("error",t.response.status+" "+t.response.statusText)})}}},notify(t,e){this.notification.show=!0,this.notification.color=t,this.notification.text=e}}},ft=mt,gt=i("2877"),bt=Object(gt["a"])(ft,dt,ut,!1,null,null,null),yt=bt.exports,Ct={name:"clients",components:{Clients:yt}},wt=Ct,_t=Object(gt["a"])(wt,n,a,!1,null,null,null);e["default"]=_t.exports},9734:function(t,e,i){},"99d9":function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return l})),i.d(e,"c",(function(){return r}));var s=i("b0af"),n=i("80d2");const a=Object(n["h"])("v-card__actions"),o=Object(n["h"])("v-card__subtitle"),l=Object(n["h"])("v-card__text"),r=Object(n["h"])("v-card__title");s["a"]},"9d01":function(t,e,i){},ec29:function(t,e,i){}}]);
//# sourceMappingURL=Clients.c3e03423.js.map