@kong-ui-public/forms 3.4.2 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/forms.umd.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(D,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(D=typeof globalThis<"u"?globalThis:D||self,t(D["kong-ui-public-forms"]={},D.Vue,D["kong-ui-public-i18n"]))})(this,function(D,t,Qe){"use strict";function Mt(e,n){for(var o=-1,r=e==null?0:e.length;++o<r&&n(e[o],o,e)!==!1;);return e}function _o(e){return function(n,o,r){for(var a=-1,i=Object(n),s=r(n),l=s.length;l--;){var d=s[e?l:++a];if(o(i[d],d,i)===!1)break}return n}}var wo=_o();const ko=wo;function Co(e,n){for(var o=-1,r=Array(e);++o<e;)r[o]=n(o);return r}var Bt=typeof global=="object"&&global&&global.Object===Object&&global,Eo=typeof self=="object"&&self&&self.Object===Object&&self,J=Bt||Eo||Function("return this")(),Q=J.Symbol,Nt=Object.prototype,So=Nt.hasOwnProperty,To=Nt.toString,Ne=Q?Q.toStringTag:void 0;function $o(e){var n=So.call(e,Ne),o=e[Ne];try{e[Ne]=void 0;var r=!0}catch{}var a=To.call(e);return r&&(n?e[Ne]=o:delete e[Ne]),a}var Mo=Object.prototype,Bo=Mo.toString;function No(e){return Bo.call(e)}var Vo="[object Null]",Io="[object Undefined]",Vt=Q?Q.toStringTag:void 0;function ae(e){return e==null?e===void 0?Io:Vo:Vt&&Vt in Object(e)?$o(e):No(e)}function ee(e){return e!=null&&typeof e=="object"}var Ao="[object Arguments]";function It(e){return ee(e)&&ae(e)==Ao}var At=Object.prototype,Oo=At.hasOwnProperty,Fo=At.propertyIsEnumerable,et=It(function(){return arguments}())?It:function(e){return ee(e)&&Oo.call(e,"callee")&&!Fo.call(e,"callee")},W=Array.isArray;function Uo(){return!1}var Ot=typeof D=="object"&&D&&!D.nodeType&&D,Ft=Ot&&typeof module=="object"&&module&&!module.nodeType&&module,Do=Ft&&Ft.exports===Ot,Ut=Do?J.Buffer:void 0,Lo=Ut?Ut.isBuffer:void 0,Ve=Lo||Uo,vo=9007199254740991,Po=/^(?:0|[1-9]\d*)$/;function tt(e,n){var o=typeof e;return n=n??vo,!!n&&(o=="number"||o!="symbol"&&Po.test(e))&&e>-1&&e%1==0&&e<n}var qo=9007199254740991;function nt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qo}var Ro="[object Arguments]",zo="[object Array]",jo="[object Boolean]",xo="[object Date]",Ko="[object Error]",Ho="[object Function]",Yo="[object Map]",Go="[object Number]",Wo="[object Object]",Zo="[object RegExp]",Jo="[object Set]",Xo="[object String]",Qo="[object WeakMap]",ei="[object ArrayBuffer]",ti="[object DataView]",ni="[object Float32Array]",oi="[object Float64Array]",ii="[object Int8Array]",ri="[object Int16Array]",ai="[object Int32Array]",li="[object Uint8Array]",si="[object Uint8ClampedArray]",di="[object Uint16Array]",ci="[object Uint32Array]",v={};v[ni]=v[oi]=v[ii]=v[ri]=v[ai]=v[li]=v[si]=v[di]=v[ci]=!0,v[Ro]=v[zo]=v[ei]=v[jo]=v[ti]=v[xo]=v[Ko]=v[Ho]=v[Yo]=v[Go]=v[Wo]=v[Zo]=v[Jo]=v[Xo]=v[Qo]=!1;function mi(e){return ee(e)&&nt(e.length)&&!!v[ae(e)]}function ot(e){return function(n){return e(n)}}var Dt=typeof D=="object"&&D&&!D.nodeType&&D,Ie=Dt&&typeof module=="object"&&module&&!module.nodeType&&module,ui=Ie&&Ie.exports===Dt,it=ui&&Bt.process,ke=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||it&&it.binding&&it.binding("util")}catch{}}(),Lt=ke&&ke.isTypedArray,rt=Lt?ot(Lt):mi,hi=Object.prototype,pi=hi.hasOwnProperty;function vt(e,n){var o=W(e),r=!o&&et(e),a=!o&&!r&&Ve(e),i=!o&&!r&&!a&&rt(e),s=o||r||a||i,l=s?Co(e.length,String):[],d=l.length;for(var c in e)(n||pi.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||tt(c,d)))&&l.push(c);return l}var fi=Object.prototype;function qe(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||fi;return e===o}function Pt(e,n){return function(o){return e(n(o))}}var gi=Pt(Object.keys,Object),yi=Object.prototype,bi=yi.hasOwnProperty;function qt(e){if(!qe(e))return gi(e);var n=[];for(var o in Object(e))bi.call(e,o)&&o!="constructor"&&n.push(o);return n}function j(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var _i="[object AsyncFunction]",wi="[object Function]",ki="[object GeneratorFunction]",Ci="[object Proxy]";function I(e){if(!j(e))return!1;var n=ae(e);return n==wi||n==ki||n==_i||n==Ci}function Ce(e){return e!=null&&nt(e.length)&&!I(e)}function Ee(e){return Ce(e)?vt(e):qt(e)}function Ei(e,n){return e&&ko(e,n,Ee)}function Si(e,n){return function(o,r){if(o==null)return o;if(!Ce(o))return e(o,r);for(var a=o.length,i=n?a:-1,s=Object(o);(n?i--:++i<a)&&r(s[i],i,s)!==!1;);return o}}var Ti=Si(Ei);const $i=Ti;function Re(e){return e}function Mi(e){return typeof e=="function"?e:Re}function H(e,n){var o=W(e)?Mt:$i;return o(e,Mi(n))}var Bi="[object Symbol]";function ze(e){return typeof e=="symbol"||ee(e)&&ae(e)==Bi}var Ni=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vi=/^\w*$/;function at(e,n){if(W(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||ze(e)?!0:Vi.test(e)||!Ni.test(e)||n!=null&&e in Object(n)}var lt=J["__core-js_shared__"],Rt=function(){var e=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ii(e){return!!Rt&&Rt in e}var Ai=Function.prototype,Oi=Ai.toString;function ue(e){if(e!=null){try{return Oi.call(e)}catch{}try{return e+""}catch{}}return""}var Fi=/[\\^$.*+?()[\]{}|]/g,Ui=/^\[object .+?Constructor\]$/,Di=Function.prototype,Li=Object.prototype,vi=Di.toString,Pi=Li.hasOwnProperty,qi=RegExp("^"+vi.call(Pi).replace(Fi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ri(e){if(!j(e)||Ii(e))return!1;var n=I(e)?qi:Ui;return n.test(ue(e))}function zi(e,n){return e==null?void 0:e[n]}function he(e,n){var o=zi(e,n);return Ri(o)?o:void 0}var Ae=he(Object,"create");function ji(){this.__data__=Ae?Ae(null):{},this.size=0}function xi(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Ki="__lodash_hash_undefined__",Hi=Object.prototype,Yi=Hi.hasOwnProperty;function Gi(e){var n=this.__data__;if(Ae){var o=n[e];return o===Ki?void 0:o}return Yi.call(n,e)?n[e]:void 0}var Wi=Object.prototype,Zi=Wi.hasOwnProperty;function Ji(e){var n=this.__data__;return Ae?n[e]!==void 0:Zi.call(n,e)}var Xi="__lodash_hash_undefined__";function Qi(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Ae&&n===void 0?Xi:n,this}function pe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}pe.prototype.clear=ji,pe.prototype.delete=xi,pe.prototype.get=Gi,pe.prototype.has=Ji,pe.prototype.set=Qi;function er(){this.__data__=[],this.size=0}function Oe(e,n){return e===n||e!==e&&n!==n}function je(e,n){for(var o=e.length;o--;)if(Oe(e[o][0],n))return o;return-1}var tr=Array.prototype,nr=tr.splice;function or(e){var n=this.__data__,o=je(n,e);if(o<0)return!1;var r=n.length-1;return o==r?n.pop():nr.call(n,o,1),--this.size,!0}function ir(e){var n=this.__data__,o=je(n,e);return o<0?void 0:n[o][1]}function rr(e){return je(this.__data__,e)>-1}function ar(e,n){var o=this.__data__,r=je(o,e);return r<0?(++this.size,o.push([e,n])):o[r][1]=n,this}function oe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}oe.prototype.clear=er,oe.prototype.delete=or,oe.prototype.get=ir,oe.prototype.has=rr,oe.prototype.set=ar;var Fe=he(J,"Map");function lr(){this.size=0,this.__data__={hash:new pe,map:new(Fe||oe),string:new pe}}function sr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function xe(e,n){var o=e.__data__;return sr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function dr(e){var n=xe(this,e).delete(e);return this.size-=n?1:0,n}function cr(e){return xe(this,e).get(e)}function mr(e){return xe(this,e).has(e)}function ur(e,n){var o=xe(this,e),r=o.size;return o.set(e,n),this.size+=o.size==r?0:1,this}function ie(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}ie.prototype.clear=lr,ie.prototype.delete=dr,ie.prototype.get=cr,ie.prototype.has=mr,ie.prototype.set=ur;var hr="Expected a function";function st(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(hr);var o=function(){var r=arguments,a=n?n.apply(this,r):r[0],i=o.cache;if(i.has(a))return i.get(a);var s=e.apply(this,r);return o.cache=i.set(a,s)||i,s};return o.cache=new(st.Cache||ie),o}st.Cache=ie;var pr=500;function fr(e){var n=st(e,function(r){return o.size===pr&&o.clear(),r}),o=n.cache;return n}var gr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/\\(\\)?/g,br=fr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(gr,function(o,r,a,i){n.push(a?i.replace(yr,"$1"):r||o)}),n});function _r(e,n){for(var o=-1,r=e==null?0:e.length,a=Array(r);++o<r;)a[o]=n(e[o],o,e);return a}var wr=1/0,zt=Q?Q.prototype:void 0,jt=zt?zt.toString:void 0;function xt(e){if(typeof e=="string")return e;if(W(e))return _r(e,xt)+"";if(ze(e))return jt?jt.call(e):"";var n=e+"";return n=="0"&&1/e==-wr?"-0":n}function Kt(e){return e==null?"":xt(e)}function Ht(e,n){return W(e)?e:at(e,n)?[e]:br(Kt(e))}var kr=1/0;function Ke(e){if(typeof e=="string"||ze(e))return e;var n=e+"";return n=="0"&&1/e==-kr?"-0":n}function Yt(e,n){n=Ht(n,e);for(var o=0,r=n.length;e!=null&&o<r;)e=e[Ke(n[o++])];return o&&o==r?e:void 0}function N(e,n,o){var r=e==null?void 0:Yt(e,n);return r===void 0?o:r}function R(e){return e==null}var Cr="[object String]";function fe(e){return typeof e=="string"||!W(e)&&ee(e)&&ae(e)==Cr}const Gt={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[N(this.options,"validationErrorClass","error")]:n,[N(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?H(e.styleClasses,r=>o[r]=!0):fe(e.styleClasses)&&(o[e.styleClasses]=!0),R(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return I(e.disabled)?e.disabled.call(this,this.model,e,this):R(e.disabled)?!1:e.disabled},fieldReadonly(e){return I(e.readonly)?e.readonly.call(this,this.model,e,this):R(e.readonly)?!1:e.readonly},fieldFeatured(e){return I(e.featured)?e.featured.call(this,this.model,e,this):R(e.featured)?!1:e.featured},fieldRequired(e){return I(e.required)?e.required.call(this,this.model,e,this):R(e.required)?!1:e.required}}};function Er(){this.__data__=new oe,this.size=0}function Sr(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Tr(e){return this.__data__.get(e)}function $r(e){return this.__data__.has(e)}var Mr=200;function Br(e,n){var o=this.__data__;if(o instanceof oe){var r=o.__data__;if(!Fe||r.length<Mr-1)return r.push([e,n]),this.size=++o.size,this;o=this.__data__=new ie(r)}return o.set(e,n),this.size=o.size,this}function te(e){var n=this.__data__=new oe(e);this.size=n.size}te.prototype.clear=Er,te.prototype.delete=Sr,te.prototype.get=Tr,te.prototype.has=$r,te.prototype.set=Br;var He=function(){try{var e=he(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Wt(e,n,o){n=="__proto__"&&He?He(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Nr=Object.prototype,Vr=Nr.hasOwnProperty;function Zt(e,n,o){var r=e[n];(!(Vr.call(e,n)&&Oe(r,o))||o===void 0&&!(n in e))&&Wt(e,n,o)}function Ye(e,n,o,r){var a=!o;o||(o={});for(var i=-1,s=n.length;++i<s;){var l=n[i],d=r?r(o[l],e[l],l,o,e):void 0;d===void 0&&(d=e[l]),a?Wt(o,l,d):Zt(o,l,d)}return o}function Ir(e,n){return e&&Ye(n,Ee(n),e)}function Ar(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Or=Object.prototype,Fr=Or.hasOwnProperty;function Ur(e){if(!j(e))return Ar(e);var n=qe(e),o=[];for(var r in e)r=="constructor"&&(n||!Fr.call(e,r))||o.push(r);return o}function Ge(e){return Ce(e)?vt(e,!0):Ur(e)}function Dr(e,n){return e&&Ye(n,Ge(n),e)}var Jt=typeof D=="object"&&D&&!D.nodeType&&D,Xt=Jt&&typeof module=="object"&&module&&!module.nodeType&&module,Lr=Xt&&Xt.exports===Jt,Qt=Lr?J.Buffer:void 0,en=Qt?Qt.allocUnsafe:void 0;function vr(e,n){if(n)return e.slice();var o=e.length,r=en?en(o):new e.constructor(o);return e.copy(r),r}function Pr(e,n){var o=-1,r=e.length;for(n||(n=Array(r));++o<r;)n[o]=e[o];return n}function qr(e,n){for(var o=-1,r=e==null?0:e.length,a=0,i=[];++o<r;){var s=e[o];n(s,o,e)&&(i[a++]=s)}return i}function tn(){return[]}var Rr=Object.prototype,zr=Rr.propertyIsEnumerable,nn=Object.getOwnPropertySymbols,dt=nn?function(e){return e==null?[]:(e=Object(e),qr(nn(e),function(n){return zr.call(e,n)}))}:tn;function jr(e,n){return Ye(e,dt(e),n)}function on(e,n){for(var o=-1,r=n.length,a=e.length;++o<r;)e[a+o]=n[o];return e}var xr=Pt(Object.getPrototypeOf,Object);const rn=xr;var Kr=Object.getOwnPropertySymbols,an=Kr?function(e){for(var n=[];e;)on(n,dt(e)),e=rn(e);return n}:tn;function Hr(e,n){return Ye(e,an(e),n)}function ln(e,n,o){var r=n(e);return W(e)?r:on(r,o(e))}function ct(e){return ln(e,Ee,dt)}function Yr(e){return ln(e,Ge,an)}var mt=he(J,"DataView"),ut=he(J,"Promise"),Se=he(J,"Set"),ht=he(J,"WeakMap"),sn="[object Map]",Gr="[object Object]",dn="[object Promise]",cn="[object Set]",mn="[object WeakMap]",un="[object DataView]",Wr=ue(mt),Zr=ue(Fe),Jr=ue(ut),Xr=ue(Se),Qr=ue(ht),ge=ae;(mt&&ge(new mt(new ArrayBuffer(1)))!=un||Fe&&ge(new Fe)!=sn||ut&&ge(ut.resolve())!=dn||Se&&ge(new Se)!=cn||ht&&ge(new ht)!=mn)&&(ge=function(e){var n=ae(e),o=n==Gr?e.constructor:void 0,r=o?ue(o):"";if(r)switch(r){case Wr:return un;case Zr:return sn;case Jr:return dn;case Xr:return cn;case Qr:return mn}return n});const Te=ge;var ea=Object.prototype,ta=ea.hasOwnProperty;function na(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&ta.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var We=J.Uint8Array;function pt(e){var n=new e.constructor(e.byteLength);return new We(n).set(new We(e)),n}function oa(e,n){var o=n?pt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ia=/\w*$/;function ra(e){var n=new e.constructor(e.source,ia.exec(e));return n.lastIndex=e.lastIndex,n}var hn=Q?Q.prototype:void 0,pn=hn?hn.valueOf:void 0;function aa(e){return pn?Object(pn.call(e)):{}}function la(e,n){var o=n?pt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var sa="[object Boolean]",da="[object Date]",ca="[object Map]",ma="[object Number]",ua="[object RegExp]",ha="[object Set]",pa="[object String]",fa="[object Symbol]",ga="[object ArrayBuffer]",ya="[object DataView]",ba="[object Float32Array]",_a="[object Float64Array]",wa="[object Int8Array]",ka="[object Int16Array]",Ca="[object Int32Array]",Ea="[object Uint8Array]",Sa="[object Uint8ClampedArray]",Ta="[object Uint16Array]",$a="[object Uint32Array]";function Ma(e,n,o){var r=e.constructor;switch(n){case ga:return pt(e);case sa:case da:return new r(+e);case ya:return oa(e,o);case ba:case _a:case wa:case ka:case Ca:case Ea:case Sa:case Ta:case $a:return la(e,o);case ca:return new r;case ma:case pa:return new r(e);case ua:return ra(e);case ha:return new r;case fa:return aa(e)}}var fn=Object.create,Ba=function(){function e(){}return function(n){if(!j(n))return{};if(fn)return fn(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Na(e){return typeof e.constructor=="function"&&!qe(e)?Ba(rn(e)):{}}var Va="[object Map]";function Ia(e){return ee(e)&&Te(e)==Va}var gn=ke&&ke.isMap,Aa=gn?ot(gn):Ia,Oa="[object Set]";function Fa(e){return ee(e)&&Te(e)==Oa}var yn=ke&&ke.isSet,Ua=yn?ot(yn):Fa,Da=1,La=2,va=4,bn="[object Arguments]",Pa="[object Array]",qa="[object Boolean]",Ra="[object Date]",za="[object Error]",_n="[object Function]",ja="[object GeneratorFunction]",xa="[object Map]",Ka="[object Number]",wn="[object Object]",Ha="[object RegExp]",Ya="[object Set]",Ga="[object String]",Wa="[object Symbol]",Za="[object WeakMap]",Ja="[object ArrayBuffer]",Xa="[object DataView]",Qa="[object Float32Array]",el="[object Float64Array]",tl="[object Int8Array]",nl="[object Int16Array]",ol="[object Int32Array]",il="[object Uint8Array]",rl="[object Uint8ClampedArray]",al="[object Uint16Array]",ll="[object Uint32Array]",L={};L[bn]=L[Pa]=L[Ja]=L[Xa]=L[qa]=L[Ra]=L[Qa]=L[el]=L[tl]=L[nl]=L[ol]=L[xa]=L[Ka]=L[wn]=L[Ha]=L[Ya]=L[Ga]=L[Wa]=L[il]=L[rl]=L[al]=L[ll]=!0,L[za]=L[_n]=L[Za]=!1;function Ue(e,n,o,r,a,i){var s,l=n&Da,d=n&La,c=n&va;if(o&&(s=a?o(e,r,a,i):o(e)),s!==void 0)return s;if(!j(e))return e;var m=W(e);if(m){if(s=na(e),!l)return Pr(e,s)}else{var p=Te(e),g=p==_n||p==ja;if(Ve(e))return vr(e,l);if(p==wn||p==bn||g&&!a){if(s=d||g?{}:Na(e),!l)return d?Hr(e,Dr(s,e)):jr(e,Ir(s,e))}else{if(!L[p])return a?e:{};s=Ma(e,p,l)}}i||(i=new te);var M=i.get(e);if(M)return M;i.set(e,s),Ua(e)?e.forEach(function(k){s.add(Ue(k,n,o,k,e,i))}):Aa(e)&&e.forEach(function(k,f){s.set(f,Ue(k,n,o,f,e,i))});var B=c?d?Yr:ct:d?Ge:Ee,_=m?void 0:B(e);return Mt(_||e,function(k,f){_&&(f=k,k=e[f]),Zt(s,f,Ue(k,n,o,f,e,i))}),s}var sl=1,dl=4;function re(e){return Ue(e,sl|dl)}const ft=(e,n="")=>typeof e.id<"u"?n+e.id:n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),kn=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var gt=function(){return J.Date.now()},cl=/\s/;function ml(e){for(var n=e.length;n--&&cl.test(e.charAt(n)););return n}var ul=/^\s+/;function hl(e){return e&&e.slice(0,ml(e)+1).replace(ul,"")}var Cn=NaN,pl=/^[-+]0x[0-9a-f]+$/i,fl=/^0b[01]+$/i,gl=/^0o[0-7]+$/i,yl=parseInt;function yt(e){if(typeof e=="number")return e;if(ze(e))return Cn;if(j(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=j(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=hl(e);var o=fl.test(e);return o||gl.test(e)?yl(e.slice(2),o?2:8):pl.test(e)?Cn:+e}var bl="Expected a function",_l=Math.max,wl=Math.min;function De(e,n,o){var r,a,i,s,l,d,c=0,m=!1,p=!1,g=!0;if(typeof e!="function")throw new TypeError(bl);n=yt(n)||0,j(o)&&(m=!!o.leading,p="maxWait"in o,i=p?_l(yt(o.maxWait)||0,n):i,g="trailing"in o?!!o.trailing:g);function M(h){var C=r,U=a;return r=a=void 0,c=h,s=e.apply(U,C),s}function B(h){return c=h,l=setTimeout(f,n),m?M(h):s}function _(h){var C=h-d,U=h-c,u=n-C;return p?wl(u,i-U):u}function k(h){var C=h-d,U=h-c;return d===void 0||C>=n||C<0||p&&U>=i}function f(){var h=gt();if(k(h))return w(h);l=setTimeout(f,_(h))}function w(h){return l=void 0,g&&r?M(h):(r=a=void 0,s)}function O(){l!==void 0&&clearTimeout(l),c=0,r=d=a=l=void 0}function F(){return l===void 0?s:w(gt())}function y(){var h=gt(),C=k(h);if(r=arguments,a=this,d=h,C){if(l===void 0)return B(d);if(p)return clearTimeout(l),l=setTimeout(f,n),M(d)}return l===void 0&&(l=setTimeout(f,n)),s}return y.cancel=O,y.flush=F,y}var kl="__lodash_hash_undefined__";function Cl(e){return this.__data__.set(e,kl),this}function El(e){return this.__data__.has(e)}function Le(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new ie;++n<o;)this.add(e[n])}Le.prototype.add=Le.prototype.push=Cl,Le.prototype.has=El;function En(e,n,o,r){for(var a=e.length,i=o+(r?1:-1);r?i--:++i<a;)if(n(e[i],i,e))return i;return-1}function Sl(e){return e!==e}function Tl(e,n,o){for(var r=o-1,a=e.length;++r<a;)if(e[r]===n)return r;return-1}function $l(e,n,o){return n===n?Tl(e,n,o):En(e,Sl,o)}function Ml(e,n){var o=e==null?0:e.length;return!!o&&$l(e,n,0)>-1}function Bl(e,n,o){for(var r=-1,a=e==null?0:e.length;++r<a;)if(o(n,e[r]))return!0;return!1}function Sn(e,n){return e.has(n)}function Nl(){}function bt(e){var n=-1,o=Array(e.size);return e.forEach(function(r){o[++n]=r}),o}var Vl=1/0,Il=Se&&1/bt(new Se([,-0]))[1]==Vl?function(e){return new Se(e)}:Nl,Al=200;function Ol(e,n,o){var r=-1,a=Ml,i=e.length,s=!0,l=[],d=l;if(o)s=!1,a=Bl;else if(i>=Al){var c=n?null:Il(e);if(c)return bt(c);s=!1,a=Sn,d=new Le}else d=n?[]:l;e:for(;++r<i;){var m=e[r],p=n?n(m):m;if(m=o||m!==0?m:0,s&&p===p){for(var g=d.length;g--;)if(d[g]===p)continue e;n&&d.push(p),l.push(m)}else a(d,p,o)||(d!==l&&d.push(p),l.push(m))}return l}function Tn(e){return e&&e.length?Ol(e):[]}var Fl=0;function $n(e){var n=++Fl;return Kt(e)+n}function Ul(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var Mn=Math.max;function Dl(e,n,o){return n=Mn(n===void 0?e.length-1:n,0),function(){for(var r=arguments,a=-1,i=Mn(r.length-n,0),s=Array(i);++a<i;)s[a]=r[n+a];a=-1;for(var l=Array(n+1);++a<n;)l[a]=r[a];return l[n]=o(s),Ul(e,this,l)}}function Ll(e){return function(){return e}}var vl=He?function(e,n){return He(e,"toString",{configurable:!0,enumerable:!1,value:Ll(n),writable:!0})}:Re;const Pl=vl;var ql=800,Rl=16,zl=Date.now;function jl(e){var n=0,o=0;return function(){var r=zl(),a=Rl-(r-o);if(o=r,a>0){if(++n>=ql)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var xl=jl(Pl);function Kl(e,n){return xl(Dl(e,n,Re),e+"")}function Hl(e,n,o){if(!j(o))return!1;var r=typeof n;return(r=="number"?Ce(o)&&tt(n,o.length):r=="string"&&n in o)?Oe(o[n],e):!1}var Bn=Object.prototype,Yl=Bn.hasOwnProperty,le=Kl(function(e,n){e=Object(e);var o=-1,r=n.length,a=r>2?n[2]:void 0;for(a&&Hl(n[0],n[1],a)&&(r=1);++o<r;)for(var i=n[o],s=Ge(i),l=-1,d=s.length;++l<d;){var c=s[l],m=e[c];(m===void 0||Oe(m,Bn[c])&&!Yl.call(e,c))&&(e[c]=i[c])}return e}),Gl=J.isFinite;function Wl(e){return typeof e=="number"&&Gl(e)}var Nn=1/0,Zl=17976931348623157e292;function Jl(e){if(!e)return e===0?e:0;if(e=yt(e),e===Nn||e===-Nn){var n=e<0?-1:1;return n*Zl}return e===e?e:0}function Vn(e){var n=Jl(e),o=n%1;return n===n?o?n-o:n:0}function Xl(e){return typeof e=="number"&&e==Vn(e)}var Ql="[object Number]";function _t(e){return typeof e=="number"||ee(e)&&ae(e)==Ql}var In=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,se="\\d\\d?",de="\\d\\d",es="\\d{3}",ts="\\d{4}",ve="[^\\s]+",An=/\[([^]*?)\]/gm;function On(e,n){for(var o=[],r=0,a=e.length;r<a;r++)o.push(e[r].substr(0,n));return o}var Fn=function(e){return function(n,o){var r=o[e].map(function(i){return i.toLowerCase()}),a=r.indexOf(n.toLowerCase());return a>-1?a:null}};function ye(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var r=0,a=n;r<a.length;r++){var i=a[r];for(var s in i)e[s]=i[s]}return e}var Un=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Dn=["January","February","March","April","May","June","July","August","September","October","November","December"],ns=On(Dn,3),os=On(Un,3),Ln={dayNamesShort:os,dayNames:Un,monthNamesShort:ns,monthNames:Dn,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Ze=ye({},Ln),is=function(e){return Ze=ye(Ze,e)},vn=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},G=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},rs={D:function(e){return String(e.getDate())},DD:function(e){return G(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return G(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return G(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return G(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return G(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return G(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return G(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return G(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return G(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return G(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return G(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+G(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+G(Math.floor(Math.abs(n)/60),2)+":"+G(Math.abs(n)%60,2)}},Pn=function(e){return+e-1},qn=[null,se],Rn=[null,ve],zn=["isPm",ve,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],jn=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],as={D:["day",se],DD:["day",de],Do:["day",se+ve,function(e){return parseInt(e,10)}],M:["month",se,Pn],MM:["month",de,Pn],YY:["year",de,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",se,void 0,"isPm"],hh:["hour",de,void 0,"isPm"],H:["hour",se],HH:["hour",de],m:["minute",se],mm:["minute",de],s:["second",se],ss:["second",de],YYYY:["year",ts],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",de,function(e){return+e*10}],SSS:["millisecond",es],d:qn,dd:qn,ddd:Rn,dddd:Rn,MMM:["month",ve,Fn("monthNamesShort")],MMMM:["month",ve,Fn("monthNames")],a:zn,A:zn,ZZ:jn,Z:jn},Je={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ls=function(e){return ye(Je,e)},ss=function(e,n,o){if(n===void 0&&(n=Je.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=Je[n]||n;var r=[];n=n.replace(An,function(i,s){return r.push(s),"@@@"});var a=ye(ye({},Ze),o);return n=n.replace(In,function(i){return rs[i](e,a)}),n.replace(/@@@/g,function(){return r.shift()})};function ds(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=Je[n]||n,e.length>1e3)return null;var r=new Date,a={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],s=[],l=n.replace(An,function(F,y){return s.push(vn(y)),"@@@"}),d={},c={};l=vn(l).replace(In,function(F){var y=as[F],h=y[0],C=y[1],U=y[3];if(d[h])throw new Error("Invalid format. "+h+" specified twice in format");return d[h]=!0,U&&(c[U]=!0),i.push(y),"("+C+")"}),Object.keys(c).forEach(function(F){if(!d[F])throw new Error("Invalid format. "+F+" is required in specified format")}),l=l.replace(/@@@/g,function(){return s.shift()});var m=e.match(new RegExp(l,"i"));if(!m)return null;for(var p=ye(ye({},Ze),o),g=1;g<m.length;g++){var M=i[g-1],B=M[0],_=M[2],k=_?_(m[g],p):+m[g];if(k==null)return null;a[B]=k}a.isPm===1&&a.hour!=null&&+a.hour!=12?a.hour=+a.hour+12:a.isPm===0&&+a.hour==12&&(a.hour=0);var f;if(a.timezoneOffset==null){f=new Date(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond);for(var w=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],g=0,O=w.length;g<O;g++)if(d[w[g][0]]&&a[w[g][0]]!==f[w[g][1]]())return null}else if(f=new Date(Date.UTC(a.year,a.month,a.day,a.hour,a.minute-a.timezoneOffset,a.second,a.millisecond)),a.month>11||a.month<0||a.day>31||a.day<1||a.hour>23||a.hour<0||a.minute>59||a.minute<0||a.second>59||a.second<0)return null;return f}var ne={format:ss,parse:ds,defaultI18n:Ln,setGlobalDateI18n:is,setGlobalDateMasks:ls};const K={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function X(e,n,o=K){return R(e)||e===""?n?[q(o.fieldIsRequired)]:[]:null}function q(e,...n){if(e!=null&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",n[o]);return e}const be={resources:K,required(e,n,o,r=K){return X(e,n.required,r)},number(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=[];return Wl(e)?(!R(n.min)&&e<n.min&&i.push(q(r.numberTooSmall,n.min)),!R(n.max)&&e>n.max&&i.push(q(r.numberTooBig,n.max))):i.push(q(r.invalidNumber)),i},integer(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=be.number(e,n,o,r);return Xl(e)||i.push(q(r.invalidInteger)),i},double(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!_t(e)||isNaN(e))return[q(r.invalidNumber)]},string(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=[];return fe(e)?(!R(n.min)&&e.length<n.min&&i.push(q(r.textTooSmall,e.length,n.min)),!R(n.max)&&e.length>n.max&&i.push(q(r.textTooBig,e.length,n.max))):i.push(q(r.thisNotText)),i},array(e,n,o,r=K){if(n.required){if(!Array.isArray(e))return[q(r.thisNotArray)];if(e.length===0)return[q(r.fieldIsRequired)]}if(!R(e)){if(!R(n.min)&&e.length<n.min)return[q(r.selectMinItems,n.min)];if(!R(n.max)&&e.length>n.max)return[q(r.selectMaxItems,n.max)]}},date(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=new Date(e);if(isNaN(i.getDate()))return[q(r.invalidDate)];const s=[];if(!R(n.min)){const l=new Date(n.min);i.valueOf()<l.valueOf()&&s.push(q(r.dateIsEarly,ne.format(i),ne.format(l)))}if(!R(n.max)){const l=new Date(n.max);i.valueOf()>l.valueOf()&&s.push(q(r.dateIsLate,ne.format(i),ne.format(l)))}return s},regexp(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!R(n.pattern)&&!new RegExp(n.pattern).test(e))return[q(r.invalidFormat)]},email(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e))return[q(r.invalidEmail)]},url(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e))return[q(r.invalidURL)]},creditCard(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,s=e.replace(/[^0-9]+/g,"");if(!i.test(s))return[q(r.invalidCard)];let l=0,d,c,m;for(let p=s.length-1;p>=0;p--)d=s.substring(p,p+1),c=parseInt(d,10),m?(c*=2,c>=10?l+=c%10+1:l+=c):l+=c,m=!m;if(!(l%10===0&&s))return[q(r.invalidCardNumber)]},alpha(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^[a-zA-Z]*$/.test(e))return[q(r.invalidTextContainNumber)]},alphaNumeric(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^[a-zA-Z0-9]*$/.test(e))return[q(r.invalidTextContainSpec)]}};Object.keys(be).forEach(e=>{const n=be[e];I(n)&&(n.locale=o=>(r,a,i)=>n(r,a,i,le(o,K)))});function xn(e){return fe(e)?be[e]!=null?be[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function wt(e,n,o){let r=N(o.context,"schema.attributes",{});const a=n.value||"input";fe(a)&&(r=N(r,a)||r),H(r,(i,s)=>{e.setAttribute(s,i)})}const A={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:wt,updated:wt,componentUpdated:wt}},computed:{value:{cache:!1,get(){let e;return I(N(this.schema,"get"))?e=this.schema.get(this.model):e=N(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),I(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=N(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const a=[];Array.isArray(this.schema.validator)?H(this.schema.validator,i=>{a.push(xn(i).bind(this))}):a.push(xn(this.schema.validator).bind(this)),H(a,i=>{if(n)o.push(i(this.value,this.schema,this.model));else{const s=i(this.value,this.schema,this.model);s&&I(s.then)?s.then(l=>{l&&(this.errors=this.errors.concat(l));const d=this.errors.length===0;this.$emit("validated",d,this.errors,this)}):s&&(o=o.concat(s))}})}const r=a=>{let i=[];H(Tn(a),l=>{Array.isArray(l)&&l.length>0?i=i.concat(l):fe(l)&&i.push(l)}),I(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,i,this.schema);const s=i.length===0;return e||this.$emit("validated",s,i,this),this.errors=i,i};return n?Promise.all(o).then(r):r(o)},debouncedValidate(){I(this.debouncedValidateFunc)||(this.debouncedValidateFunc=De(this.validate.bind(this),N(this.schema,"validateDebounceTime",N(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;I(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),I(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),N(this.formOptions,"validateAfterChanged",!1)===!0&&(N(this.schema,"validateDebounceTime",N(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let r=this.model;const a=o.split(".");let i=0;const s=a.length;for(;i<s;){const l=a[i];if(i<s-1)r[l]!==void 0||(r[l]={}),r=r[l];else{r[l]=n;return}++i}},getFieldID(e,n=!1){const o=N(this.formOptions,"fieldIdPrefix","");return ft(e,o)+(n?"-"+$n():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return N(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},cs=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),ms={mixins:[A]},us=["id","autocomplete","disabled","name","required"];function hs(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("input",{id:e.getFieldID(e.schema),type:"checkbox","onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,class:t.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,us)),[[t.vModelCheckbox,e.value],[s,"input"]])}const T=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ps=T(ms,[["render",hs]]);var fs=4;function Kn(e){return Ue(e,fs)}const gs={class:"wrapper"},ys=["disabled"],bs=["id","checked","disabled","onChange","name"],_s=["disabled"],ws={class:"info"},ks=t.createElementVNode("div",{class:"arrow"},null,-1),Cs={class:"dropList"},Es=["id","checked","disabled","onChange","name"];function Ss(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",gs,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,bs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256))],8,ys)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:a.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>i.onExpandCombo&&i.onExpandCombo(...l))},[t.createElementVNode("div",ws,t.toDisplayString(i.selectedCount)+" selected",1),ks],2),t.createElementVNode("div",Cs,[a.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,Es),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,_s))])),[[s,"wrapper"]])}const Ts=T({mixins:[A],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?kn(this.schema.inputName+"_"+this.getItemValue(e)):kn(this.getItemValue(e))},getItemValue(e){if(j(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(j(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((R(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=Kn(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=Kn(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Ss]]);function $s(e){const n=t.ref([]),o=t.ref(null),r=_=>fe(_)?be[_]!=null?be[_]:(console.warn(`'${_}' is not a validator function!`),null):_,a=t.computed({get(){var k,f;let _;return I(N(e.schema,"get"))?_=e.schema.get((k=e.model)==null?void 0:k.value):_=N((f=e.model)==null?void 0:f.value,e.schema.model),M(_)},set(_){const k=a;_=B(_),I(_)?_(_,k):l(_,k)}}),i=_=>{var F;d();const k=(F=e.schema)==null?void 0:F.validator,f=N(e.formOptions,"validateAsync",!1);let w=[];if(k&&e.schema.readonly!==!0&&e.disabled!==!0){const y=[];Array.isArray(k)?H(k,h=>{y.push(r(h))}):y.push(r(k)),H(y,h=>{var C,U;if(f)w.push(h(a.value,e.schema,(C=e.model)==null?void 0:C.value));else{const u=h(a.value,e.schema,(U=e.model)==null?void 0:U.value);u&&I(u.then)?u.then(b=>{b&&(n.value=n.value.concat(b));const E=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:E,errors:n.value,field:e.schema})}):u&&(w=w.concat(u))}})}const O=y=>{var C,U;let h=[];if(H(Tn(y),u=>{Array.isArray(u)&&u.length>0?h=h.concat(u):fe(u)&&h.push(u)}),I((C=e.schema)==null?void 0:C.onValidated)&&e.schema.onValidated((U=e.model)==null?void 0:U.value,h,e.schema),!_){const u=h.length===0;e.emitValidated&&e.emitValidated({isValid:u,errors:h,field:e.schema})}return y=h,h};return f?Promise.all(w).then(O):O(w)},s=()=>{I(o.value)?o.value():o.value=De(i,N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",500)))},l=(_,k)=>{var w,O,F;let f=!1;I(e.schema.set)?(e.schema.set((w=e.model)==null?void 0:w.value,_),f=!0):e.schema.model&&(c(e.schema.model,_),f=!0),f&&(e.emitModelUpdated&&((O=e.model)!=null&&O.value)&&e.emitModelUpdated({value:_,model:e.schema.model}),I(e.schema.onChanged)&&e.schema.onChanged((F=e.model)==null?void 0:F.value,_,k,e.schema),N(e.formOptions,"validateAfterChanged",!1)===!0&&(N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",0))>0?s():i()))},d=()=>{n.value.splice(0)},c=(_,k)=>{var h;let f=_.replace(/\[(\w+)\]/g,".$1");f=f.replace(/^\./,"");let w=((h=e.model)==null?void 0:h.value)||{},O=0;const F=f.split("."),y=F.length;for(;O<y;){const C=F[O];if(O<y-1)w[C]!==void 0||(w[C]={}),w=w[C];else{w[C]=k;return}++O}},m=(_,k=!1)=>{const f=N(e.formOptions,"fieldIdPrefix","");return ft(_,f)+(k?"-"+$n():"")},p=_=>`${m(_)}-label`,g=()=>N(e.schema,"fieldClasses",[]),M=_=>_,B=_=>_;return{value:a,clearValidationErrors:d,getFieldID:m,getLabelId:p,getFieldClasses:g,updateModelValue:l}}const Hn={useAbstractFields:$s},Ms={class:"form-field-wrapper"},Yn=T(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const r=e,a=o,i=t.toRefs(r),{updateModelValue:s,getFieldID:l,clearValidationErrors:d,value:c}=Hn.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:f=>{a("modelUpdated",f.value,f.model)}});n({clearValidationErrors:d});const m=t.computed(()=>{var w;const f=(w=r.schema)==null?void 0:w.inputType.toLowerCase();return f==="string"?"text":f==="datetime"?"datetime-local":f||"text"}),p={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},g=(f,w)=>{var h,C;let O=f;const F=p[m.value]||"",y=ne.parse(f,F);y&&((h=r.schema)!=null&&h.format?O=ne.format(y,(C=r.schema)==null?void 0:C.format):O=y.valueOf()),s(O,w)},M=(f,w)=>{_t(f)||(f=NaN),s(f,w)},B=f=>{let w=f;switch(m.value){case"number":case"range":_t(parseFloat(f))&&(w=parseFloat(f));break}c.value=w,s(w,f)},_=t.ref(null),k=()=>{var f;I(_.value)&&((f=_.value)==null||f.flush())};return t.onMounted(()=>{switch(m.value){case"number":case"range":_.value=De((f,w)=>{M(f,w)},parseInt(N(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":_.value=De((f,w)=>{g(f,w)},parseInt(N(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{m.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):m.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):m.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(f,w)=>{const O=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",Ms,[t.createVNode(O,t.mergeProps(f.$attrs,{id:t.unref(l)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||null,help:e.hint?e.hint:m.value==="color"||m.value==="range"?t.unref(c):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(c),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,type:m.value,width:e.schema.width,onBlur:k,"onUpdate:modelValue":B}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","type","width"])])}}}),[["__scopeId","data-v-b6d4701b"]]),Bs=T(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:r,value:a}=Hn.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(i,s)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(r)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-852ab959"]]),Ns=["disabled"],Vs=["id","disabled","name","onClick","value","checked","required"];function Is(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:"radio-list",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>t.withDirectives((t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(i.getItemCssClasses(l))},[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"radio",disabled:i.isItemDisabled(l)||null,name:i.id,onClick:d=>i.onSelection(l),value:i.getItemValue(l),checked:i.isItemChecked(l)||null,class:t.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,Vs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)],2)),[[s,"label"]])),256))],8,Ns)),[[s,"wrapper"]])}const As=T({mixins:[A],computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},id(){return this.schema.model}},methods:{getItemValue(e){if(j(e)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return e[this.schema.radiosOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return e},getItemName(e){if(j(e)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return e[this.schema.radiosOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return e},getItemCssClasses(e){return{"is-checked":this.isItemChecked(e),"is-disabled":this.isItemDisabled(e)}},onSelection(e){this.value=this.getItemValue(e)},isItemChecked(e){return this.getItemValue(e)===this.value},isItemDisabled(e){if(this.disabled)return!0;const n=N(e,"disabled",!1);return I(n)?n(this.model):n}}},[["render",Is]]);function Os(e,n){for(var o=-1,r=e==null?0:e.length;++o<r;)if(n(e[o],o,e))return!0;return!1}var Fs=1,Us=2;function Gn(e,n,o,r,a,i){var s=o&Fs,l=e.length,d=n.length;if(l!=d&&!(s&&d>l))return!1;var c=i.get(e),m=i.get(n);if(c&&m)return c==n&&m==e;var p=-1,g=!0,M=o&Us?new Le:void 0;for(i.set(e,n),i.set(n,e);++p<l;){var B=e[p],_=n[p];if(r)var k=s?r(_,B,p,n,e,i):r(B,_,p,e,n,i);if(k!==void 0){if(k)continue;g=!1;break}if(M){if(!Os(n,function(f,w){if(!Sn(M,w)&&(B===f||a(B,f,o,r,i)))return M.push(w)})){g=!1;break}}else if(!(B===_||a(B,_,o,r,i))){g=!1;break}}return i.delete(e),i.delete(n),g}function Ds(e){var n=-1,o=Array(e.size);return e.forEach(function(r,a){o[++n]=[a,r]}),o}var Ls=1,vs=2,Ps="[object Boolean]",qs="[object Date]",Rs="[object Error]",zs="[object Map]",js="[object Number]",xs="[object RegExp]",Ks="[object Set]",Hs="[object String]",Ys="[object Symbol]",Gs="[object ArrayBuffer]",Ws="[object DataView]",Wn=Q?Q.prototype:void 0,kt=Wn?Wn.valueOf:void 0;function Zs(e,n,o,r,a,i,s){switch(o){case Ws:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case Gs:return!(e.byteLength!=n.byteLength||!i(new We(e),new We(n)));case Ps:case qs:case js:return Oe(+e,+n);case Rs:return e.name==n.name&&e.message==n.message;case xs:case Hs:return e==n+"";case zs:var l=Ds;case Ks:var d=r&Ls;if(l||(l=bt),e.size!=n.size&&!d)return!1;var c=s.get(e);if(c)return c==n;r|=vs,s.set(e,n);var m=Gn(l(e),l(n),r,a,i,s);return s.delete(e),m;case Ys:if(kt)return kt.call(e)==kt.call(n)}return!1}var Js=1,Xs=Object.prototype,Qs=Xs.hasOwnProperty;function ed(e,n,o,r,a,i){var s=o&Js,l=ct(e),d=l.length,c=ct(n),m=c.length;if(d!=m&&!s)return!1;for(var p=d;p--;){var g=l[p];if(!(s?g in n:Qs.call(n,g)))return!1}var M=i.get(e),B=i.get(n);if(M&&B)return M==n&&B==e;var _=!0;i.set(e,n),i.set(n,e);for(var k=s;++p<d;){g=l[p];var f=e[g],w=n[g];if(r)var O=s?r(w,f,g,n,e,i):r(f,w,g,e,n,i);if(!(O===void 0?f===w||a(f,w,o,r,i):O)){_=!1;break}k||(k=g=="constructor")}if(_&&!k){var F=e.constructor,y=n.constructor;F!=y&&"constructor"in e&&"constructor"in n&&!(typeof F=="function"&&F instanceof F&&typeof y=="function"&&y instanceof y)&&(_=!1)}return i.delete(e),i.delete(n),_}var td=1,Zn="[object Arguments]",Jn="[object Array]",Xe="[object Object]",nd=Object.prototype,Xn=nd.hasOwnProperty;function od(e,n,o,r,a,i){var s=W(e),l=W(n),d=s?Jn:Te(e),c=l?Jn:Te(n);d=d==Zn?Xe:d,c=c==Zn?Xe:c;var m=d==Xe,p=c==Xe,g=d==c;if(g&&Ve(e)){if(!Ve(n))return!1;s=!0,m=!1}if(g&&!m)return i||(i=new te),s||rt(e)?Gn(e,n,o,r,a,i):Zs(e,n,d,o,r,a,i);if(!(o&td)){var M=m&&Xn.call(e,"__wrapped__"),B=p&&Xn.call(n,"__wrapped__");if(M||B){var _=M?e.value():e,k=B?n.value():n;return i||(i=new te),a(_,k,o,r,i)}}return g?(i||(i=new te),ed(e,n,o,r,a,i)):!1}function Ct(e,n,o,r,a){return e===n?!0:e==null||n==null||!ee(e)&&!ee(n)?e!==e&&n!==n:od(e,n,o,r,Ct,a)}var id=1,rd=2;function ad(e,n,o,r){var a=o.length,i=a,s=!r;if(e==null)return!i;for(e=Object(e);a--;){var l=o[a];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=o[a];var d=l[0],c=e[d],m=l[1];if(s&&l[2]){if(c===void 0&&!(d in e))return!1}else{var p=new te;if(r)var g=r(c,m,d,e,n,p);if(!(g===void 0?Ct(m,c,id|rd,r,p):g))return!1}}return!0}function Qn(e){return e===e&&!j(e)}function ld(e){for(var n=Ee(e),o=n.length;o--;){var r=n[o],a=e[r];n[o]=[r,a,Qn(a)]}return n}function eo(e,n){return function(o){return o==null?!1:o[e]===n&&(n!==void 0||e in Object(o))}}function sd(e){var n=ld(e);return n.length==1&&n[0][2]?eo(n[0][0],n[0][1]):function(o){return o===e||ad(o,e,n)}}function dd(e,n){return e!=null&&n in Object(e)}function cd(e,n,o){n=Ht(n,e);for(var r=-1,a=n.length,i=!1;++r<a;){var s=Ke(n[r]);if(!(i=e!=null&&o(e,s)))break;e=e[s]}return i||++r!=a?i:(a=e==null?0:e.length,!!a&&nt(a)&&tt(s,a)&&(W(e)||et(e)))}function md(e,n){return e!=null&&cd(e,n,dd)}var ud=1,hd=2;function pd(e,n){return at(e)&&Qn(n)?eo(Ke(e),n):function(o){var r=N(o,e);return r===void 0&&r===n?md(o,e):Ct(n,r,ud|hd)}}function fd(e){return function(n){return n==null?void 0:n[e]}}function gd(e){return function(n){return Yt(n,e)}}function yd(e){return at(e)?fd(Ke(e)):gd(e)}function to(e){return typeof e=="function"?e:e==null?Re:typeof e=="object"?W(e)?pd(e[0],e[1]):sd(e):yd(e)}function bd(e){return function(n,o,r){var a=Object(n);if(!Ce(n)){var i=to(o);n=Ee(n),o=function(l){return i(a[l],l,a)}}var s=e(n,o,r);return s>-1?a[i?n[s]:s]:void 0}}var _d=Math.max;function wd(e,n,o){var r=e==null?0:e.length;if(!r)return-1;var a=o==null?0:Vn(o);return a<0&&(a=_d(r+a,0)),En(e,to(n),a)}var kd=bd(wd);const Cd=["disabled","name","id"],Ed=["disabled"],Sd=["label"],Td=["value"],$d=["value"];function Md(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("select",{class:t.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},[i.selectOptions.hideNoneSelectedText?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null},t.toDisplayString(i.selectOptions.noneSelectedText||"<Nothing selected>"),9,Ed)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[l.group?(t.openBlock(),t.createElementBlock("optgroup",{key:0,label:i.getGroupName(l)},[l.ops?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(l.ops,d=>(t.openBlock(),t.createElementBlock("option",{value:i.getItemValue(d)},t.toDisplayString(i.getItemName(d)),9,Td))),256)):t.createCommentVNode("",!0)],8,Sd)):t.createCommentVNode("",!0),l.group?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:1,value:i.getItemValue(l)},t.toDisplayString(i.getItemName(l)),9,$d))],64))),256))],10,Cd)),[[t.vModelSelect,e.value],[s,"input"]])}const no=T({mixins:[A],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const e=this.schema.values;return typeof e=="function"?this.groupValues(e.apply(this,[this.model,this.schema])):this.groupValues(e)}},methods:{formatValueToField(e){return R(e)?null:e},groupValues(e){const n=[];let o={};return e.forEach(r=>{o=null,r.group&&j(r)?(o=kd(n,a=>a.group===r.group),o?o.ops.push({id:r.id,name:r.name}):(o={group:"",ops:[]},o.group=r.group,o.ops.push({id:r.id,name:r.name}),n.push(o))):n.push(r)}),n},getGroupName(e){if(e&&e.group)return e.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(e){if(j(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return e[this.schema.selectOptions.value];if(typeof e.id<"u")return e.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e},getItemName(e){if(j(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return e[this.schema.selectOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e}}},[["render",Md]]);var Bd="[object Map]",Nd="[object Set]",Vd=Object.prototype,Id=Vd.hasOwnProperty;function Ad(e){if(e==null)return!0;if(Ce(e)&&(W(e)||typeof e=="string"||typeof e.splice=="function"||Ve(e)||rt(e)||et(e)))return!e.length;var n=Te(e);if(n==Bd||n==Nd)return!e.size;if(qe(e))return!qt(e).length;for(var o in e)if(Id.call(e,o))return!1;return!0}const Od=["id","value","name","disabled"];function Fd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{id:e.getFieldID(e.schema),type:"submit",value:e.schema.buttonText,onClick:n[0]||(n[0]=(...s)=>i.onClick&&i.onClick(...s)),name:e.schema.inputName,disabled:e.disabled||null,class:t.normalizeClass(e.schema.fieldClasses)},null,10,Od)}const Ud=T({mixins:[A],methods:{onClick(e){if(this.schema.validateBeforeSubmit===!0){e.preventDefault();const n=N(this.formOptions,"validateAsync",!1),o=this.vfg.validate(),r=a=>{n&&!Ad(a)||!n&&!a?I(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,a,e):I(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)};o&&I(o.then)?o.then(r):r(o)}else I(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)}}},[["render",Fd]]),Dd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function Ld(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{class:t.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),id:e.getFieldID(e.schema),disabled:e.disabled||null,maxlength:e.schema.max,minlength:e.schema.min,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,rows:e.schema.rows||2,name:e.schema.inputName},null,10,Dd)),[[t.vModelText,e.value],[s,"input"]])}const oo=T({mixins:[A]},[["render",Ld]]),vd={class:"wrapper"},Pd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function qd(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",vd,[t.withDirectives(t.createElementVNode("input",{class:"form-control",id:e.getFieldID(e.schema),type:"file",name:e.schema.inputName,onChange:n[0]||(n[0]=(...l)=>i.onChange&&i.onChange(...l)),accept:e.schema.accept,multiple:e.schema.multiple,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,disabled:e.disabled||null},null,40,Pd),[[s,"input"]])])),[[s,"wrapper"]])}const Rd=T({mixins:[A],methods:{onChange(e){I(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,e,this)}}},[["render",qd]]),zd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function jd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text",value:e.value,autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,zd)}const xd=T({mixins:[A],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,le(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",jd]]),io={formatValueToField(e){if(e!=null){const n=this.schema.format?ne.parse(e,this.schema.format):new Date(e);return ne.format(n,this.getDateFormat())}return e},formatValueToModel(e){if(e!=null){const n=ne.parse(e,this.getDateFormat());this.schema.format?e=ne.format(n,this.schema.format):e=n.valueOf()}return e}},Kd={class:"input-group date"},Hd=["autocomplete","disabled","placeholder","readonly","name","id"],Yd=t.createElementVNode("span",{class:"input-group-addon"},[t.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function Gd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",Kd,[t.withDirectives(t.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Hd),[[t.vModelText,e.value]]),Yd])}const ro="YYYY-MM-DD HH:mm:ss",Wd={mixins:[A],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const e=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(le(this.schema.dateTimePickerOptions||{},{format:ro})).on("dp.change",()=>{this.value=e.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:ro},...io}},Zd=T(Wd,[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,debounce:"500",onFocus:n[1]||(n[1]=s=>i.geolocate()),id:e.getFieldID(e.schema)},null,40,Jd)),[[t.vModelText,e.value]])}const Qd=T({mixins:[A],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const e=this.autocomplete.getPlace();if(e){this.value=e.formatted_address;const n={};if(e.address_components!==void 0)for(let o=0;o<e.address_components.length;o++){const r=e.address_components[o].types[0];this.inputs[r]&&(n[r]=e.address_components[o][this.inputs[r]])}I(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,n,e,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{const n={lat:e.coords.latitude,lng:e.coords.longitude},o=new window.google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(o.getBounds())})}}},[["render",Xd]]),ec={class:"wrapper"},tc=["autocomplete","disabled","placeholder","readonly"],nc=["disabled","name"];function oc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",ec,[t.withDirectives(t.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>i.wrappedValue=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly},null,8,tc),[[t.vShow,e.schema.hideInput!==!0],[t.vModelText,i.wrappedValue]]),e.schema.browse!==!1?(t.openBlock(),t.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:e.disabled||null,onChange:n[1]||(n[1]=(...s)=>i.fileChanged&&i.fileChanged(...s)),name:e.schema.inputName},null,40,nc)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"preview",style:t.normalizeStyle(i.previewStyle)},[t.createElementVNode("div",{class:"remove",title:"Remove image",onClick:n[2]||(n[2]=(...s)=>i.remove&&i.remove(...s))})],4)])}const ic=T({mixins:[A],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(e){e&&e.indexOf("http")===0&&(this.value=e)}}},watch:{model:{deep:!0,handler(){const e=this.$el.querySelector("input.file");e&&(e.value="")}}},methods:{remove(){this.value=""},fileChanged(e){const n=new FileReader;n.onload=o=>{this.value=o.target.result},e.target.files&&e.target.files.length>0&&n.readAsDataURL(e.target.files[0])}}},[["render",oc]]),rc=["autocomplete","disabled","placeholder","readonly","name","id"];function ac(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,rc)),[[t.vModelText,e.value]])}const lc=T({mixins:[A],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",ac]]),sc={mixins:[A],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,le(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(e){Array.isArray(e)?this.value=[parseFloat(e[0]),parseFloat(e[1])]:this.value=parseFloat(e)},formatValueToField(e){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(e)},formatValueToModel(e){if(typeof this.slider.noUiSlider<"u")return e instanceof Array?[Number(e[0]),Number(e[1])]:Number(e)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},dc=["disabled"];function cc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["slider",{"contain-pips":i.containPips,"contain-tooltip":i.containTooltip}]),disabled:e.disabled||null},null,10,dc)}const mc=T(sc,[["render",cc]]),uc=["autocomplete","disabled","placeholder","readonly","name"];function hc(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName},null,8,uc)),[[t.vModelText,e.value]])}const pc="YYYY-MM-DD",fc={mixins:[A],data(){return{picker:null,options:null}},mounted(){this.initialize(N(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return N(this.schema,"pikadayOptions.format",pc)},...io,initialize(e){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=le({},e,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},gc=T(fc,[["render",hc]]),yc=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function bc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{type:"text",autocomplete:e.schema.autocomplete,"data-disable":e.disabled,"data-max":e.schema.max,"data-min":e.schema.min,"data-step":e.schema.step,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName},null,8,yc)}const _c=T({mixins:[A],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let e,n;Array.isArray(this.value)?[e,n]=this.value:e=this.value,this.slider&&this.slider.update({from:e,to:n})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let e,n;Array.isArray(this.value)?[e,n]=this.value:e=this.value;const o=this;$(this.$el).ionRangeSlider(le(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:e,to:n,onChange(r){o.slider.options.type==="double"?o.value=[r.from,r.to]:o.value=r.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",bc]]),wc=["disabled","multiple","title","name"],kc=["disabled","selected"],Cc=["value"];function Ec(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),disabled:e.disabled||null,multiple:e.schema.multiSelect,title:e.schema.placeholder,"data-width":"100%",name:e.schema.inputName},[e.schema.multiSelect!==!0?(t.openBlock(),t.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null,selected:e.value==null},null,8,kc)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,s=>(t.openBlock(),t.createElementBlock("option",{value:i.getItemValue(s)},t.toDisplayString(i.getItemName(s)),9,Cc))),256))],8,wc)),[[t.vModelSelect,e.value]])}const Sc=T({mixins:[A],computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(e){if(j(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return e[this.schema.selectOptions.value];if(typeof e.id<"u")return e.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e},getItemName(e){if(j(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return e[this.schema.selectOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e}}},[["render",Ec]]),Tc=["autocomplete","disabled","placeholder","readonly","name","id"];function $c(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{type:"text",autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Tc)}const Mc=T({mixins:[A],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(e){e?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(le(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:e=>{this.value=e?e.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",$c]]),Bc=["src"];function Nc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("img",{src:i.mapLink},null,8,Bc)}const Vc=T({mixins:[A],computed:{mapLink(){let e,n,o;if(this.value){const r=le(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});e=this.value[r.lat],n=this.value[r.lng],o=`http://maps.googleapis.com/maps/api/staticmap?center=${e},${n}&zoom=${r.zoom}&size=${r.sizeX}x${r.sizeY}`;const a=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const i of a)typeof r[i]<"u"&&(o+=`&${i}=${r[i]}`)}return o}}},[["render",Nc]]),Ic=["autocomplete","disabled","name","id"],Ac=["data-on","data-off","for"],Oc=t.createElementVNode("span",{class:"handle"},null,-1);function Fc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("label",null,[t.withDirectives(t.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Ic),[[t.vModelCheckbox,e.value]]),t.createElementVNode("span",{class:"label","data-on":e.schema.textOn||"On","data-off":e.schema.textOff||"Off",for:e.getFieldID(e.schema)},null,8,Ac),Oc])}const Uc=T({mixins:[A],methods:{formatValueToField(e){return e!=null&&this.schema.valueOn?e===this.schema.valueOn:e},formatValueToModel(e){return e!=null&&this.schema.valueOn?e?this.schema.valueOn:this.schema.valueOff:e}}},[["render",Fc]]),Dc={mixins:[A],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const r=e[o];n[r]=typeof this.value[r]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},Lc={key:0},vc={key:1},Pc=["id"],qc={key:0},Rc=["onUpdate:modelValue"],zc={key:1},jc=["onUpdate:modelValue"],xc={key:2},Kc=["onUpdate:modelValue"],Hc=["onClick"],Yc=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function Gc(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator"),l=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",null,[e.schema.schema?(t.openBlock(),t.createElementBlock("div",Lc,[t.createVNode(s,{model:e.value,options:e.formOptions,schema:e.schema.schema},null,8,["model","options","schema"])])):(t.openBlock(),t.createElementBlock("div",vc,[t.createElementVNode("table",{id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(d,c)=>(t.openBlock(),t.createElementBlock("tr",{key:c},[t.createElementVNode("td",null,t.toDisplayString(c),1),a.keyTypes[c]==="string"?(t.openBlock(),t.createElementBlock("td",qc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"text"},null,8,Rc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="boolean"?(t.openBlock(),t.createElementBlock("td",zc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"checkbox"},null,8,jc),[[t.vModelCheckbox,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="number"?(t.openBlock(),t.createElementBlock("td",xc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"number"},null,8,Kc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:m=>i.removeElement(c)},null,8,Hc)])]))),128))],10,Pc),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":n[0]||(n[0]=d=>a.newKeyType=d)},Yc,512),[[t.vModelSelect,a.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>a.newKeyName=d),type:"text"},null,512),[[t.vModelText,a.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:n[2]||(n[2]=(...d)=>i.addKey&&i.addKey(...d))})]))])),[[l,a.attributes]])}const ao=T(Dc,[["render",Gc]]),$e="24px",Et=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Wc=e=>(t.pushScopeId("data-v-1d2a8d30"),e=e(),t.popScopeId(),e),Zc=["aria-hidden"],Jc={key:0,"data-testid":"kui-icon-svg-title"},Xc=Wc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Qc=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Xc],8,Zc))]),_:1},8,["aria-hidden","style"]))}}),lo=Et(Qc,[["__scopeId","data-v-1d2a8d30"]]),em=e=>(t.pushScopeId("data-v-ddb48b32"),e=e(),t.popScopeId(),e),tm=["aria-hidden"],nm={key:0,"data-testid":"kui-icon-svg-title"},om=em(()=>t.createElementVNode("path",{d:"M5 13V11H19V13H5Z",fill:"currentColor"},null,-1)),im=t.defineComponent({__name:"RemoveIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon remove-icon","data-testid":"kui-icon-wrapper-remove-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-remove-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",nm,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),om],8,tm))]),_:1},8,["aria-hidden","style"]))}}),rm=Et(im,[["__scopeId","data-v-ddb48b32"]]),am=e=>(t.pushScopeId("data-v-b199fa56"),e=e(),t.popScopeId(),e),lm=["aria-hidden"],sm={key:0,"data-testid":"kui-icon-svg-title"},dm=am(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),cm=t.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",sm,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),dm],8,lm))]),_:1},8,["aria-hidden","style"]))}}),Pe=Et(cm,[["__scopeId","data-v-b199fa56"]]),mm={components:{TrashIcon:Pe},mixins:[A],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){const r={};return Object.keys(e).map(a=>{const i=a.indexOf(o+"-");if(i>-1&&Array.isArray(n))if(n.length>0){const l=a.split("-").filter(c=>n.find(m=>m.model===c)),d=a.split(`-${l}`)[0].split(`${o}-`)[1];l.length?r[d]={...r[d],[l]:e[a]}:r[a.substring(i+`${o}-`.length)]=e[a]}else r[a.substring(`${o}-`.length)]=e[a];else{const l=a.split("-").filter(c=>c===this.schema.model),d=a.split(`-${l}`)[0].split(`${o}-`)[1];d&&(r[d]=e[a])}return a}),r},addKey(){const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=this.subSchema?e?[""]:{}:"";this.value[this.newKeyName]=n,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},so=e=>(t.pushScopeId("data-v-b35063fd"),e=e(),t.popScopeId(),e),um=["id"],hm=["data-testid"],pm={class:"item-wrapper"},fm={class:"index-wrapper"},gm=so(()=>t.createElementVNode("hr",{class:"divider"},null,-1)),ym={key:0},bm={key:1},_m=["onUpdate:modelValue","placeholder","onInput"],wm={key:0,class:"hint"},km=so(()=>t.createElementVNode("hr",{class:"wide-divider"},null,-1)),Cm={class:"input-item"},Em=["placeholder"],Sm={key:0,class:"hint"};function Tm(e,n,o,r,a,i){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton"),d=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",{id:e.getFieldID(e.schema),class:t.normalizeClass(["object-advanced-wrapper",e.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,"data-testid":`field-object-key-${m}`},[t.createElementVNode("div",null,[t.createElementVNode("div",pm,[t.createElementVNode("div",fm,[t.createElementVNode("strong",null,t.toDisplayString(m),1),t.createElementVNode("div",null,[t.createVNode(l,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:p=>i.removeElement(m)},{default:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["onClick"])])]),gm,i.subSchema?(t.openBlock(),t.createElementBlock("div",ym,[t.createVNode(d,{model:i.transformedModel[m],options:{helpAsHtml:!0},schema:i.subSchema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",bm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":p=>e.value[m]=p,class:"form-control",placeholder:e.schema.fields&&e.schema.fields[0].schema.placeholder,type:"text",onInput:p=>i.updateModel(e.value[m],e.model[e.schema.model])},null,40,_m),[[t.vModelText,e.value[m]]]),e.schema.fields&&e.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(e.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0)])),km])])],8,hm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:i.hasObjectKeys}])},[t.createElementVNode("div",Cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>a.newKeyName=c),class:"form-control","data-testid":"keyname-input",placeholder:e.schema.placeholder,type:"text"},null,8,Em),[[t.vModelText,a.newKeyName]]),t.createVNode(l,{appearance:"tertiary","data-testid":"add-key",disabled:!a.newKeyName,onClick:i.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(e.schema.buttonLabel||e.schema.label),1)]),_:1},8,["disabled","onClick"])]),e.schema.hintText?(t.openBlock(),t.createElementBlock("p",Sm,t.toDisplayString(e.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,um)}const co=T(mm,[["render",Tm],["__scopeId","data-v-b35063fd"]]),$m={class:"array-item"},mo=T(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",$m,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Pe))]),_:1})])}}}),[["__scopeId","data-v-ec926551"]]),Mm=e=>(t.pushScopeId("data-v-27d212bd"),e=e(),t.popScopeId(),e),Bm={class:"multi-item-wrapper"},Nm=Mm(()=>t.createElementVNode("hr",null,null,-1)),uo=T(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Bm,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createTextVNode(" - Remove Field ")]),_:1}),Nm])}}}),[["__scopeId","data-v-27d212bd"]]),Vm={name:"FieldMetric",components:{AddIcon:lo,TrashIcon:Pe},mixins:[A],emits:["remove-item"],data(){return{contentVisible:!1}}},Im={key:0,class:"content"};function Am(e,n,o,r,a,i){const s=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),d=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:a.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=c=>a.contentVisible=!a.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(s,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[a.contentVisible?(t.openBlock(),t.createElementBlock("div",Im,[t.renderSlot(e.$slots,"default"),t.createVNode(d,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=c=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const ho=T(Vm,[["render",Am]]),ce="kong-ui-forms-api",Om="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function Fm(e){return e?e.length===36&&new RegExp(`^${Om}$`).test(e):!1}const St=50,_e={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function Um(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const Dm={mixins:[A],inject:[ce],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return Um(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ce]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[ce].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=De(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],r=this.getInputFields(),a=new Set;Fm(e)&&r.includes("id")?o.push((async()=>{const i=await this.fetchExact(e);n.push({...i,label:this.getSuggestionLabel(i),value:i.id})})()):o.push(...r.filter(i=>i!=="id").map(async i=>{(await this.fetchSuggestions(e,i)).forEach(l=>{a.has(l.id)||(a.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[ce])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<St;){const r=await this[ce].getAll(this.entity,{size:St,offset:o,...e});if(n.push(...r.data.data),o=r.data.offset,!o)break}return n.slice(0,St)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[ce]?(await this[ce].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Lm={class:"field-wrap autosuggest"},vm=["data-testid","data-testlabel"],Pm=["data-testid"],qm={class:"autosuggest__results_message"};function Rm(e,n,o,r,a,i){const s=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock("div",Lm,[t.createVNode(s,{id:e.schema.model,ref:"suggestion",modelValue:a.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>a.idValue=l),clearable:"","enable-filtering":"","filter-function":()=>!0,items:a.items,loading:a.loading,placeholder:e.schema.placeholder,width:"100%",onChange:i.onSelected,onQueryChange:i.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(i.getSuggestionLabel(l).split(" - ")[0]),9,vm),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.getSuggestionLabel(l).split(" - ").slice(1),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,class:"field-span","data-testid":l.id&&`${l.id}-${c+1}`||c+1},t.toDisplayString(d),9,Pm))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",qm,[t.createElementVNode("span",null,t.toDisplayString(a.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const po=T(Dm,[["render",Rm],["__scopeId","data-v-647bb712"]]),zm={class:"array-card-container"},fo=T(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null}},emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KCard"),a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",zm,[t.createVNode(r,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(a,{appearance:"tertiary",class:"array-card-remove-button",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Pe))]),_:1})])}}}),[["__scopeId","data-v-5fa27cb4"]]),jm={mixins:[A],emits:["model-updated"],methods:{updateModel(e){this.$emit("model-updated",e,this.schema.model)},checkOption(e){return this.model[this.schema.model]?e.value.toString()===this.model[this.schema.model].toString():e.checked},onChange(e){let n=e.target.value.split(",");this.schema.array||(n=n.toString()),this.updateModel(n)}}},xm={class:"selection-group"},Km={class:"form-group"},Hm=["id","checked","name","value"];function Ym(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",xm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(s,l)=>(t.openBlock(),t.createElementBlock("div",{key:l,class:"option-group"},[t.createElementVNode("div",Km,[t.createElementVNode("label",{class:t.normalizeClass(["k-label",s.name])},[t.createElementVNode("input",{id:e.schema.name+"-"+l,checked:i.checkOption(s),class:"k-input",name:e.schema.name,type:"radio",value:s.value,onChange:n[0]||(n[0]=(...d)=>i.onChange&&i.onChange(...d))},null,40,Hm),t.createTextVNode(" "+t.toDisplayString(s.name),1)],2)])]))),128))])}const go=T(jm,[["render",Ym],["__scopeId","data-v-7e49acd6"]]),Gm={name:"FieldArray",components:{FieldArrayItem:mo,FieldArrayMultiItem:uo,FieldSelect:no,FieldMetric:ho,FieldObject:ao,FieldObjectAdvanced:co,FieldAutoSuggest:po,FieldRadio:go,FieldArrayCardContainer:fo,FieldTextArea:oo,FieldInput:Yn},mixins:[A],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(e,n,o){var a,i,s;let r;return n&&(r=JSON.parse(JSON.stringify(n)),(s=(i=(a=r.schema)==null?void 0:a.fields)==null?void 0:i.map)==null||s.call(i,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...r,set(l,d){e[o]=d},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldType(e){return"field-"+e.type},modelUpdated(){}}},Wm=["id"],Zm={key:1},Jm=["onUpdate:modelValue","aria-labelledby","type"],Xm=["value","onClick"],Qm=["onUpdate:modelValue","aria-labelledby"],eu=["value","onClick"];function tu(e,n,o,r,a,i){const s=t.resolveComponent("FieldTextArea"),l=t.resolveComponent("KInput"),d=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onRemoveItem:p=>i.removeElement(m)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Zm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${m}`,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onRemoveItem:p=>i.removeElement(m)},{default:t.withCtx(()=>{var p;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(s,{key:0,"aria-labelledby":e.getLabelId(e.schema),class:"k-input","form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:1,modelValue:e.value[m],"onUpdate:modelValue":g=>e.value[m]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text"}),null,16,["modelValue","onUpdate:modelValue","aria-labelledby","type"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":g=>e.value[m]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((p=e.schema.inputAttributes)==null?void 0:p.type)||"text"}),null,16,Jm)),[[t.vModelDynamic,e.value[m]]]),e.schema.showRemoveButton?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:3,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||o.removeElementButtonLabel,onClick:g=>i.removeElement(m)}),null,16,Xm)):t.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:3,ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":p=>e.value[m]=p,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Qm)),[[t.vModelText,e.value[m]]]),e.schema.showRemoveButton?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:4,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||o.removeElementButtonLabel,onClick:p=>i.removeElement(m)}),null,16,eu)):t.createCommentVNode("",!0)],2))),128)),t.createVNode(d,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:i.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Wm)):t.createCommentVNode("",!0)}const nu=T(Gm,[["render",tu],["__scopeId","data-v-13233543"]]),ou={mixins:[A],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},iu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},ru={class:"material-icons"};function au(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",iu,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:n[0]||(n[0]=(...l)=>i.handleOpen&&i.handleOpen(...l))},[t.createElementVNode("i",ru,t.toDisplayString(a.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(i.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",i.openClass])},[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:e.schema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const lu=T(ou,[["render",au],["__scopeId","data-v-2d8e71e1"]]),su={mixins:[A],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(e,n){if(n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,r=this.schema.fields[n].fields;r&&r.forEach(a=>this.updateModel("",a.model)),o&&o.forEach(a=>this.updateModel(this.fieldModel[a.model],a.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{e.fields&&e.fields.forEach(o=>{this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},du={class:"selection-group"},cu={class:"form-group horizontal-radios"},mu={class:"radio-group"},uu=["value"],hu={class:"control-help"},pu={class:"option-field"},fu={class:"option-field-container"},gu={class:"form-group"},yu=["value"],bu={class:"control-help"},_u={class:"option-field"},wu={class:"option-field-container"};function ku(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",du,[e.schema.horizontalRadios?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",cu,[t.createElementVNode("div",mu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${l.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>a.checkedGroup=c),class:"k-input",type:"radio",value:d},null,8,uu),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",hu,t.toDisplayString(l.description),1)],2)]))),128))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.withDirectives(t.createElementVNode("div",pu,[t.createElementVNode("div",fu,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,l.fields&&a.checkedGroup===d]])]))),128))],64)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.createElementVNode("div",gu,[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${l.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=c=>a.checkedGroup=c),class:"k-input",type:"radio",value:d},null,8,yu),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",bu,t.toDisplayString(l.description),1)],2)]),t.withDirectives(t.createElementVNode("div",_u,[t.createElementVNode("div",wu,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,l.fields&&a.checkedGroup===d]])]))),128))])}const Cu=T(su,[["render",ku],["__scopeId","data-v-22882f4c"]]),Eu={mixins:[A],emits:["model-updated"],methods:{onUpdate(e){this.$emit("model-updated",e,this.schema.model)}}};function Su(e,n,o,r,a,i){const s=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(s,{"aria-labelledby":e.getLabelId(e.schema),"data-testid":"field-multiselect",items:e.schema.values,"label-attributes":{info:e.schema.help},"model-value":e.value,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%","onUpdate:modelValue":i.onUpdate},null,8,["aria-labelledby","items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Tu=T(Eu,[["render",Su]]),$u={name:"FieldKeyValuePairs",components:{TrashIcon:Pe},mixins:[A],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(r=>{this.pairs.push({key:r,value:e[r]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Mu={class:"key-value-pairs-editor"},Bu=["data-testid","placeholder","value","onInput"],Nu=["data-testid","placeholder","value","onInput"];function Vu(e,n,o,r,a,i){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Mu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.pairs,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:"pair-item"},[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${c}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:d.key,onInput:m=>{i.onInput(m,c,"key")}},null,40,Bu),t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${c}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:d.value,onInput:m=>{i.onInput(m,c,"value")}},null,40,Nu),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{i.removePair(c)}},{default:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:i.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Iu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:lu,FieldArray:nu,FieldArrayCardContainer:fo,FieldArrayItem:mo,FieldArrayMultiItem:uo,FieldAutoSuggest:po,FieldCheckbox:ps,FieldChecklist:Ts,FieldCleave:xd,FieldDateTimePicker:Zd,FieldGoogleAddress:Qd,FieldImage:ic,FieldInput:Yn,FieldKeyValuePairs:T($u,[["render",Vu],["__scopeId","data-v-29d15375"]]),FieldLabel:Bs,FieldMasked:lc,FieldMetric:ho,FieldMultiselect:Tu,FieldNoUiSlider:mc,FieldObject:ao,FieldObjectAdvanced:co,FieldPikaday:gc,FieldRadio:go,FieldRadios:As,FieldRangeSlider:_c,FieldSelect:no,FieldSelectEx:Sc,FieldSelectionGroup:Cu,FieldSpectrum:Mc,FieldStaticMap:Vc,FieldSubmit:Ud,FieldTextArea:oo,FieldUpload:Rd,fieldSwitch:Uc},Symbol.toStringTag,{value:"Module"})),mixins:[Gt],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:t.ref()}},methods:{fieldTypeHasLabel(e){if(R(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=N(this.options,"fieldIdPrefix","");return ft(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldType(e){return"field-"+e.type},getButtonType(e){return N(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return I(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},Au=e=>(t.pushScopeId("data-v-02e656fb"),e=e(),t.popScopeId(),e),Ou=["innerHTML"],Fu={class:"icon-wrapper"},Uu=["innerHTML"],Du={key:0,class:"link-wrapper"},Lu=Au(()=>t.createElementVNode("span",{class:"section-header"},"More info",-1)),vu={class:"field-wrap"},Pu={key:0,class:"buttons"},qu=["type","onClick","textContent"],Ru=["innerHTML"],zu={key:2,class:"errors help-block"},ju=["innerHTML"];function xu(e,n,o,r,a,i){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[i.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?i.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:i.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:i.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",Fu,[t.createElementVNode("span",{innerHTML:i.formattedLabel(o.field.label)},null,8,Uu)]),o.field.link?(t.openBlock(),t.createElementBlock("div",Du,[t.createVNode(s,{href:o.field.link},{default:t.withCtx(()=>[Lu]),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:o.field.help},null,8,Ou)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",vu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&i.getFieldType(o.field)==="field-input"?i.fieldHint(o.field):void 0,model:o.model,schema:o.field,vfg:o.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onValidated"])),i.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",Pu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(d,c)=>(t.openBlock(),t.createElementBlock("button",{key:c,class:t.normalizeClass(d.classes),type:i.getButtonType(d),onClick:m=>i.buttonClickHandler(d,o.field,m),textContent:t.toDisplayString(d.label)},null,10,qu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&i.getFieldType(o.field)!=="field-input"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hint",innerHTML:i.fieldHint(o.field)},null,8,Ru)):t.createCommentVNode("",!0),i.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",zu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fieldErrors(o.field),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,innerHTML:d},null,8,ju))),128))])):t.createCommentVNode("",!0)],2)}const Ku={name:"FormGenerator",components:{formGroup:T(Iu,[["render",xu],["__scopeId","data-v-02e656fb"]])},mixins:[Gt],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&H(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&H(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return I(e.visible)?e.visible.call(this,this.model,e,this):R(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(a=>a.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&H(n,a=>{this.errors.push({field:o.schema,error:a})});const r=this.errors.length===0;this.$emit("validated",r,this.errors,this)},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e=null){e===null&&(e=N(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];H(this.$refs.children,a=>{I(a.validate)&&(n.push(a.$refs.child),o.push(a.$refs.child.validate(!0)))});const r=a=>{const i=[];H(a,(l,d)=>{Array.isArray(l)&&l.length>0&&H(l,c=>{i.push({field:n[d].schema,error:c})})}),this.errors=i;const s=i.length===0;return this.$emit("validated",s,i,this),e?i:s};return e?Promise.all(o).then(r):r(o)},clearValidationErrors(){this.errors.splice(0),H(this.$refs.children,e=>{e.clearValidationErrors()})}}},Hu={key:0,class:"vue-form-generator"},Yu={key:0};function Gu(e,n,o,r,a,i){const s=t.resolveComponent("form-group"),l=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Hu,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fields,d=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:d.model},[i.fieldVisible(d)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:d,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.groups,(d,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${c}`},[d.collapsible!==void 0&&d.collapsible!==!1?(t.openBlock(),t.createBlock(l,{key:0,class:"root-level-collapse","model-value":!1,title:d.collapsible.title},t.createSlots({default:t.withCtx(()=>{var m,p,g,M;return[(m=d.slots)!=null&&m.beforeContent?t.renderSlot(e.$slots,(p=d.slots)==null?void 0:p.beforeContent,{key:0}):t.createCommentVNode("",!0),d.fields.length===0&&((g=d.slots)!=null&&g.emptyState)?t.renderSlot(e.$slots,(M=d.slots)==null?void 0:M.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.fields,B=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:B.model},[i.fieldVisible(B)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:B,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),d.collapsible!==!0&&d.collapsible.nestedCollapsible&&d.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(l,{key:3,class:"nested-collapse","model-value":a.collapseStates[`group-${c}-nested`]??!0,"trigger-alignment":"leading","trigger-label":a.collapseStates[`group-${c}-nested`]??!0?d.collapsible.nestedCollapsible.triggerLabel.expand:d.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":B=>a.collapseStates[`group-${c}-nested`]=B},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.collapsible.nestedCollapsible.fields,B=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:B.model},[i.fieldVisible(B)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:B,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[d.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[d.legend?(t.openBlock(),t.createElementBlock("legend",Yu,t.toDisplayString(d.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[i.fieldVisible(m)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:m,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=T(Ku,[["render",Gu]]),Wu={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},Zu={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},Ju={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},Xu={name:"OIDCForm",components:{VueFormGenerator:Y},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var n;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(o=>!o.model.startsWith("config")&&o.model!=="tags")},this.commonFieldsSchema={...Wu},this.authFieldsSchema={...Zu},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(o=>o.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(r=>r.model===o.model).length&&!this.authFieldsSchema.fields.filter(r=>r.model===o.model).length||o.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(o=>{const r=Ju.fields.find(a=>a.model===o.model);return r||o}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(o=>o.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const e={};for(const o of this.formSchema.fields)e[o.model]=o;for(const o of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of o.fields){const a=(n=e[r.model])==null?void 0:n.help;r.help===void 0&&typeof a=="string"&&(r.help=a)}},getAuthMethodsValue(e,n){const o=[];for(let r=0;r<this.authMethods.length;r++)this.authMethods[r].prop&&this.authMethods[r].value!==e&&o.push(this.authMethods[r].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Me=e=>(t.pushScopeId("data-v-e7395ff0"),e=e(),t.popScopeId(),e),Qu={class:"general-settings"},eh={class:"link-wrapper"},th=Me(()=>t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),nh=Me(()=>t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),oh={class:"auth-method-container"},ih={class:"general-settings"},rh={class:"link-wrapper"},ah=Me(()=>t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),lh=Me(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),sh={class:"general-settings"},dh={class:"link-wrapper"},ch=Me(()=>t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),mh=Me(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function uh(e,n,o,r,a,i){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KLabel"),c=t.resolveComponent("KCheckbox"),m=t.resolveComponent("KInputSwitch"),p=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(s,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:a.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(p,{tabs:a.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Qu,[t.createElementVNode("div",eh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:t.withCtx(()=>[th]),_:1})]),nh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(d,null,{default:t.withCtx(()=>[t.createTextVNode("Auth Methods")]),_:1}),t.createElementVNode("div",oh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.authMethods,g=>(t.openBlock(),t.createElementBlock("div",{key:g.value,class:"auth-method"},[t.createVNode(c,{modelValue:g.prop,"onUpdate:modelValue":M=>g.prop=M,onChange:M=>i.handleUpdate(M,g.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(g.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(m,{modelValue:a.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=g=>a.sessionManagement=g),label:"Enable Session Management",onChange:i.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",ih,[t.createElementVNode("div",rh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:t.withCtx(()=>[ah]),_:1})]),lh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.authFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",sh,[t.createElementVNode("div",dh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:t.withCtx(()=>[ch]),_:1})]),mh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.advancedFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const hh=T(Xu,[["render",uh],["__scopeId","data-v-e7395ff0"]]),Tt={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced_fields:"View Advanced Fields",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window&#39;s counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}}},ph=T(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const{t:n,te:o}=Qe.createI18n("en-us",Tt),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const s=r.formSchema;return s.fields.map(l=>{const d=`post-function.${l.model}`;return l.hint=o(`${d}.hint`)&&n(`${d}.hint`)||l.hint,l.help=o(`${d}.help`)&&n(`${d}.help`)||l.help,l.newElementButtonLabel=o(`${d}.newElementButtonLabel`)&&n(`${d}.newElementButtonLabel`)||l.newElementButtonLabel,l.model!=="tags"&&(l.valueType==="array"||l.type==="array")&&(l.type="array",l.valueArrayType="array",l.itemContainerComponent="FieldArrayItem",l.fieldClasses="post-function-array-item-container",l.fieldItemsClasses="post-function-array-item",l.inputAttributes={...l.inputAttributes,type:"textarea"}),l}),s});return(s,l)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-a0470d09"]]),fh=T(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const{t:n,te:o}=Qe.createI18n("en-us",Tt),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const s=r.formSchema;return s.fields.map(l=>{const d=`exit-transformer.${l.model}`;return l.hint=o(`${d}.hint`)&&n(`${d}.hint`)||l.hint,l.help=o(`${d}.help`)&&n(`${d}.help`)||l.help,l.newElementButtonLabel=o(`${d}.newElementButtonLabel`)&&n(`${d}.newElementButtonLabel`)||l.newElementButtonLabel,l.model!=="tags"&&(l.valueType==="array"||l.type==="array")&&(l.type="array",l.valueArrayType="array",l.itemContainerComponent="FieldArrayItem",l.fieldClasses="exit-transformer-array-item-container",l.fieldItemsClasses="exit-transformer-array-item",l.inputAttributes={...l.inputAttributes,type:"textarea"}),l}),s});return(s,l)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9d23f812"]]),gh={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},yh={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},bh={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},we=e=>(t.pushScopeId("data-v-136dc132"),e=e(),t.popScopeId(),e),_h={class:"general-settings"},wh=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),kh=we(()=>t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Ch=we(()=>t.createElementVNode("hr",null,null,-1)),Eh={class:"sub-form"},Sh={class:"general-settings"},Th=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),$h=we(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Mh={class:"sub-form"},Bh={class:"general-settings"},Nh=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),Vh=we(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),Ih=T(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const n=e,o=t.ref("zeroSsl"),r=t.ref("shm"),a=t.computed(()=>{var h;const y={};if((h=n.formSchema)!=null&&h.fields)for(const C of n.formSchema.fields)y[C.model]=C;return y}),i=t.computed(()=>{var h;const y=re(gh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),s=t.computed(()=>{var h;const y=re(yh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),l=t.computed(()=>{var h;const y=re(bh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),d=t.computed(()=>({fields:n.formSchema.fields.filter(y=>!y.model.startsWith("config")&&y.model!=="tags")})),c=t.computed(()=>({fields:i.value.fields.filter(h=>!s.value.fields.some(C=>C.model===h.model)&&!l.value.fields.some(C=>C.model===h.model))})),m=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage")&&!h.model.startsWith("config-storage_config-consul")&&!h.model.startsWith("config-storage_config-redis")&&!h.model.startsWith("config-storage_config-shm")&&!h.model.startsWith("config-storage_config-vault"))})),p=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-consul"))})),g=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-redis"))})),M=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-shm"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-vault"))})),_=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config")&&!c.value.fields.filter(h=>h.model===y.model).length&&!m.value.fields.filter(h=>h.model===y.model).length||y.model==="tags")})),k=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),f=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],w=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const O=y=>{o.value=y.value,(y.value==="zeroSsl"||y.value==="other")&&(y.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),y.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},F=(y,h)=>{h==="config-storage"&&(r.value=y),n.onModelUpdated()};return(y,h)=>{const C=t.resolveComponent("KSelect"),U=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:d.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(U,{tabs:f},{general:t.withCtx(()=>[t.createElementVNode("div",_h,[wh,kh,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),Ch,t.createVNode(C,{class:"issuer-select",items:w,label:"Issuer",onChange:O}),t.createElementVNode("div",Eh,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",Sh,[Th,$h,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:F},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",Mh,[r.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:p.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:g.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:M.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:B.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",Bh,[Nh,Vh,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:_.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-136dc132"]]),yo=e=>(t.pushScopeId("data-v-672119f6"),e=e(),t.popScopeId(),e),Ah={class:"rla-form-basic-fields"},Oh={class:"rla-form-request-limits-subtitle"},Fh={class:"rla-form-request-limits-content"},Uh={class:"rla-form-window-type"},Dh=["innerHTML"],Lh={class:"rla-form-window-type-radios"},vh={class:"rla-form-request-limits-items"},Ph={class:"rla-form-request-limits-row"},qh=["id"],Rh={class:"rla-form-request-limits-actions"},zh={key:0,class:"rla-form-request-limits-examples"},jh={class:"rla-form-request-limits-examples-badges"},xh=yo(()=>t.createElementVNode("br",null,null,-1)),Kh=["innerHTML"],Hh={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Yh=yo(()=>t.createElementVNode("div",null,":",-1)),Gh=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:Ih,ExitTransformer:fh,OIDCForm:hh,PostFunction:ph,RLAForm:T(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},isEditing:{type:Boolean}},setup(e){const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
1
+ (function(D,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(D=typeof globalThis<"u"?globalThis:D||self,t(D["kong-ui-public-forms"]={},D.Vue,D["kong-ui-public-i18n"]))})(this,function(D,t,Qe){"use strict";function Mt(e,n){for(var o=-1,r=e==null?0:e.length;++o<r&&n(e[o],o,e)!==!1;);return e}function _o(e){return function(n,o,r){for(var a=-1,i=Object(n),s=r(n),l=s.length;l--;){var d=s[e?l:++a];if(o(i[d],d,i)===!1)break}return n}}var wo=_o();const ko=wo;function Co(e,n){for(var o=-1,r=Array(e);++o<e;)r[o]=n(o);return r}var Bt=typeof global=="object"&&global&&global.Object===Object&&global,Eo=typeof self=="object"&&self&&self.Object===Object&&self,J=Bt||Eo||Function("return this")(),Q=J.Symbol,Nt=Object.prototype,So=Nt.hasOwnProperty,To=Nt.toString,Ne=Q?Q.toStringTag:void 0;function $o(e){var n=So.call(e,Ne),o=e[Ne];try{e[Ne]=void 0;var r=!0}catch{}var a=To.call(e);return r&&(n?e[Ne]=o:delete e[Ne]),a}var Mo=Object.prototype,Bo=Mo.toString;function No(e){return Bo.call(e)}var Vo="[object Null]",Io="[object Undefined]",Vt=Q?Q.toStringTag:void 0;function ae(e){return e==null?e===void 0?Io:Vo:Vt&&Vt in Object(e)?$o(e):No(e)}function ee(e){return e!=null&&typeof e=="object"}var Ao="[object Arguments]";function It(e){return ee(e)&&ae(e)==Ao}var At=Object.prototype,Oo=At.hasOwnProperty,Fo=At.propertyIsEnumerable,et=It(function(){return arguments}())?It:function(e){return ee(e)&&Oo.call(e,"callee")&&!Fo.call(e,"callee")},W=Array.isArray;function Uo(){return!1}var Ot=typeof D=="object"&&D&&!D.nodeType&&D,Ft=Ot&&typeof module=="object"&&module&&!module.nodeType&&module,Do=Ft&&Ft.exports===Ot,Ut=Do?J.Buffer:void 0,Lo=Ut?Ut.isBuffer:void 0,Ve=Lo||Uo,vo=9007199254740991,Po=/^(?:0|[1-9]\d*)$/;function tt(e,n){var o=typeof e;return n=n??vo,!!n&&(o=="number"||o!="symbol"&&Po.test(e))&&e>-1&&e%1==0&&e<n}var qo=9007199254740991;function nt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qo}var Ro="[object Arguments]",jo="[object Array]",zo="[object Boolean]",xo="[object Date]",Ko="[object Error]",Ho="[object Function]",Yo="[object Map]",Go="[object Number]",Wo="[object Object]",Zo="[object RegExp]",Jo="[object Set]",Xo="[object String]",Qo="[object WeakMap]",ei="[object ArrayBuffer]",ti="[object DataView]",ni="[object Float32Array]",oi="[object Float64Array]",ii="[object Int8Array]",ri="[object Int16Array]",ai="[object Int32Array]",li="[object Uint8Array]",si="[object Uint8ClampedArray]",di="[object Uint16Array]",ci="[object Uint32Array]",v={};v[ni]=v[oi]=v[ii]=v[ri]=v[ai]=v[li]=v[si]=v[di]=v[ci]=!0,v[Ro]=v[jo]=v[ei]=v[zo]=v[ti]=v[xo]=v[Ko]=v[Ho]=v[Yo]=v[Go]=v[Wo]=v[Zo]=v[Jo]=v[Xo]=v[Qo]=!1;function mi(e){return ee(e)&&nt(e.length)&&!!v[ae(e)]}function ot(e){return function(n){return e(n)}}var Dt=typeof D=="object"&&D&&!D.nodeType&&D,Ie=Dt&&typeof module=="object"&&module&&!module.nodeType&&module,ui=Ie&&Ie.exports===Dt,it=ui&&Bt.process,ke=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||it&&it.binding&&it.binding("util")}catch{}}(),Lt=ke&&ke.isTypedArray,rt=Lt?ot(Lt):mi,hi=Object.prototype,pi=hi.hasOwnProperty;function vt(e,n){var o=W(e),r=!o&&et(e),a=!o&&!r&&Ve(e),i=!o&&!r&&!a&&rt(e),s=o||r||a||i,l=s?Co(e.length,String):[],d=l.length;for(var c in e)(n||pi.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||tt(c,d)))&&l.push(c);return l}var fi=Object.prototype;function qe(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||fi;return e===o}function Pt(e,n){return function(o){return e(n(o))}}var gi=Pt(Object.keys,Object),yi=Object.prototype,bi=yi.hasOwnProperty;function qt(e){if(!qe(e))return gi(e);var n=[];for(var o in Object(e))bi.call(e,o)&&o!="constructor"&&n.push(o);return n}function z(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var _i="[object AsyncFunction]",wi="[object Function]",ki="[object GeneratorFunction]",Ci="[object Proxy]";function I(e){if(!z(e))return!1;var n=ae(e);return n==wi||n==ki||n==_i||n==Ci}function Ce(e){return e!=null&&nt(e.length)&&!I(e)}function Ee(e){return Ce(e)?vt(e):qt(e)}function Ei(e,n){return e&&ko(e,n,Ee)}function Si(e,n){return function(o,r){if(o==null)return o;if(!Ce(o))return e(o,r);for(var a=o.length,i=n?a:-1,s=Object(o);(n?i--:++i<a)&&r(s[i],i,s)!==!1;);return o}}var Ti=Si(Ei);const $i=Ti;function Re(e){return e}function Mi(e){return typeof e=="function"?e:Re}function H(e,n){var o=W(e)?Mt:$i;return o(e,Mi(n))}var Bi="[object Symbol]";function je(e){return typeof e=="symbol"||ee(e)&&ae(e)==Bi}var Ni=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vi=/^\w*$/;function at(e,n){if(W(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||je(e)?!0:Vi.test(e)||!Ni.test(e)||n!=null&&e in Object(n)}var lt=J["__core-js_shared__"],Rt=function(){var e=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ii(e){return!!Rt&&Rt in e}var Ai=Function.prototype,Oi=Ai.toString;function ue(e){if(e!=null){try{return Oi.call(e)}catch{}try{return e+""}catch{}}return""}var Fi=/[\\^$.*+?()[\]{}|]/g,Ui=/^\[object .+?Constructor\]$/,Di=Function.prototype,Li=Object.prototype,vi=Di.toString,Pi=Li.hasOwnProperty,qi=RegExp("^"+vi.call(Pi).replace(Fi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ri(e){if(!z(e)||Ii(e))return!1;var n=I(e)?qi:Ui;return n.test(ue(e))}function ji(e,n){return e==null?void 0:e[n]}function he(e,n){var o=ji(e,n);return Ri(o)?o:void 0}var Ae=he(Object,"create");function zi(){this.__data__=Ae?Ae(null):{},this.size=0}function xi(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Ki="__lodash_hash_undefined__",Hi=Object.prototype,Yi=Hi.hasOwnProperty;function Gi(e){var n=this.__data__;if(Ae){var o=n[e];return o===Ki?void 0:o}return Yi.call(n,e)?n[e]:void 0}var Wi=Object.prototype,Zi=Wi.hasOwnProperty;function Ji(e){var n=this.__data__;return Ae?n[e]!==void 0:Zi.call(n,e)}var Xi="__lodash_hash_undefined__";function Qi(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Ae&&n===void 0?Xi:n,this}function pe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}pe.prototype.clear=zi,pe.prototype.delete=xi,pe.prototype.get=Gi,pe.prototype.has=Ji,pe.prototype.set=Qi;function er(){this.__data__=[],this.size=0}function Oe(e,n){return e===n||e!==e&&n!==n}function ze(e,n){for(var o=e.length;o--;)if(Oe(e[o][0],n))return o;return-1}var tr=Array.prototype,nr=tr.splice;function or(e){var n=this.__data__,o=ze(n,e);if(o<0)return!1;var r=n.length-1;return o==r?n.pop():nr.call(n,o,1),--this.size,!0}function ir(e){var n=this.__data__,o=ze(n,e);return o<0?void 0:n[o][1]}function rr(e){return ze(this.__data__,e)>-1}function ar(e,n){var o=this.__data__,r=ze(o,e);return r<0?(++this.size,o.push([e,n])):o[r][1]=n,this}function oe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}oe.prototype.clear=er,oe.prototype.delete=or,oe.prototype.get=ir,oe.prototype.has=rr,oe.prototype.set=ar;var Fe=he(J,"Map");function lr(){this.size=0,this.__data__={hash:new pe,map:new(Fe||oe),string:new pe}}function sr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function xe(e,n){var o=e.__data__;return sr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function dr(e){var n=xe(this,e).delete(e);return this.size-=n?1:0,n}function cr(e){return xe(this,e).get(e)}function mr(e){return xe(this,e).has(e)}function ur(e,n){var o=xe(this,e),r=o.size;return o.set(e,n),this.size+=o.size==r?0:1,this}function ie(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}ie.prototype.clear=lr,ie.prototype.delete=dr,ie.prototype.get=cr,ie.prototype.has=mr,ie.prototype.set=ur;var hr="Expected a function";function st(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(hr);var o=function(){var r=arguments,a=n?n.apply(this,r):r[0],i=o.cache;if(i.has(a))return i.get(a);var s=e.apply(this,r);return o.cache=i.set(a,s)||i,s};return o.cache=new(st.Cache||ie),o}st.Cache=ie;var pr=500;function fr(e){var n=st(e,function(r){return o.size===pr&&o.clear(),r}),o=n.cache;return n}var gr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/\\(\\)?/g,br=fr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(gr,function(o,r,a,i){n.push(a?i.replace(yr,"$1"):r||o)}),n});function _r(e,n){for(var o=-1,r=e==null?0:e.length,a=Array(r);++o<r;)a[o]=n(e[o],o,e);return a}var wr=1/0,jt=Q?Q.prototype:void 0,zt=jt?jt.toString:void 0;function xt(e){if(typeof e=="string")return e;if(W(e))return _r(e,xt)+"";if(je(e))return zt?zt.call(e):"";var n=e+"";return n=="0"&&1/e==-wr?"-0":n}function Kt(e){return e==null?"":xt(e)}function Ht(e,n){return W(e)?e:at(e,n)?[e]:br(Kt(e))}var kr=1/0;function Ke(e){if(typeof e=="string"||je(e))return e;var n=e+"";return n=="0"&&1/e==-kr?"-0":n}function Yt(e,n){n=Ht(n,e);for(var o=0,r=n.length;e!=null&&o<r;)e=e[Ke(n[o++])];return o&&o==r?e:void 0}function N(e,n,o){var r=e==null?void 0:Yt(e,n);return r===void 0?o:r}function R(e){return e==null}var Cr="[object String]";function fe(e){return typeof e=="string"||!W(e)&&ee(e)&&ae(e)==Cr}const Gt={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[N(this.options,"validationErrorClass","error")]:n,[N(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?H(e.styleClasses,r=>o[r]=!0):fe(e.styleClasses)&&(o[e.styleClasses]=!0),R(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return I(e.disabled)?e.disabled.call(this,this.model,e,this):R(e.disabled)?!1:e.disabled},fieldReadonly(e){return I(e.readonly)?e.readonly.call(this,this.model,e,this):R(e.readonly)?!1:e.readonly},fieldFeatured(e){return I(e.featured)?e.featured.call(this,this.model,e,this):R(e.featured)?!1:e.featured},fieldRequired(e){return I(e.required)?e.required.call(this,this.model,e,this):R(e.required)?!1:e.required}}};function Er(){this.__data__=new oe,this.size=0}function Sr(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Tr(e){return this.__data__.get(e)}function $r(e){return this.__data__.has(e)}var Mr=200;function Br(e,n){var o=this.__data__;if(o instanceof oe){var r=o.__data__;if(!Fe||r.length<Mr-1)return r.push([e,n]),this.size=++o.size,this;o=this.__data__=new ie(r)}return o.set(e,n),this.size=o.size,this}function te(e){var n=this.__data__=new oe(e);this.size=n.size}te.prototype.clear=Er,te.prototype.delete=Sr,te.prototype.get=Tr,te.prototype.has=$r,te.prototype.set=Br;var He=function(){try{var e=he(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Wt(e,n,o){n=="__proto__"&&He?He(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Nr=Object.prototype,Vr=Nr.hasOwnProperty;function Zt(e,n,o){var r=e[n];(!(Vr.call(e,n)&&Oe(r,o))||o===void 0&&!(n in e))&&Wt(e,n,o)}function Ye(e,n,o,r){var a=!o;o||(o={});for(var i=-1,s=n.length;++i<s;){var l=n[i],d=r?r(o[l],e[l],l,o,e):void 0;d===void 0&&(d=e[l]),a?Wt(o,l,d):Zt(o,l,d)}return o}function Ir(e,n){return e&&Ye(n,Ee(n),e)}function Ar(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Or=Object.prototype,Fr=Or.hasOwnProperty;function Ur(e){if(!z(e))return Ar(e);var n=qe(e),o=[];for(var r in e)r=="constructor"&&(n||!Fr.call(e,r))||o.push(r);return o}function Ge(e){return Ce(e)?vt(e,!0):Ur(e)}function Dr(e,n){return e&&Ye(n,Ge(n),e)}var Jt=typeof D=="object"&&D&&!D.nodeType&&D,Xt=Jt&&typeof module=="object"&&module&&!module.nodeType&&module,Lr=Xt&&Xt.exports===Jt,Qt=Lr?J.Buffer:void 0,en=Qt?Qt.allocUnsafe:void 0;function vr(e,n){if(n)return e.slice();var o=e.length,r=en?en(o):new e.constructor(o);return e.copy(r),r}function Pr(e,n){var o=-1,r=e.length;for(n||(n=Array(r));++o<r;)n[o]=e[o];return n}function qr(e,n){for(var o=-1,r=e==null?0:e.length,a=0,i=[];++o<r;){var s=e[o];n(s,o,e)&&(i[a++]=s)}return i}function tn(){return[]}var Rr=Object.prototype,jr=Rr.propertyIsEnumerable,nn=Object.getOwnPropertySymbols,dt=nn?function(e){return e==null?[]:(e=Object(e),qr(nn(e),function(n){return jr.call(e,n)}))}:tn;function zr(e,n){return Ye(e,dt(e),n)}function on(e,n){for(var o=-1,r=n.length,a=e.length;++o<r;)e[a+o]=n[o];return e}var xr=Pt(Object.getPrototypeOf,Object);const rn=xr;var Kr=Object.getOwnPropertySymbols,an=Kr?function(e){for(var n=[];e;)on(n,dt(e)),e=rn(e);return n}:tn;function Hr(e,n){return Ye(e,an(e),n)}function ln(e,n,o){var r=n(e);return W(e)?r:on(r,o(e))}function ct(e){return ln(e,Ee,dt)}function Yr(e){return ln(e,Ge,an)}var mt=he(J,"DataView"),ut=he(J,"Promise"),Se=he(J,"Set"),ht=he(J,"WeakMap"),sn="[object Map]",Gr="[object Object]",dn="[object Promise]",cn="[object Set]",mn="[object WeakMap]",un="[object DataView]",Wr=ue(mt),Zr=ue(Fe),Jr=ue(ut),Xr=ue(Se),Qr=ue(ht),ge=ae;(mt&&ge(new mt(new ArrayBuffer(1)))!=un||Fe&&ge(new Fe)!=sn||ut&&ge(ut.resolve())!=dn||Se&&ge(new Se)!=cn||ht&&ge(new ht)!=mn)&&(ge=function(e){var n=ae(e),o=n==Gr?e.constructor:void 0,r=o?ue(o):"";if(r)switch(r){case Wr:return un;case Zr:return sn;case Jr:return dn;case Xr:return cn;case Qr:return mn}return n});const Te=ge;var ea=Object.prototype,ta=ea.hasOwnProperty;function na(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&ta.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var We=J.Uint8Array;function pt(e){var n=new e.constructor(e.byteLength);return new We(n).set(new We(e)),n}function oa(e,n){var o=n?pt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ia=/\w*$/;function ra(e){var n=new e.constructor(e.source,ia.exec(e));return n.lastIndex=e.lastIndex,n}var hn=Q?Q.prototype:void 0,pn=hn?hn.valueOf:void 0;function aa(e){return pn?Object(pn.call(e)):{}}function la(e,n){var o=n?pt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var sa="[object Boolean]",da="[object Date]",ca="[object Map]",ma="[object Number]",ua="[object RegExp]",ha="[object Set]",pa="[object String]",fa="[object Symbol]",ga="[object ArrayBuffer]",ya="[object DataView]",ba="[object Float32Array]",_a="[object Float64Array]",wa="[object Int8Array]",ka="[object Int16Array]",Ca="[object Int32Array]",Ea="[object Uint8Array]",Sa="[object Uint8ClampedArray]",Ta="[object Uint16Array]",$a="[object Uint32Array]";function Ma(e,n,o){var r=e.constructor;switch(n){case ga:return pt(e);case sa:case da:return new r(+e);case ya:return oa(e,o);case ba:case _a:case wa:case ka:case Ca:case Ea:case Sa:case Ta:case $a:return la(e,o);case ca:return new r;case ma:case pa:return new r(e);case ua:return ra(e);case ha:return new r;case fa:return aa(e)}}var fn=Object.create,Ba=function(){function e(){}return function(n){if(!z(n))return{};if(fn)return fn(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Na(e){return typeof e.constructor=="function"&&!qe(e)?Ba(rn(e)):{}}var Va="[object Map]";function Ia(e){return ee(e)&&Te(e)==Va}var gn=ke&&ke.isMap,Aa=gn?ot(gn):Ia,Oa="[object Set]";function Fa(e){return ee(e)&&Te(e)==Oa}var yn=ke&&ke.isSet,Ua=yn?ot(yn):Fa,Da=1,La=2,va=4,bn="[object Arguments]",Pa="[object Array]",qa="[object Boolean]",Ra="[object Date]",ja="[object Error]",_n="[object Function]",za="[object GeneratorFunction]",xa="[object Map]",Ka="[object Number]",wn="[object Object]",Ha="[object RegExp]",Ya="[object Set]",Ga="[object String]",Wa="[object Symbol]",Za="[object WeakMap]",Ja="[object ArrayBuffer]",Xa="[object DataView]",Qa="[object Float32Array]",el="[object Float64Array]",tl="[object Int8Array]",nl="[object Int16Array]",ol="[object Int32Array]",il="[object Uint8Array]",rl="[object Uint8ClampedArray]",al="[object Uint16Array]",ll="[object Uint32Array]",L={};L[bn]=L[Pa]=L[Ja]=L[Xa]=L[qa]=L[Ra]=L[Qa]=L[el]=L[tl]=L[nl]=L[ol]=L[xa]=L[Ka]=L[wn]=L[Ha]=L[Ya]=L[Ga]=L[Wa]=L[il]=L[rl]=L[al]=L[ll]=!0,L[ja]=L[_n]=L[Za]=!1;function Ue(e,n,o,r,a,i){var s,l=n&Da,d=n&La,c=n&va;if(o&&(s=a?o(e,r,a,i):o(e)),s!==void 0)return s;if(!z(e))return e;var m=W(e);if(m){if(s=na(e),!l)return Pr(e,s)}else{var p=Te(e),g=p==_n||p==za;if(Ve(e))return vr(e,l);if(p==wn||p==bn||g&&!a){if(s=d||g?{}:Na(e),!l)return d?Hr(e,Dr(s,e)):zr(e,Ir(s,e))}else{if(!L[p])return a?e:{};s=Ma(e,p,l)}}i||(i=new te);var M=i.get(e);if(M)return M;i.set(e,s),Ua(e)?e.forEach(function(k){s.add(Ue(k,n,o,k,e,i))}):Aa(e)&&e.forEach(function(k,f){s.set(f,Ue(k,n,o,f,e,i))});var B=c?d?Yr:ct:d?Ge:Ee,_=m?void 0:B(e);return Mt(_||e,function(k,f){_&&(f=k,k=e[f]),Zt(s,f,Ue(k,n,o,f,e,i))}),s}var sl=1,dl=4;function re(e){return Ue(e,sl|dl)}const ft=(e,n="")=>typeof e.id<"u"?n+e.id:n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),kn=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var gt=function(){return J.Date.now()},cl=/\s/;function ml(e){for(var n=e.length;n--&&cl.test(e.charAt(n)););return n}var ul=/^\s+/;function hl(e){return e&&e.slice(0,ml(e)+1).replace(ul,"")}var Cn=NaN,pl=/^[-+]0x[0-9a-f]+$/i,fl=/^0b[01]+$/i,gl=/^0o[0-7]+$/i,yl=parseInt;function yt(e){if(typeof e=="number")return e;if(je(e))return Cn;if(z(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=z(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=hl(e);var o=fl.test(e);return o||gl.test(e)?yl(e.slice(2),o?2:8):pl.test(e)?Cn:+e}var bl="Expected a function",_l=Math.max,wl=Math.min;function De(e,n,o){var r,a,i,s,l,d,c=0,m=!1,p=!1,g=!0;if(typeof e!="function")throw new TypeError(bl);n=yt(n)||0,z(o)&&(m=!!o.leading,p="maxWait"in o,i=p?_l(yt(o.maxWait)||0,n):i,g="trailing"in o?!!o.trailing:g);function M(h){var C=r,U=a;return r=a=void 0,c=h,s=e.apply(U,C),s}function B(h){return c=h,l=setTimeout(f,n),m?M(h):s}function _(h){var C=h-d,U=h-c,u=n-C;return p?wl(u,i-U):u}function k(h){var C=h-d,U=h-c;return d===void 0||C>=n||C<0||p&&U>=i}function f(){var h=gt();if(k(h))return w(h);l=setTimeout(f,_(h))}function w(h){return l=void 0,g&&r?M(h):(r=a=void 0,s)}function O(){l!==void 0&&clearTimeout(l),c=0,r=d=a=l=void 0}function F(){return l===void 0?s:w(gt())}function y(){var h=gt(),C=k(h);if(r=arguments,a=this,d=h,C){if(l===void 0)return B(d);if(p)return clearTimeout(l),l=setTimeout(f,n),M(d)}return l===void 0&&(l=setTimeout(f,n)),s}return y.cancel=O,y.flush=F,y}var kl="__lodash_hash_undefined__";function Cl(e){return this.__data__.set(e,kl),this}function El(e){return this.__data__.has(e)}function Le(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new ie;++n<o;)this.add(e[n])}Le.prototype.add=Le.prototype.push=Cl,Le.prototype.has=El;function En(e,n,o,r){for(var a=e.length,i=o+(r?1:-1);r?i--:++i<a;)if(n(e[i],i,e))return i;return-1}function Sl(e){return e!==e}function Tl(e,n,o){for(var r=o-1,a=e.length;++r<a;)if(e[r]===n)return r;return-1}function $l(e,n,o){return n===n?Tl(e,n,o):En(e,Sl,o)}function Ml(e,n){var o=e==null?0:e.length;return!!o&&$l(e,n,0)>-1}function Bl(e,n,o){for(var r=-1,a=e==null?0:e.length;++r<a;)if(o(n,e[r]))return!0;return!1}function Sn(e,n){return e.has(n)}function Nl(){}function bt(e){var n=-1,o=Array(e.size);return e.forEach(function(r){o[++n]=r}),o}var Vl=1/0,Il=Se&&1/bt(new Se([,-0]))[1]==Vl?function(e){return new Se(e)}:Nl,Al=200;function Ol(e,n,o){var r=-1,a=Ml,i=e.length,s=!0,l=[],d=l;if(o)s=!1,a=Bl;else if(i>=Al){var c=n?null:Il(e);if(c)return bt(c);s=!1,a=Sn,d=new Le}else d=n?[]:l;e:for(;++r<i;){var m=e[r],p=n?n(m):m;if(m=o||m!==0?m:0,s&&p===p){for(var g=d.length;g--;)if(d[g]===p)continue e;n&&d.push(p),l.push(m)}else a(d,p,o)||(d!==l&&d.push(p),l.push(m))}return l}function Tn(e){return e&&e.length?Ol(e):[]}var Fl=0;function $n(e){var n=++Fl;return Kt(e)+n}function Ul(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var Mn=Math.max;function Dl(e,n,o){return n=Mn(n===void 0?e.length-1:n,0),function(){for(var r=arguments,a=-1,i=Mn(r.length-n,0),s=Array(i);++a<i;)s[a]=r[n+a];a=-1;for(var l=Array(n+1);++a<n;)l[a]=r[a];return l[n]=o(s),Ul(e,this,l)}}function Ll(e){return function(){return e}}var vl=He?function(e,n){return He(e,"toString",{configurable:!0,enumerable:!1,value:Ll(n),writable:!0})}:Re;const Pl=vl;var ql=800,Rl=16,jl=Date.now;function zl(e){var n=0,o=0;return function(){var r=jl(),a=Rl-(r-o);if(o=r,a>0){if(++n>=ql)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var xl=zl(Pl);function Kl(e,n){return xl(Dl(e,n,Re),e+"")}function Hl(e,n,o){if(!z(o))return!1;var r=typeof n;return(r=="number"?Ce(o)&&tt(n,o.length):r=="string"&&n in o)?Oe(o[n],e):!1}var Bn=Object.prototype,Yl=Bn.hasOwnProperty,le=Kl(function(e,n){e=Object(e);var o=-1,r=n.length,a=r>2?n[2]:void 0;for(a&&Hl(n[0],n[1],a)&&(r=1);++o<r;)for(var i=n[o],s=Ge(i),l=-1,d=s.length;++l<d;){var c=s[l],m=e[c];(m===void 0||Oe(m,Bn[c])&&!Yl.call(e,c))&&(e[c]=i[c])}return e}),Gl=J.isFinite;function Wl(e){return typeof e=="number"&&Gl(e)}var Nn=1/0,Zl=17976931348623157e292;function Jl(e){if(!e)return e===0?e:0;if(e=yt(e),e===Nn||e===-Nn){var n=e<0?-1:1;return n*Zl}return e===e?e:0}function Vn(e){var n=Jl(e),o=n%1;return n===n?o?n-o:n:0}function Xl(e){return typeof e=="number"&&e==Vn(e)}var Ql="[object Number]";function _t(e){return typeof e=="number"||ee(e)&&ae(e)==Ql}var In=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,se="\\d\\d?",de="\\d\\d",es="\\d{3}",ts="\\d{4}",ve="[^\\s]+",An=/\[([^]*?)\]/gm;function On(e,n){for(var o=[],r=0,a=e.length;r<a;r++)o.push(e[r].substr(0,n));return o}var Fn=function(e){return function(n,o){var r=o[e].map(function(i){return i.toLowerCase()}),a=r.indexOf(n.toLowerCase());return a>-1?a:null}};function ye(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var r=0,a=n;r<a.length;r++){var i=a[r];for(var s in i)e[s]=i[s]}return e}var Un=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Dn=["January","February","March","April","May","June","July","August","September","October","November","December"],ns=On(Dn,3),os=On(Un,3),Ln={dayNamesShort:os,dayNames:Un,monthNamesShort:ns,monthNames:Dn,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Ze=ye({},Ln),is=function(e){return Ze=ye(Ze,e)},vn=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},G=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},rs={D:function(e){return String(e.getDate())},DD:function(e){return G(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return G(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return G(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return G(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return G(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return G(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return G(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return G(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return G(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return G(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return G(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+G(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+G(Math.floor(Math.abs(n)/60),2)+":"+G(Math.abs(n)%60,2)}},Pn=function(e){return+e-1},qn=[null,se],Rn=[null,ve],jn=["isPm",ve,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],zn=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],as={D:["day",se],DD:["day",de],Do:["day",se+ve,function(e){return parseInt(e,10)}],M:["month",se,Pn],MM:["month",de,Pn],YY:["year",de,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",se,void 0,"isPm"],hh:["hour",de,void 0,"isPm"],H:["hour",se],HH:["hour",de],m:["minute",se],mm:["minute",de],s:["second",se],ss:["second",de],YYYY:["year",ts],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",de,function(e){return+e*10}],SSS:["millisecond",es],d:qn,dd:qn,ddd:Rn,dddd:Rn,MMM:["month",ve,Fn("monthNamesShort")],MMMM:["month",ve,Fn("monthNames")],a:jn,A:jn,ZZ:zn,Z:zn},Je={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ls=function(e){return ye(Je,e)},ss=function(e,n,o){if(n===void 0&&(n=Je.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=Je[n]||n;var r=[];n=n.replace(An,function(i,s){return r.push(s),"@@@"});var a=ye(ye({},Ze),o);return n=n.replace(In,function(i){return rs[i](e,a)}),n.replace(/@@@/g,function(){return r.shift()})};function ds(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=Je[n]||n,e.length>1e3)return null;var r=new Date,a={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],s=[],l=n.replace(An,function(F,y){return s.push(vn(y)),"@@@"}),d={},c={};l=vn(l).replace(In,function(F){var y=as[F],h=y[0],C=y[1],U=y[3];if(d[h])throw new Error("Invalid format. "+h+" specified twice in format");return d[h]=!0,U&&(c[U]=!0),i.push(y),"("+C+")"}),Object.keys(c).forEach(function(F){if(!d[F])throw new Error("Invalid format. "+F+" is required in specified format")}),l=l.replace(/@@@/g,function(){return s.shift()});var m=e.match(new RegExp(l,"i"));if(!m)return null;for(var p=ye(ye({},Ze),o),g=1;g<m.length;g++){var M=i[g-1],B=M[0],_=M[2],k=_?_(m[g],p):+m[g];if(k==null)return null;a[B]=k}a.isPm===1&&a.hour!=null&&+a.hour!=12?a.hour=+a.hour+12:a.isPm===0&&+a.hour==12&&(a.hour=0);var f;if(a.timezoneOffset==null){f=new Date(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond);for(var w=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],g=0,O=w.length;g<O;g++)if(d[w[g][0]]&&a[w[g][0]]!==f[w[g][1]]())return null}else if(f=new Date(Date.UTC(a.year,a.month,a.day,a.hour,a.minute-a.timezoneOffset,a.second,a.millisecond)),a.month>11||a.month<0||a.day>31||a.day<1||a.hour>23||a.hour<0||a.minute>59||a.minute<0||a.second>59||a.second<0)return null;return f}var ne={format:ss,parse:ds,defaultI18n:Ln,setGlobalDateI18n:is,setGlobalDateMasks:ls};const K={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function X(e,n,o=K){return R(e)||e===""?n?[q(o.fieldIsRequired)]:[]:null}function q(e,...n){if(e!=null&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",n[o]);return e}const be={resources:K,required(e,n,o,r=K){return X(e,n.required,r)},number(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=[];return Wl(e)?(!R(n.min)&&e<n.min&&i.push(q(r.numberTooSmall,n.min)),!R(n.max)&&e>n.max&&i.push(q(r.numberTooBig,n.max))):i.push(q(r.invalidNumber)),i},integer(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=be.number(e,n,o,r);return Xl(e)||i.push(q(r.invalidInteger)),i},double(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!_t(e)||isNaN(e))return[q(r.invalidNumber)]},string(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=[];return fe(e)?(!R(n.min)&&e.length<n.min&&i.push(q(r.textTooSmall,e.length,n.min)),!R(n.max)&&e.length>n.max&&i.push(q(r.textTooBig,e.length,n.max))):i.push(q(r.thisNotText)),i},array(e,n,o,r=K){if(n.required){if(!Array.isArray(e))return[q(r.thisNotArray)];if(e.length===0)return[q(r.fieldIsRequired)]}if(!R(e)){if(!R(n.min)&&e.length<n.min)return[q(r.selectMinItems,n.min)];if(!R(n.max)&&e.length>n.max)return[q(r.selectMaxItems,n.max)]}},date(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=new Date(e);if(isNaN(i.getDate()))return[q(r.invalidDate)];const s=[];if(!R(n.min)){const l=new Date(n.min);i.valueOf()<l.valueOf()&&s.push(q(r.dateIsEarly,ne.format(i),ne.format(l)))}if(!R(n.max)){const l=new Date(n.max);i.valueOf()>l.valueOf()&&s.push(q(r.dateIsLate,ne.format(i),ne.format(l)))}return s},regexp(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!R(n.pattern)&&!new RegExp(n.pattern).test(e))return[q(r.invalidFormat)]},email(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e))return[q(r.invalidEmail)]},url(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e))return[q(r.invalidURL)]},creditCard(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;const i=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,s=e.replace(/[^0-9]+/g,"");if(!i.test(s))return[q(r.invalidCard)];let l=0,d,c,m;for(let p=s.length-1;p>=0;p--)d=s.substring(p,p+1),c=parseInt(d,10),m?(c*=2,c>=10?l+=c%10+1:l+=c):l+=c,m=!m;if(!(l%10===0&&s))return[q(r.invalidCardNumber)]},alpha(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^[a-zA-Z]*$/.test(e))return[q(r.invalidTextContainNumber)]},alphaNumeric(e,n,o,r=K){const a=X(e,n.required,r);if(a!=null)return a;if(!/^[a-zA-Z0-9]*$/.test(e))return[q(r.invalidTextContainSpec)]}};Object.keys(be).forEach(e=>{const n=be[e];I(n)&&(n.locale=o=>(r,a,i)=>n(r,a,i,le(o,K)))});function xn(e){return fe(e)?be[e]!=null?be[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function wt(e,n,o){let r=N(o.context,"schema.attributes",{});const a=n.value||"input";fe(a)&&(r=N(r,a)||r),H(r,(i,s)=>{e.setAttribute(s,i)})}const A={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:wt,updated:wt,componentUpdated:wt}},computed:{value:{cache:!1,get(){let e;return I(N(this.schema,"get"))?e=this.schema.get(this.model):e=N(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),I(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=N(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const a=[];Array.isArray(this.schema.validator)?H(this.schema.validator,i=>{a.push(xn(i).bind(this))}):a.push(xn(this.schema.validator).bind(this)),H(a,i=>{if(n)o.push(i(this.value,this.schema,this.model));else{const s=i(this.value,this.schema,this.model);s&&I(s.then)?s.then(l=>{l&&(this.errors=this.errors.concat(l));const d=this.errors.length===0;this.$emit("validated",d,this.errors,this)}):s&&(o=o.concat(s))}})}const r=a=>{let i=[];H(Tn(a),l=>{Array.isArray(l)&&l.length>0?i=i.concat(l):fe(l)&&i.push(l)}),I(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,i,this.schema);const s=i.length===0;return e||this.$emit("validated",s,i,this),this.errors=i,i};return n?Promise.all(o).then(r):r(o)},debouncedValidate(){I(this.debouncedValidateFunc)||(this.debouncedValidateFunc=De(this.validate.bind(this),N(this.schema,"validateDebounceTime",N(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;I(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),I(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),N(this.formOptions,"validateAfterChanged",!1)===!0&&(N(this.schema,"validateDebounceTime",N(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let r=this.model;const a=o.split(".");let i=0;const s=a.length;for(;i<s;){const l=a[i];if(i<s-1)r[l]!==void 0||(r[l]={}),r=r[l];else{r[l]=n;return}++i}},getFieldID(e,n=!1){const o=N(this.formOptions,"fieldIdPrefix","");return ft(e,o)+(n?"-"+$n():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return N(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},cs=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),ms={mixins:[A]},us=["id","autocomplete","disabled","name","required"];function hs(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("input",{id:e.getFieldID(e.schema),type:"checkbox","onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,class:t.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,us)),[[t.vModelCheckbox,e.value],[s,"input"]])}const T=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ps=T(ms,[["render",hs]]);var fs=4;function Kn(e){return Ue(e,fs)}const gs={class:"wrapper"},ys=["disabled"],bs=["id","checked","disabled","onChange","name"],_s=["disabled"],ws={class:"info"},ks=t.createElementVNode("div",{class:"arrow"},null,-1),Cs={class:"dropList"},Es=["id","checked","disabled","onChange","name"];function Ss(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",gs,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,bs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256))],8,ys)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:a.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>i.onExpandCombo&&i.onExpandCombo(...l))},[t.createElementVNode("div",ws,t.toDisplayString(i.selectedCount)+" selected",1),ks],2),t.createElementVNode("div",Cs,[a.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,Es),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,_s))])),[[s,"wrapper"]])}const Ts=T({mixins:[A],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?kn(this.schema.inputName+"_"+this.getItemValue(e)):kn(this.getItemValue(e))},getItemValue(e){if(z(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(z(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((R(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=Kn(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=Kn(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Ss]]);function $s(e){const n=t.ref([]),o=t.ref(null),r=_=>fe(_)?be[_]!=null?be[_]:(console.warn(`'${_}' is not a validator function!`),null):_,a=t.computed({get(){var k,f;let _;return I(N(e.schema,"get"))?_=e.schema.get((k=e.model)==null?void 0:k.value):_=N((f=e.model)==null?void 0:f.value,e.schema.model),M(_)},set(_){const k=a;_=B(_),I(_)?_(_,k):l(_,k)}}),i=_=>{var F;d();const k=(F=e.schema)==null?void 0:F.validator,f=N(e.formOptions,"validateAsync",!1);let w=[];if(k&&e.schema.readonly!==!0&&e.disabled!==!0){const y=[];Array.isArray(k)?H(k,h=>{y.push(r(h))}):y.push(r(k)),H(y,h=>{var C,U;if(f)w.push(h(a.value,e.schema,(C=e.model)==null?void 0:C.value));else{const u=h(a.value,e.schema,(U=e.model)==null?void 0:U.value);u&&I(u.then)?u.then(b=>{b&&(n.value=n.value.concat(b));const E=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:E,errors:n.value,field:e.schema})}):u&&(w=w.concat(u))}})}const O=y=>{var C,U;let h=[];if(H(Tn(y),u=>{Array.isArray(u)&&u.length>0?h=h.concat(u):fe(u)&&h.push(u)}),I((C=e.schema)==null?void 0:C.onValidated)&&e.schema.onValidated((U=e.model)==null?void 0:U.value,h,e.schema),!_){const u=h.length===0;e.emitValidated&&e.emitValidated({isValid:u,errors:h,field:e.schema})}return y=h,h};return f?Promise.all(w).then(O):O(w)},s=()=>{I(o.value)?o.value():o.value=De(i,N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",500)))},l=(_,k)=>{var w,O,F;let f=!1;I(e.schema.set)?(e.schema.set((w=e.model)==null?void 0:w.value,_),f=!0):e.schema.model&&(c(e.schema.model,_),f=!0),f&&(e.emitModelUpdated&&((O=e.model)!=null&&O.value)&&e.emitModelUpdated({value:_,model:e.schema.model}),I(e.schema.onChanged)&&e.schema.onChanged((F=e.model)==null?void 0:F.value,_,k,e.schema),N(e.formOptions,"validateAfterChanged",!1)===!0&&(N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",0))>0?s():i()))},d=()=>{n.value.splice(0)},c=(_,k)=>{var h;let f=_.replace(/\[(\w+)\]/g,".$1");f=f.replace(/^\./,"");let w=((h=e.model)==null?void 0:h.value)||{},O=0;const F=f.split("."),y=F.length;for(;O<y;){const C=F[O];if(O<y-1)w[C]!==void 0||(w[C]={}),w=w[C];else{w[C]=k;return}++O}},m=(_,k=!1)=>{const f=N(e.formOptions,"fieldIdPrefix","");return ft(_,f)+(k?"-"+$n():"")},p=_=>`${m(_)}-label`,g=()=>N(e.schema,"fieldClasses",[]),M=_=>_,B=_=>_;return{value:a,clearValidationErrors:d,getFieldID:m,getLabelId:p,getFieldClasses:g,updateModelValue:l}}const Hn={useAbstractFields:$s},Ms={class:"form-field-wrapper"},Yn=T(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const r=e,a=o,i=t.toRefs(r),{updateModelValue:s,getFieldID:l,clearValidationErrors:d,value:c}=Hn.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:f=>{a("modelUpdated",f.value,f.model)}});n({clearValidationErrors:d});const m=t.computed(()=>{var w;const f=(w=r.schema)==null?void 0:w.inputType.toLowerCase();return f==="string"?"text":f==="datetime"?"datetime-local":f||"text"}),p={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},g=(f,w)=>{var h,C;let O=f;const F=p[m.value]||"",y=ne.parse(f,F);y&&((h=r.schema)!=null&&h.format?O=ne.format(y,(C=r.schema)==null?void 0:C.format):O=y.valueOf()),s(O,w)},M=(f,w)=>{_t(f)||(f=NaN),s(f,w)},B=f=>{let w=f;switch(m.value){case"number":case"range":_t(parseFloat(f))&&(w=parseFloat(f));break}c.value=w,s(w,f)},_=t.ref(null),k=()=>{var f;I(_.value)&&((f=_.value)==null||f.flush())};return t.onMounted(()=>{switch(m.value){case"number":case"range":_.value=De((f,w)=>{M(f,w)},parseInt(N(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":_.value=De((f,w)=>{g(f,w)},parseInt(N(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{m.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):m.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):m.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(f,w)=>{const O=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",Ms,[t.createVNode(O,t.mergeProps(f.$attrs,{id:t.unref(l)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||null,help:e.hint?e.hint:m.value==="color"||m.value==="range"?t.unref(c):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(c),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,type:m.value,width:e.schema.width,onBlur:k,"onUpdate:modelValue":B}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","type","width"])])}}}),[["__scopeId","data-v-b6d4701b"]]),Bs=T(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:r,value:a}=Hn.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(i,s)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(r)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-852ab959"]]),Ns=["disabled"],Vs=["id","disabled","name","onClick","value","checked","required"];function Is(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:"radio-list",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>t.withDirectives((t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(i.getItemCssClasses(l))},[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"radio",disabled:i.isItemDisabled(l)||null,name:i.id,onClick:d=>i.onSelection(l),value:i.getItemValue(l),checked:i.isItemChecked(l)||null,class:t.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,Vs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)],2)),[[s,"label"]])),256))],8,Ns)),[[s,"wrapper"]])}const As=T({mixins:[A],computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},id(){return this.schema.model}},methods:{getItemValue(e){if(z(e)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return e[this.schema.radiosOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return e},getItemName(e){if(z(e)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return e[this.schema.radiosOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return e},getItemCssClasses(e){return{"is-checked":this.isItemChecked(e),"is-disabled":this.isItemDisabled(e)}},onSelection(e){this.value=this.getItemValue(e)},isItemChecked(e){return this.getItemValue(e)===this.value},isItemDisabled(e){if(this.disabled)return!0;const n=N(e,"disabled",!1);return I(n)?n(this.model):n}}},[["render",Is]]);function Os(e,n){for(var o=-1,r=e==null?0:e.length;++o<r;)if(n(e[o],o,e))return!0;return!1}var Fs=1,Us=2;function Gn(e,n,o,r,a,i){var s=o&Fs,l=e.length,d=n.length;if(l!=d&&!(s&&d>l))return!1;var c=i.get(e),m=i.get(n);if(c&&m)return c==n&&m==e;var p=-1,g=!0,M=o&Us?new Le:void 0;for(i.set(e,n),i.set(n,e);++p<l;){var B=e[p],_=n[p];if(r)var k=s?r(_,B,p,n,e,i):r(B,_,p,e,n,i);if(k!==void 0){if(k)continue;g=!1;break}if(M){if(!Os(n,function(f,w){if(!Sn(M,w)&&(B===f||a(B,f,o,r,i)))return M.push(w)})){g=!1;break}}else if(!(B===_||a(B,_,o,r,i))){g=!1;break}}return i.delete(e),i.delete(n),g}function Ds(e){var n=-1,o=Array(e.size);return e.forEach(function(r,a){o[++n]=[a,r]}),o}var Ls=1,vs=2,Ps="[object Boolean]",qs="[object Date]",Rs="[object Error]",js="[object Map]",zs="[object Number]",xs="[object RegExp]",Ks="[object Set]",Hs="[object String]",Ys="[object Symbol]",Gs="[object ArrayBuffer]",Ws="[object DataView]",Wn=Q?Q.prototype:void 0,kt=Wn?Wn.valueOf:void 0;function Zs(e,n,o,r,a,i,s){switch(o){case Ws:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case Gs:return!(e.byteLength!=n.byteLength||!i(new We(e),new We(n)));case Ps:case qs:case zs:return Oe(+e,+n);case Rs:return e.name==n.name&&e.message==n.message;case xs:case Hs:return e==n+"";case js:var l=Ds;case Ks:var d=r&Ls;if(l||(l=bt),e.size!=n.size&&!d)return!1;var c=s.get(e);if(c)return c==n;r|=vs,s.set(e,n);var m=Gn(l(e),l(n),r,a,i,s);return s.delete(e),m;case Ys:if(kt)return kt.call(e)==kt.call(n)}return!1}var Js=1,Xs=Object.prototype,Qs=Xs.hasOwnProperty;function ed(e,n,o,r,a,i){var s=o&Js,l=ct(e),d=l.length,c=ct(n),m=c.length;if(d!=m&&!s)return!1;for(var p=d;p--;){var g=l[p];if(!(s?g in n:Qs.call(n,g)))return!1}var M=i.get(e),B=i.get(n);if(M&&B)return M==n&&B==e;var _=!0;i.set(e,n),i.set(n,e);for(var k=s;++p<d;){g=l[p];var f=e[g],w=n[g];if(r)var O=s?r(w,f,g,n,e,i):r(f,w,g,e,n,i);if(!(O===void 0?f===w||a(f,w,o,r,i):O)){_=!1;break}k||(k=g=="constructor")}if(_&&!k){var F=e.constructor,y=n.constructor;F!=y&&"constructor"in e&&"constructor"in n&&!(typeof F=="function"&&F instanceof F&&typeof y=="function"&&y instanceof y)&&(_=!1)}return i.delete(e),i.delete(n),_}var td=1,Zn="[object Arguments]",Jn="[object Array]",Xe="[object Object]",nd=Object.prototype,Xn=nd.hasOwnProperty;function od(e,n,o,r,a,i){var s=W(e),l=W(n),d=s?Jn:Te(e),c=l?Jn:Te(n);d=d==Zn?Xe:d,c=c==Zn?Xe:c;var m=d==Xe,p=c==Xe,g=d==c;if(g&&Ve(e)){if(!Ve(n))return!1;s=!0,m=!1}if(g&&!m)return i||(i=new te),s||rt(e)?Gn(e,n,o,r,a,i):Zs(e,n,d,o,r,a,i);if(!(o&td)){var M=m&&Xn.call(e,"__wrapped__"),B=p&&Xn.call(n,"__wrapped__");if(M||B){var _=M?e.value():e,k=B?n.value():n;return i||(i=new te),a(_,k,o,r,i)}}return g?(i||(i=new te),ed(e,n,o,r,a,i)):!1}function Ct(e,n,o,r,a){return e===n?!0:e==null||n==null||!ee(e)&&!ee(n)?e!==e&&n!==n:od(e,n,o,r,Ct,a)}var id=1,rd=2;function ad(e,n,o,r){var a=o.length,i=a,s=!r;if(e==null)return!i;for(e=Object(e);a--;){var l=o[a];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=o[a];var d=l[0],c=e[d],m=l[1];if(s&&l[2]){if(c===void 0&&!(d in e))return!1}else{var p=new te;if(r)var g=r(c,m,d,e,n,p);if(!(g===void 0?Ct(m,c,id|rd,r,p):g))return!1}}return!0}function Qn(e){return e===e&&!z(e)}function ld(e){for(var n=Ee(e),o=n.length;o--;){var r=n[o],a=e[r];n[o]=[r,a,Qn(a)]}return n}function eo(e,n){return function(o){return o==null?!1:o[e]===n&&(n!==void 0||e in Object(o))}}function sd(e){var n=ld(e);return n.length==1&&n[0][2]?eo(n[0][0],n[0][1]):function(o){return o===e||ad(o,e,n)}}function dd(e,n){return e!=null&&n in Object(e)}function cd(e,n,o){n=Ht(n,e);for(var r=-1,a=n.length,i=!1;++r<a;){var s=Ke(n[r]);if(!(i=e!=null&&o(e,s)))break;e=e[s]}return i||++r!=a?i:(a=e==null?0:e.length,!!a&&nt(a)&&tt(s,a)&&(W(e)||et(e)))}function md(e,n){return e!=null&&cd(e,n,dd)}var ud=1,hd=2;function pd(e,n){return at(e)&&Qn(n)?eo(Ke(e),n):function(o){var r=N(o,e);return r===void 0&&r===n?md(o,e):Ct(n,r,ud|hd)}}function fd(e){return function(n){return n==null?void 0:n[e]}}function gd(e){return function(n){return Yt(n,e)}}function yd(e){return at(e)?fd(Ke(e)):gd(e)}function to(e){return typeof e=="function"?e:e==null?Re:typeof e=="object"?W(e)?pd(e[0],e[1]):sd(e):yd(e)}function bd(e){return function(n,o,r){var a=Object(n);if(!Ce(n)){var i=to(o);n=Ee(n),o=function(l){return i(a[l],l,a)}}var s=e(n,o,r);return s>-1?a[i?n[s]:s]:void 0}}var _d=Math.max;function wd(e,n,o){var r=e==null?0:e.length;if(!r)return-1;var a=o==null?0:Vn(o);return a<0&&(a=_d(r+a,0)),En(e,to(n),a)}var kd=bd(wd);const Cd=["disabled","name","id"],Ed=["disabled"],Sd=["label"],Td=["value"],$d=["value"];function Md(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("select",{class:t.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},[i.selectOptions.hideNoneSelectedText?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null},t.toDisplayString(i.selectOptions.noneSelectedText||"<Nothing selected>"),9,Ed)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[l.group?(t.openBlock(),t.createElementBlock("optgroup",{key:0,label:i.getGroupName(l)},[l.ops?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(l.ops,d=>(t.openBlock(),t.createElementBlock("option",{value:i.getItemValue(d)},t.toDisplayString(i.getItemName(d)),9,Td))),256)):t.createCommentVNode("",!0)],8,Sd)):t.createCommentVNode("",!0),l.group?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:1,value:i.getItemValue(l)},t.toDisplayString(i.getItemName(l)),9,$d))],64))),256))],10,Cd)),[[t.vModelSelect,e.value],[s,"input"]])}const no=T({mixins:[A],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const e=this.schema.values;return typeof e=="function"?this.groupValues(e.apply(this,[this.model,this.schema])):this.groupValues(e)}},methods:{formatValueToField(e){return R(e)?null:e},groupValues(e){const n=[];let o={};return e.forEach(r=>{o=null,r.group&&z(r)?(o=kd(n,a=>a.group===r.group),o?o.ops.push({id:r.id,name:r.name}):(o={group:"",ops:[]},o.group=r.group,o.ops.push({id:r.id,name:r.name}),n.push(o))):n.push(r)}),n},getGroupName(e){if(e&&e.group)return e.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(e){if(z(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return e[this.schema.selectOptions.value];if(typeof e.id<"u")return e.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e},getItemName(e){if(z(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return e[this.schema.selectOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e}}},[["render",Md]]);var Bd="[object Map]",Nd="[object Set]",Vd=Object.prototype,Id=Vd.hasOwnProperty;function Ad(e){if(e==null)return!0;if(Ce(e)&&(W(e)||typeof e=="string"||typeof e.splice=="function"||Ve(e)||rt(e)||et(e)))return!e.length;var n=Te(e);if(n==Bd||n==Nd)return!e.size;if(qe(e))return!qt(e).length;for(var o in e)if(Id.call(e,o))return!1;return!0}const Od=["id","value","name","disabled"];function Fd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{id:e.getFieldID(e.schema),type:"submit",value:e.schema.buttonText,onClick:n[0]||(n[0]=(...s)=>i.onClick&&i.onClick(...s)),name:e.schema.inputName,disabled:e.disabled||null,class:t.normalizeClass(e.schema.fieldClasses)},null,10,Od)}const Ud=T({mixins:[A],methods:{onClick(e){if(this.schema.validateBeforeSubmit===!0){e.preventDefault();const n=N(this.formOptions,"validateAsync",!1),o=this.vfg.validate(),r=a=>{n&&!Ad(a)||!n&&!a?I(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,a,e):I(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)};o&&I(o.then)?o.then(r):r(o)}else I(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)}}},[["render",Fd]]),Dd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function Ld(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{class:t.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":n[0]||(n[0]=l=>e.value=l),id:e.getFieldID(e.schema),disabled:e.disabled||null,maxlength:e.schema.max,minlength:e.schema.min,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,rows:e.schema.rows||2,name:e.schema.inputName},null,10,Dd)),[[t.vModelText,e.value],[s,"input"]])}const oo=T({mixins:[A]},[["render",Ld]]),vd={class:"wrapper"},Pd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function qd(e,n,o,r,a,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",vd,[t.withDirectives(t.createElementVNode("input",{class:"form-control",id:e.getFieldID(e.schema),type:"file",name:e.schema.inputName,onChange:n[0]||(n[0]=(...l)=>i.onChange&&i.onChange(...l)),accept:e.schema.accept,multiple:e.schema.multiple,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,disabled:e.disabled||null},null,40,Pd),[[s,"input"]])])),[[s,"wrapper"]])}const Rd=T({mixins:[A],methods:{onChange(e){I(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,e,this)}}},[["render",qd]]),jd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function zd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text",value:e.value,autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,jd)}const xd=T({mixins:[A],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,le(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",zd]]),io={formatValueToField(e){if(e!=null){const n=this.schema.format?ne.parse(e,this.schema.format):new Date(e);return ne.format(n,this.getDateFormat())}return e},formatValueToModel(e){if(e!=null){const n=ne.parse(e,this.getDateFormat());this.schema.format?e=ne.format(n,this.schema.format):e=n.valueOf()}return e}},Kd={class:"input-group date"},Hd=["autocomplete","disabled","placeholder","readonly","name","id"],Yd=t.createElementVNode("span",{class:"input-group-addon"},[t.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function Gd(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",Kd,[t.withDirectives(t.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Hd),[[t.vModelText,e.value]]),Yd])}const ro="YYYY-MM-DD HH:mm:ss",Wd={mixins:[A],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const e=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(le(this.schema.dateTimePickerOptions||{},{format:ro})).on("dp.change",()=>{this.value=e.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:ro},...io}},Zd=T(Wd,[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,debounce:"500",onFocus:n[1]||(n[1]=s=>i.geolocate()),id:e.getFieldID(e.schema)},null,40,Jd)),[[t.vModelText,e.value]])}const Qd=T({mixins:[A],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const e=this.autocomplete.getPlace();if(e){this.value=e.formatted_address;const n={};if(e.address_components!==void 0)for(let o=0;o<e.address_components.length;o++){const r=e.address_components[o].types[0];this.inputs[r]&&(n[r]=e.address_components[o][this.inputs[r]])}I(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,n,e,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{const n={lat:e.coords.latitude,lng:e.coords.longitude},o=new window.google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(o.getBounds())})}}},[["render",Xd]]),ec={class:"wrapper"},tc=["autocomplete","disabled","placeholder","readonly"],nc=["disabled","name"];function oc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",ec,[t.withDirectives(t.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>i.wrappedValue=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly},null,8,tc),[[t.vShow,e.schema.hideInput!==!0],[t.vModelText,i.wrappedValue]]),e.schema.browse!==!1?(t.openBlock(),t.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:e.disabled||null,onChange:n[1]||(n[1]=(...s)=>i.fileChanged&&i.fileChanged(...s)),name:e.schema.inputName},null,40,nc)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"preview",style:t.normalizeStyle(i.previewStyle)},[t.createElementVNode("div",{class:"remove",title:"Remove image",onClick:n[2]||(n[2]=(...s)=>i.remove&&i.remove(...s))})],4)])}const ic=T({mixins:[A],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(e){e&&e.indexOf("http")===0&&(this.value=e)}}},watch:{model:{deep:!0,handler(){const e=this.$el.querySelector("input.file");e&&(e.value="")}}},methods:{remove(){this.value=""},fileChanged(e){const n=new FileReader;n.onload=o=>{this.value=o.target.result},e.target.files&&e.target.files.length>0&&n.readAsDataURL(e.target.files[0])}}},[["render",oc]]),rc=["autocomplete","disabled","placeholder","readonly","name","id"];function ac(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,rc)),[[t.vModelText,e.value]])}const lc=T({mixins:[A],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",ac]]),sc={mixins:[A],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,le(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(e){Array.isArray(e)?this.value=[parseFloat(e[0]),parseFloat(e[1])]:this.value=parseFloat(e)},formatValueToField(e){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(e)},formatValueToModel(e){if(typeof this.slider.noUiSlider<"u")return e instanceof Array?[Number(e[0]),Number(e[1])]:Number(e)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},dc=["disabled"];function cc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["slider",{"contain-pips":i.containPips,"contain-tooltip":i.containTooltip}]),disabled:e.disabled||null},null,10,dc)}const mc=T(sc,[["render",cc]]),uc=["autocomplete","disabled","placeholder","readonly","name"];function hc(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName},null,8,uc)),[[t.vModelText,e.value]])}const pc="YYYY-MM-DD",fc={mixins:[A],data(){return{picker:null,options:null}},mounted(){this.initialize(N(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return N(this.schema,"pikadayOptions.format",pc)},...io,initialize(e){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=le({},e,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},gc=T(fc,[["render",hc]]),yc=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function bc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{type:"text",autocomplete:e.schema.autocomplete,"data-disable":e.disabled,"data-max":e.schema.max,"data-min":e.schema.min,"data-step":e.schema.step,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName},null,8,yc)}const _c=T({mixins:[A],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let e,n;Array.isArray(this.value)?[e,n]=this.value:e=this.value,this.slider&&this.slider.update({from:e,to:n})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let e,n;Array.isArray(this.value)?[e,n]=this.value:e=this.value;const o=this;$(this.$el).ionRangeSlider(le(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:e,to:n,onChange(r){o.slider.options.type==="double"?o.value=[r.from,r.to]:o.value=r.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",bc]]),wc=["disabled","multiple","title","name"],kc=["disabled","selected"],Cc=["value"];function Ec(e,n,o,r,a,i){return t.withDirectives((t.openBlock(),t.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),disabled:e.disabled||null,multiple:e.schema.multiSelect,title:e.schema.placeholder,"data-width":"100%",name:e.schema.inputName},[e.schema.multiSelect!==!0?(t.openBlock(),t.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null,selected:e.value==null},null,8,kc)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,s=>(t.openBlock(),t.createElementBlock("option",{value:i.getItemValue(s)},t.toDisplayString(i.getItemName(s)),9,Cc))),256))],8,wc)),[[t.vModelSelect,e.value]])}const Sc=T({mixins:[A],computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(e){if(z(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return e[this.schema.selectOptions.value];if(typeof e.id<"u")return e.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e},getItemName(e){if(z(e)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return e[this.schema.selectOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return e}}},[["render",Ec]]),Tc=["autocomplete","disabled","placeholder","readonly","name","id"];function $c(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("input",{type:"text",autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Tc)}const Mc=T({mixins:[A],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(e){e?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(le(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:e=>{this.value=e?e.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",$c]]),Bc=["src"];function Nc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("img",{src:i.mapLink},null,8,Bc)}const Vc=T({mixins:[A],computed:{mapLink(){let e,n,o;if(this.value){const r=le(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});e=this.value[r.lat],n=this.value[r.lng],o=`http://maps.googleapis.com/maps/api/staticmap?center=${e},${n}&zoom=${r.zoom}&size=${r.sizeX}x${r.sizeY}`;const a=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const i of a)typeof r[i]<"u"&&(o+=`&${i}=${r[i]}`)}return o}}},[["render",Nc]]),Ic=["autocomplete","disabled","name","id"],Ac=["data-on","data-off","for"],Oc=t.createElementVNode("span",{class:"handle"},null,-1);function Fc(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("label",null,[t.withDirectives(t.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,Ic),[[t.vModelCheckbox,e.value]]),t.createElementVNode("span",{class:"label","data-on":e.schema.textOn||"On","data-off":e.schema.textOff||"Off",for:e.getFieldID(e.schema)},null,8,Ac),Oc])}const Uc=T({mixins:[A],methods:{formatValueToField(e){return e!=null&&this.schema.valueOn?e===this.schema.valueOn:e},formatValueToModel(e){return e!=null&&this.schema.valueOn?e?this.schema.valueOn:this.schema.valueOff:e}}},[["render",Fc]]),Dc={mixins:[A],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const r=e[o];n[r]=typeof this.value[r]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},Lc={key:0},vc={key:1},Pc=["id"],qc={key:0},Rc=["onUpdate:modelValue"],jc={key:1},zc=["onUpdate:modelValue"],xc={key:2},Kc=["onUpdate:modelValue"],Hc=["onClick"],Yc=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function Gc(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator"),l=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",null,[e.schema.schema?(t.openBlock(),t.createElementBlock("div",Lc,[t.createVNode(s,{model:e.value,options:e.formOptions,schema:e.schema.schema},null,8,["model","options","schema"])])):(t.openBlock(),t.createElementBlock("div",vc,[t.createElementVNode("table",{id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(d,c)=>(t.openBlock(),t.createElementBlock("tr",{key:c},[t.createElementVNode("td",null,t.toDisplayString(c),1),a.keyTypes[c]==="string"?(t.openBlock(),t.createElementBlock("td",qc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"text"},null,8,Rc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="boolean"?(t.openBlock(),t.createElementBlock("td",jc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"checkbox"},null,8,zc),[[t.vModelCheckbox,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="number"?(t.openBlock(),t.createElementBlock("td",xc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"number"},null,8,Kc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:m=>i.removeElement(c)},null,8,Hc)])]))),128))],10,Pc),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":n[0]||(n[0]=d=>a.newKeyType=d)},Yc,512),[[t.vModelSelect,a.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>a.newKeyName=d),type:"text"},null,512),[[t.vModelText,a.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:n[2]||(n[2]=(...d)=>i.addKey&&i.addKey(...d))})]))])),[[l,a.attributes]])}const ao=T(Dc,[["render",Gc]]),$e="24px",Et=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Wc=e=>(t.pushScopeId("data-v-f89f0eca"),e=e(),t.popScopeId(),e),Zc=["aria-hidden"],Jc={key:0,"data-testid":"kui-icon-svg-title"},Xc=Wc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Qc=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Xc],8,Zc))]),_:1},8,["aria-hidden","style"]))}}),lo=Et(Qc,[["__scopeId","data-v-f89f0eca"]]),em=e=>(t.pushScopeId("data-v-b55d654f"),e=e(),t.popScopeId(),e),tm=["aria-hidden"],nm={key:0,"data-testid":"kui-icon-svg-title"},om=em(()=>t.createElementVNode("path",{d:"M5 13V11H19V13H5Z",fill:"currentColor"},null,-1)),im=t.defineComponent({__name:"RemoveIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon remove-icon","data-testid":"kui-icon-wrapper-remove-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-remove-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",nm,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),om],8,tm))]),_:1},8,["aria-hidden","style"]))}}),rm=Et(im,[["__scopeId","data-v-b55d654f"]]),am=e=>(t.pushScopeId("data-v-6f1d5389"),e=e(),t.popScopeId(),e),lm=["aria-hidden"],sm={key:0,"data-testid":"kui-icon-svg-title"},dm=am(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),cm=t.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:$e,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $e}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",sm,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),dm],8,lm))]),_:1},8,["aria-hidden","style"]))}}),Pe=Et(cm,[["__scopeId","data-v-6f1d5389"]]),mm={components:{TrashIcon:Pe},mixins:[A],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){const r={};return Object.keys(e).map(a=>{const i=a.indexOf(o+"-");if(i>-1&&Array.isArray(n))if(n.length>0){const l=a.split("-").filter(c=>n.find(m=>m.model===c)),d=a.split(`-${l}`)[0].split(`${o}-`)[1];l.length?r[d]={...r[d],[l]:e[a]}:r[a.substring(i+`${o}-`.length)]=e[a]}else r[a.substring(`${o}-`.length)]=e[a];else{const l=a.split("-").filter(c=>c===this.schema.model),d=a.split(`-${l}`)[0].split(`${o}-`)[1];d&&(r[d]=e[a])}return a}),r},addKey(){const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=this.subSchema?e?[""]:{}:"";this.value[this.newKeyName]=n,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},so=e=>(t.pushScopeId("data-v-b35063fd"),e=e(),t.popScopeId(),e),um=["id"],hm=["data-testid"],pm={class:"item-wrapper"},fm={class:"index-wrapper"},gm=so(()=>t.createElementVNode("hr",{class:"divider"},null,-1)),ym={key:0},bm={key:1},_m=["onUpdate:modelValue","placeholder","onInput"],wm={key:0,class:"hint"},km=so(()=>t.createElementVNode("hr",{class:"wide-divider"},null,-1)),Cm={class:"input-item"},Em=["placeholder"],Sm={key:0,class:"hint"};function Tm(e,n,o,r,a,i){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton"),d=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",{id:e.getFieldID(e.schema),class:t.normalizeClass(["object-advanced-wrapper",e.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,"data-testid":`field-object-key-${m}`},[t.createElementVNode("div",null,[t.createElementVNode("div",pm,[t.createElementVNode("div",fm,[t.createElementVNode("strong",null,t.toDisplayString(m),1),t.createElementVNode("div",null,[t.createVNode(l,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:p=>i.removeElement(m)},{default:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["onClick"])])]),gm,i.subSchema?(t.openBlock(),t.createElementBlock("div",ym,[t.createVNode(d,{model:i.transformedModel[m],options:{helpAsHtml:!0},schema:i.subSchema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",bm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":p=>e.value[m]=p,class:"form-control",placeholder:e.schema.fields&&e.schema.fields[0].schema.placeholder,type:"text",onInput:p=>i.updateModel(e.value[m],e.model[e.schema.model])},null,40,_m),[[t.vModelText,e.value[m]]]),e.schema.fields&&e.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(e.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0)])),km])])],8,hm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:i.hasObjectKeys}])},[t.createElementVNode("div",Cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>a.newKeyName=c),class:"form-control","data-testid":"keyname-input",placeholder:e.schema.placeholder,type:"text"},null,8,Em),[[t.vModelText,a.newKeyName]]),t.createVNode(l,{appearance:"tertiary","data-testid":"add-key",disabled:!a.newKeyName,onClick:i.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(e.schema.buttonLabel||e.schema.label),1)]),_:1},8,["disabled","onClick"])]),e.schema.hintText?(t.openBlock(),t.createElementBlock("p",Sm,t.toDisplayString(e.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,um)}const co=T(mm,[["render",Tm],["__scopeId","data-v-b35063fd"]]),$m={class:"array-item"},mo=T(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",$m,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Pe))]),_:1})])}}}),[["__scopeId","data-v-ec926551"]]),Mm=e=>(t.pushScopeId("data-v-27d212bd"),e=e(),t.popScopeId(),e),Bm={class:"multi-item-wrapper"},Nm=Mm(()=>t.createElementVNode("hr",null,null,-1)),uo=T(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Bm,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createTextVNode(" - Remove Field ")]),_:1}),Nm])}}}),[["__scopeId","data-v-27d212bd"]]),Vm={name:"FieldMetric",components:{AddIcon:lo,TrashIcon:Pe},mixins:[A],emits:["remove-item"],data(){return{contentVisible:!1}}},Im={key:0,class:"content"};function Am(e,n,o,r,a,i){const s=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),d=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:a.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=c=>a.contentVisible=!a.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(s,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[a.contentVisible?(t.openBlock(),t.createElementBlock("div",Im,[t.renderSlot(e.$slots,"default"),t.createVNode(d,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=c=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const ho=T(Vm,[["render",Am]]),ce="kong-ui-forms-api",Om="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function Fm(e){return e?e.length===36&&new RegExp(`^${Om}$`).test(e):!1}const St=50,_e={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function Um(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const Dm={mixins:[A],inject:[ce],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return Um(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ce]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[ce].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=De(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],r=this.getInputFields(),a=new Set;Fm(e)&&r.includes("id")?o.push((async()=>{const i=await this.fetchExact(e);n.push({...i,label:this.getSuggestionLabel(i),value:i.id})})()):o.push(...r.filter(i=>i!=="id").map(async i=>{(await this.fetchSuggestions(e,i)).forEach(l=>{a.has(l.id)||(a.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[ce])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<St;){const r=await this[ce].getAll(this.entity,{size:St,offset:o,...e});if(n.push(...r.data.data),o=r.data.offset,!o)break}return n.slice(0,St)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[ce]?(await this[ce].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Lm={class:"field-wrap autosuggest"},vm=["data-testid","data-testlabel"],Pm=["data-testid"],qm={class:"autosuggest__results_message"};function Rm(e,n,o,r,a,i){const s=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock("div",Lm,[t.createVNode(s,{id:e.schema.model,ref:"suggestion",modelValue:a.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>a.idValue=l),clearable:"","enable-filtering":"","filter-function":()=>!0,items:a.items,loading:a.loading,placeholder:e.schema.placeholder,width:"100%",onChange:i.onSelected,onQueryChange:i.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(i.getSuggestionLabel(l).split(" - ")[0]),9,vm),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.getSuggestionLabel(l).split(" - ").slice(1),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,class:"field-span","data-testid":l.id&&`${l.id}-${c+1}`||c+1},t.toDisplayString(d),9,Pm))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",qm,[t.createElementVNode("span",null,t.toDisplayString(a.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const po=T(Dm,[["render",Rm],["__scopeId","data-v-647bb712"]]),jm={class:"array-card-container"},fo=T(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null}},emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KCard"),a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",jm,[t.createVNode(r,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(a,{appearance:"tertiary",class:"array-card-remove-button",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Pe))]),_:1})])}}}),[["__scopeId","data-v-5fa27cb4"]]),zm={mixins:[A],emits:["model-updated"],methods:{updateModel(e){this.$emit("model-updated",e,this.schema.model)},checkOption(e){return this.model[this.schema.model]?e.value.toString()===this.model[this.schema.model].toString():e.checked},onChange(e){let n=e.target.value.split(",");this.schema.array||(n=n.toString()),this.updateModel(n)}}},xm={class:"selection-group"},Km={class:"form-group"},Hm=["id","checked","name","value"];function Ym(e,n,o,r,a,i){return t.openBlock(),t.createElementBlock("div",xm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(s,l)=>(t.openBlock(),t.createElementBlock("div",{key:l,class:"option-group"},[t.createElementVNode("div",Km,[t.createElementVNode("label",{class:t.normalizeClass(["k-label",s.name])},[t.createElementVNode("input",{id:e.schema.name+"-"+l,checked:i.checkOption(s),class:"k-input",name:e.schema.name,type:"radio",value:s.value,onChange:n[0]||(n[0]=(...d)=>i.onChange&&i.onChange(...d))},null,40,Hm),t.createTextVNode(" "+t.toDisplayString(s.name),1)],2)])]))),128))])}const go=T(zm,[["render",Ym],["__scopeId","data-v-7e49acd6"]]),Gm={name:"FieldArray",components:{FieldArrayItem:mo,FieldArrayMultiItem:uo,FieldSelect:no,FieldMetric:ho,FieldObject:ao,FieldObjectAdvanced:co,FieldAutoSuggest:po,FieldRadio:go,FieldArrayCardContainer:fo,FieldTextArea:oo,FieldInput:Yn},mixins:[A],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(e,n,o){var a,i,s;let r;return n&&(r=JSON.parse(JSON.stringify(n)),(s=(i=(a=r.schema)==null?void 0:a.fields)==null?void 0:i.map)==null||s.call(i,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...r,set(l,d){e[o]=d},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldType(e){return"field-"+e.type},modelUpdated(){}}},Wm=["id"],Zm={key:1},Jm=["onUpdate:modelValue","aria-labelledby","type"],Xm=["value","onClick"],Qm=["onUpdate:modelValue","aria-labelledby"],eu=["value","onClick"];function tu(e,n,o,r,a,i){const s=t.resolveComponent("FieldTextArea"),l=t.resolveComponent("KInput"),d=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onRemoveItem:p=>i.removeElement(m)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Zm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${m}`,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onRemoveItem:p=>i.removeElement(m)},{default:t.withCtx(()=>{var p;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(s,{key:0,"aria-labelledby":e.getLabelId(e.schema),class:"k-input","form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,m),onModelUpdated:i.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:1,modelValue:e.value[m],"onUpdate:modelValue":g=>e.value[m]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text"}),null,16,["modelValue","onUpdate:modelValue","aria-labelledby","type"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":g=>e.value[m]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((p=e.schema.inputAttributes)==null?void 0:p.type)||"text"}),null,16,Jm)),[[t.vModelDynamic,e.value[m]]]),e.schema.showRemoveButton?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:3,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||o.removeElementButtonLabel,onClick:g=>i.removeElement(m)}),null,16,Xm)):t.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:3,ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":p=>e.value[m]=p,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Qm)),[[t.vModelText,e.value[m]]]),e.schema.showRemoveButton?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:4,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||o.removeElementButtonLabel,onClick:p=>i.removeElement(m)}),null,16,eu)):t.createCommentVNode("",!0)],2))),128)),t.createVNode(d,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:i.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Wm)):t.createCommentVNode("",!0)}const nu=T(Gm,[["render",tu],["__scopeId","data-v-13233543"]]),ou={mixins:[A],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},iu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},ru={class:"material-icons"};function au(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",iu,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:n[0]||(n[0]=(...l)=>i.handleOpen&&i.handleOpen(...l))},[t.createElementVNode("i",ru,t.toDisplayString(a.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(i.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",i.openClass])},[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:e.schema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const lu=T(ou,[["render",au],["__scopeId","data-v-2d8e71e1"]]),su={mixins:[A],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(e,n){if(n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,r=this.schema.fields[n].fields;r&&r.forEach(a=>this.updateModel("",a.model)),o&&o.forEach(a=>this.updateModel(this.fieldModel[a.model],a.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{e.fields&&e.fields.forEach(o=>{this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},du={class:"selection-group"},cu={class:"form-group horizontal-radios"},mu={class:"radio-group"},uu=["value"],hu={class:"control-help"},pu={class:"option-field"},fu={class:"option-field-container"},gu={class:"form-group"},yu=["value"],bu={class:"control-help"},_u={class:"option-field"},wu={class:"option-field-container"};function ku(e,n,o,r,a,i){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",du,[e.schema.horizontalRadios?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",cu,[t.createElementVNode("div",mu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${l.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>a.checkedGroup=c),class:"k-input",type:"radio",value:d},null,8,uu),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",hu,t.toDisplayString(l.description),1)],2)]))),128))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.withDirectives(t.createElementVNode("div",pu,[t.createElementVNode("div",fu,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,l.fields&&a.checkedGroup===d]])]))),128))],64)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.schema.fields,(l,d)=>(t.openBlock(),t.createElementBlock("div",{key:d,class:"option-group"},[t.createElementVNode("div",gu,[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${l.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=c=>a.checkedGroup=c),class:"k-input",type:"radio",value:d},null,8,yu),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",bu,t.toDisplayString(l.description),1)],2)]),t.withDirectives(t.createElementVNode("div",_u,[t.createElementVNode("div",wu,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,l.fields&&a.checkedGroup===d]])]))),128))])}const Cu=T(su,[["render",ku],["__scopeId","data-v-22882f4c"]]),Eu={mixins:[A],emits:["model-updated"],methods:{onUpdate(e){this.$emit("model-updated",e,this.schema.model)}}};function Su(e,n,o,r,a,i){const s=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(s,{"aria-labelledby":e.getLabelId(e.schema),"data-testid":"field-multiselect",items:e.schema.values,"label-attributes":{info:e.schema.help},"model-value":e.value,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%","onUpdate:modelValue":i.onUpdate},null,8,["aria-labelledby","items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Tu=T(Eu,[["render",Su]]),$u={name:"FieldKeyValuePairs",components:{TrashIcon:Pe},mixins:[A],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(r=>{this.pairs.push({key:r,value:e[r]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Mu={class:"key-value-pairs-editor"},Bu=["data-testid","placeholder","value","onInput"],Nu=["data-testid","placeholder","value","onInput"];function Vu(e,n,o,r,a,i){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Mu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.pairs,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:"pair-item"},[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${c}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:d.key,onInput:m=>{i.onInput(m,c,"key")}},null,40,Bu),t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${c}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:d.value,onInput:m=>{i.onInput(m,c,"value")}},null,40,Nu),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{i.removePair(c)}},{default:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:i.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Iu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:lu,FieldArray:nu,FieldArrayCardContainer:fo,FieldArrayItem:mo,FieldArrayMultiItem:uo,FieldAutoSuggest:po,FieldCheckbox:ps,FieldChecklist:Ts,FieldCleave:xd,FieldDateTimePicker:Zd,FieldGoogleAddress:Qd,FieldImage:ic,FieldInput:Yn,FieldKeyValuePairs:T($u,[["render",Vu],["__scopeId","data-v-29d15375"]]),FieldLabel:Bs,FieldMasked:lc,FieldMetric:ho,FieldMultiselect:Tu,FieldNoUiSlider:mc,FieldObject:ao,FieldObjectAdvanced:co,FieldPikaday:gc,FieldRadio:go,FieldRadios:As,FieldRangeSlider:_c,FieldSelect:no,FieldSelectEx:Sc,FieldSelectionGroup:Cu,FieldSpectrum:Mc,FieldStaticMap:Vc,FieldSubmit:Ud,FieldTextArea:oo,FieldUpload:Rd,fieldSwitch:Uc},Symbol.toStringTag,{value:"Module"})),mixins:[Gt],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:t.ref()}},methods:{fieldTypeHasLabel(e){if(R(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=N(this.options,"fieldIdPrefix","");return ft(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldType(e){return"field-"+e.type},getButtonType(e){return N(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return I(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},Au=e=>(t.pushScopeId("data-v-02e656fb"),e=e(),t.popScopeId(),e),Ou=["innerHTML"],Fu={class:"icon-wrapper"},Uu=["innerHTML"],Du={key:0,class:"link-wrapper"},Lu=Au(()=>t.createElementVNode("span",{class:"section-header"},"More info",-1)),vu={class:"field-wrap"},Pu={key:0,class:"buttons"},qu=["type","onClick","textContent"],Ru=["innerHTML"],ju={key:2,class:"errors help-block"},zu=["innerHTML"];function xu(e,n,o,r,a,i){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[i.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?i.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:i.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:i.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",Fu,[t.createElementVNode("span",{innerHTML:i.formattedLabel(o.field.label)},null,8,Uu)]),o.field.link?(t.openBlock(),t.createElementBlock("div",Du,[t.createVNode(s,{href:o.field.link},{default:t.withCtx(()=>[Lu]),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:o.field.help},null,8,Ou)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",vu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldType(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&i.getFieldType(o.field)==="field-input"?i.fieldHint(o.field):void 0,model:o.model,schema:o.field,vfg:o.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onValidated"])),i.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",Pu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(d,c)=>(t.openBlock(),t.createElementBlock("button",{key:c,class:t.normalizeClass(d.classes),type:i.getButtonType(d),onClick:m=>i.buttonClickHandler(d,o.field,m),textContent:t.toDisplayString(d.label)},null,10,qu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&i.getFieldType(o.field)!=="field-input"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hint",innerHTML:i.fieldHint(o.field)},null,8,Ru)):t.createCommentVNode("",!0),i.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",ju,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fieldErrors(o.field),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,innerHTML:d},null,8,zu))),128))])):t.createCommentVNode("",!0)],2)}const Ku={name:"FormGenerator",components:{formGroup:T(Iu,[["render",xu],["__scopeId","data-v-02e656fb"]])},mixins:[Gt],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&H(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&H(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return I(e.visible)?e.visible.call(this,this.model,e,this):R(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(a=>a.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&H(n,a=>{this.errors.push({field:o.schema,error:a})});const r=this.errors.length===0;this.$emit("validated",r,this.errors,this)},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e=null){e===null&&(e=N(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];H(this.$refs.children,a=>{I(a.validate)&&(n.push(a.$refs.child),o.push(a.$refs.child.validate(!0)))});const r=a=>{const i=[];H(a,(l,d)=>{Array.isArray(l)&&l.length>0&&H(l,c=>{i.push({field:n[d].schema,error:c})})}),this.errors=i;const s=i.length===0;return this.$emit("validated",s,i,this),e?i:s};return e?Promise.all(o).then(r):r(o)},clearValidationErrors(){this.errors.splice(0),H(this.$refs.children,e=>{e.clearValidationErrors()})}}},Hu={key:0,class:"vue-form-generator"},Yu={key:0};function Gu(e,n,o,r,a,i){const s=t.resolveComponent("form-group"),l=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Hu,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fields,d=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:d.model},[i.fieldVisible(d)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:d,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.groups,(d,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${c}`},[d.collapsible!==void 0&&d.collapsible!==!1?(t.openBlock(),t.createBlock(l,{key:0,class:"root-level-collapse","model-value":!1,title:d.collapsible.title},t.createSlots({default:t.withCtx(()=>{var m,p,g,M;return[(m=d.slots)!=null&&m.beforeContent?t.renderSlot(e.$slots,(p=d.slots)==null?void 0:p.beforeContent,{key:0}):t.createCommentVNode("",!0),d.fields.length===0&&((g=d.slots)!=null&&g.emptyState)?t.renderSlot(e.$slots,(M=d.slots)==null?void 0:M.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.fields,B=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:B.model},[i.fieldVisible(B)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:B,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),d.collapsible!==!0&&d.collapsible.nestedCollapsible&&d.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(l,{key:3,class:"nested-collapse","model-value":a.collapseStates[`group-${c}-nested`]??!0,"trigger-alignment":"leading","trigger-label":a.collapseStates[`group-${c}-nested`]??!0?d.collapsible.nestedCollapsible.triggerLabel.expand:d.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":B=>a.collapseStates[`group-${c}-nested`]=B},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.collapsible.nestedCollapsible.fields,B=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:B.model},[i.fieldVisible(B)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:B,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[d.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(d))},{default:t.withCtx(()=>[d.legend?(t.openBlock(),t.createElementBlock("legend",Yu,t.toDisplayString(d.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[i.fieldVisible(m)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:m,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=T(Ku,[["render",Gu]]),Wu={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},Zu={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},Ju={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},Xu={name:"OIDCForm",components:{VueFormGenerator:Y},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var n;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(o=>!o.model.startsWith("config")&&o.model!=="tags")},this.commonFieldsSchema={...Wu},this.authFieldsSchema={...Zu},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(o=>o.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(r=>r.model===o.model).length&&!this.authFieldsSchema.fields.filter(r=>r.model===o.model).length||o.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(o=>{const r=Ju.fields.find(a=>a.model===o.model);return r||o}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(o=>o.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const e={};for(const o of this.formSchema.fields)e[o.model]=o;for(const o of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of o.fields){const a=(n=e[r.model])==null?void 0:n.help;r.help===void 0&&typeof a=="string"&&(r.help=a)}},getAuthMethodsValue(e,n){const o=[];for(let r=0;r<this.authMethods.length;r++)this.authMethods[r].prop&&this.authMethods[r].value!==e&&o.push(this.authMethods[r].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Me=e=>(t.pushScopeId("data-v-e7395ff0"),e=e(),t.popScopeId(),e),Qu={class:"general-settings"},eh={class:"link-wrapper"},th=Me(()=>t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),nh=Me(()=>t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),oh={class:"auth-method-container"},ih={class:"general-settings"},rh={class:"link-wrapper"},ah=Me(()=>t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),lh=Me(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),sh={class:"general-settings"},dh={class:"link-wrapper"},ch=Me(()=>t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),mh=Me(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function uh(e,n,o,r,a,i){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KLabel"),c=t.resolveComponent("KCheckbox"),m=t.resolveComponent("KInputSwitch"),p=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(s,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:a.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(p,{tabs:a.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Qu,[t.createElementVNode("div",eh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:t.withCtx(()=>[th]),_:1})]),nh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(d,null,{default:t.withCtx(()=>[t.createTextVNode("Auth Methods")]),_:1}),t.createElementVNode("div",oh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.authMethods,g=>(t.openBlock(),t.createElementBlock("div",{key:g.value,class:"auth-method"},[t.createVNode(c,{modelValue:g.prop,"onUpdate:modelValue":M=>g.prop=M,onChange:M=>i.handleUpdate(M,g.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(g.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(m,{modelValue:a.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=g=>a.sessionManagement=g),label:"Enable Session Management",onChange:i.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",ih,[t.createElementVNode("div",rh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:t.withCtx(()=>[ah]),_:1})]),lh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.authFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",sh,[t.createElementVNode("div",dh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:t.withCtx(()=>[ch]),_:1})]),mh,i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:a.advancedFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const hh=T(Xu,[["render",uh],["__scopeId","data-v-e7395ff0"]]),Tt={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced_fields:"View Advanced Fields",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window&#39;s counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}}},ph=T(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const{t:n,te:o}=Qe.createI18n("en-us",Tt),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const s=r.formSchema;return s.fields.map(l=>{const d=`post-function.${l.model}`;return l.hint=o(`${d}.hint`)&&n(`${d}.hint`)||l.hint,l.help=o(`${d}.help`)&&n(`${d}.help`)||l.help,l.newElementButtonLabel=o(`${d}.newElementButtonLabel`)&&n(`${d}.newElementButtonLabel`)||l.newElementButtonLabel,l.model!=="tags"&&(l.valueType==="array"||l.type==="array")&&(l.type="array",l.valueArrayType="array",l.itemContainerComponent="FieldArrayItem",l.fieldClasses="post-function-array-item-container",l.fieldItemsClasses="post-function-array-item",l.inputAttributes={...l.inputAttributes,type:"textarea"}),l}),s});return(s,l)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-a0470d09"]]),fh=T(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const{t:n,te:o}=Qe.createI18n("en-us",Tt),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const s=r.formSchema;return s.fields.map(l=>{const d=`exit-transformer.${l.model}`;return l.hint=o(`${d}.hint`)&&n(`${d}.hint`)||l.hint,l.help=o(`${d}.help`)&&n(`${d}.help`)||l.help,l.newElementButtonLabel=o(`${d}.newElementButtonLabel`)&&n(`${d}.newElementButtonLabel`)||l.newElementButtonLabel,l.model!=="tags"&&(l.valueType==="array"||l.type==="array")&&(l.type="array",l.valueArrayType="array",l.itemContainerComponent="FieldArrayItem",l.fieldClasses="exit-transformer-array-item-container",l.fieldItemsClasses="exit-transformer-array-item",l.inputAttributes={...l.inputAttributes,type:"textarea"}),l}),s});return(s,l)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9d23f812"]]),gh={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},yh={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},bh={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},we=e=>(t.pushScopeId("data-v-136dc132"),e=e(),t.popScopeId(),e),_h={class:"general-settings"},wh=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),kh=we(()=>t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Ch=we(()=>t.createElementVNode("hr",null,null,-1)),Eh={class:"sub-form"},Sh={class:"general-settings"},Th=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),$h=we(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Mh={class:"sub-form"},Bh={class:"general-settings"},Nh=we(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),Vh=we(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),Ih=T(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){const n=e,o=t.ref("zeroSsl"),r=t.ref("shm"),a=t.computed(()=>{var h;const y={};if((h=n.formSchema)!=null&&h.fields)for(const C of n.formSchema.fields)y[C.model]=C;return y}),i=t.computed(()=>{var h;const y=re(gh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),s=t.computed(()=>{var h;const y=re(yh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),l=t.computed(()=>{var h;const y=re(bh);for(const C of y.fields){const U=(h=a.value[C.model])==null?void 0:h.help;C.help===void 0&&typeof U=="string"&&(C.help=U)}return y}),d=t.computed(()=>({fields:n.formSchema.fields.filter(y=>!y.model.startsWith("config")&&y.model!=="tags")})),c=t.computed(()=>({fields:i.value.fields.filter(h=>!s.value.fields.some(C=>C.model===h.model)&&!l.value.fields.some(C=>C.model===h.model))})),m=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage")&&!h.model.startsWith("config-storage_config-consul")&&!h.model.startsWith("config-storage_config-redis")&&!h.model.startsWith("config-storage_config-shm")&&!h.model.startsWith("config-storage_config-vault"))})),p=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-consul"))})),g=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-redis"))})),M=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-shm"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-vault"))})),_=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config")&&!c.value.fields.filter(h=>h.model===y.model).length&&!m.value.fields.filter(h=>h.model===y.model).length||y.model==="tags")})),k=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),f=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],w=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const O=y=>{o.value=y.value,(y.value==="zeroSsl"||y.value==="other")&&(y.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),y.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},F=(y,h)=>{h==="config-storage"&&(r.value=y),n.onModelUpdated()};return(y,h)=>{const C=t.resolveComponent("KSelect"),U=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:d.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(U,{tabs:f},{general:t.withCtx(()=>[t.createElementVNode("div",_h,[wh,kh,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),Ch,t.createVNode(C,{class:"issuer-select",items:w,label:"Issuer",onChange:O}),t.createElementVNode("div",Eh,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",Sh,[Th,$h,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:F},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",Mh,[r.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:p.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:g.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:M.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:B.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",Bh,[Nh,Vh,k.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:_.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-136dc132"]]),yo=e=>(t.pushScopeId("data-v-672119f6"),e=e(),t.popScopeId(),e),Ah={class:"rla-form-basic-fields"},Oh={class:"rla-form-request-limits-subtitle"},Fh={class:"rla-form-request-limits-content"},Uh={class:"rla-form-window-type"},Dh=["innerHTML"],Lh={class:"rla-form-window-type-radios"},vh={class:"rla-form-request-limits-items"},Ph={class:"rla-form-request-limits-row"},qh=["id"],Rh={class:"rla-form-request-limits-actions"},jh={key:0,class:"rla-form-request-limits-examples"},zh={class:"rla-form-request-limits-examples-badges"},xh=yo(()=>t.createElementVNode("br",null,null,-1)),Kh=["innerHTML"],Hh={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Yh=yo(()=>t.createElementVNode("div",null,":",-1)),Gh=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:Ih,ExitTransformer:fh,OIDCForm:hh,PostFunction:ph,RLAForm:T(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},isEditing:{type:Boolean}},setup(e){const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
2
2
  If the limit is exceeded and the user receives a 429 error, each additional request within the sliding window (hour)
3
- will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`,config:{limit:500,window_size:3600}}]},o=new Set(["selectionGroup",...["identifier","limit","window_size","error_code","error_message"].map(u=>`config-${u}`)]),r=u=>u===void 0?!1:o.has(u),{t:a}=Qe.createI18n("en-us",Tt),i=e,s=t.computed(()=>{var b,E;const u=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(S=>S.type==="selectionGroup"&&S.model==="selectionGroup");if(u)return{fields:[{...u,horizontalRadios:!0}]}}),l=t.computed(()=>{var Z,me;const u=((me=(Z=i.formSchema)==null?void 0:Z.fields)==null?void 0:me.filter(x=>!r(x.model)))??[],b=[],E=[],S=[];let P=!1;for(const x of u){const Be=x.model;if(Be!==void 0){if(Be.startsWith("config-redis-")){(x.model==="config-redis-cluster_addresses"||x.model==="config-redis-sentinel_addresses")&&(x.inputAttributes.help=a("rla.redis.address_example")),E.push(x);continue}P?S.push(x):b.push(x),x.model==="config-strategy"&&(P=!0)}}return{endsWithStrategy:{fields:b},redis:{fields:E},afterStrategy:{fields:S}}}),d=t.computed(()=>{const u=i.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,u)?n[u]:[]}),c=t.computed(()=>{var u,b;return(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(E=>E.model==="config-identifier")}),m=t.computed(()=>{var u,b,E;return(((E=(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(S=>S.model==="config-identifier"))==null?void 0:E.values)??[]).map(S=>({label:a(`rla.identifiers.options.${S}`),value:S}))}),p=t.ref(),g=t.ref(!0),M=t.computed(()=>{var u,b,E;return i.formModel["config-window_type"]??((E=(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(S=>S.model==="config-window_type"))==null?void 0:E.default)}),B=t.computed(()=>{var b,E,S,P,Z,me;const u=(S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(x=>x.model==="config-window_type"))==null?void 0:S.default;return(((me=(Z=(P=i.formSchema)==null?void 0:P.fields)==null?void 0:Z.find(x=>x.model==="config-window_type"))==null?void 0:me.values)??[]).sort((x,Be)=>x===u?-1:Be===u?1:0)}),_=t.computed(()=>{var b;const u=(b=i.formModel["config-limit"])==null?void 0:b.map((E,S)=>{var P,Z;return{limit:E,windowSize:(Z=(P=i.formModel)==null?void 0:P["config-window_size"])==null?void 0:Z[S]}});return!Array.isArray(u)||u.length===0?[{limit:void 0,windowSize:void 0}]:u}),k=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-identifier"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-identifier"))==null?void 0:S.default)}),f=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-error_code"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-error_code"))==null?void 0:S.default)}),w=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-error_message"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-error_message"))==null?void 0:S.default)}),O=(u,b)=>{if(b===p.value){i.onModelUpdated([],"config-limit"),i.onModelUpdated([],"config-window_size"),t.nextTick(()=>{p.value=void 0});return}i.onModelUpdated([u.config.limit],"config-limit"),i.onModelUpdated([u.config.window_size],"config-window_size"),t.nextTick(()=>{p.value=b})},F=u=>{p.value!==void 0&&(p.value=void 0),i.onModelUpdated(u.toString(),"config-window_type")},y=(u,b)=>{var S;p.value!==void 0&&(p.value=void 0);const E=re(((S=i.formModel)==null?void 0:S["config-limit"])??[]);E[u]=b,i.onModelUpdated(E,"config-limit")},h=(u,b)=>{var S;p.value!==void 0&&(p.value=void 0);const E=re(((S=i.formModel)==null?void 0:S["config-window_size"])??[]);E[u]=b,i.onModelUpdated(E,"config-window_size")},C=u=>{var S,P;p.value!==void 0&&(p.value=void 0);const b=re(((S=i.formModel)==null?void 0:S["config-limit"])??[]),E=re(((P=i.formModel)==null?void 0:P["config-window_size"])??[]);b.length===0&&b.push(void 0),E.length===0&&E.push(void 0),b.splice(u+1,0,void 0),E.splice(u+1,0,void 0),i.onModelUpdated(b,"config-limit"),i.onModelUpdated(E,"config-window_size")},U=u=>{var b,E;if(_.value.length>1){p.value!==void 0&&(p.value=void 0);const S=re(((b=i.formModel)==null?void 0:b["config-limit"])??[]),P=re(((E=i.formModel)==null?void 0:E["config-window_size"])??[]);S.length===0&&S.push(void 0),P.length===0&&P.push(void 0),S.splice(u,1),P.splice(u,1),i.onModelUpdated(S,"config-limit"),i.onModelUpdated(P,"config-window_size")}};return(u,b)=>{const E=t.resolveComponent("VueFormGenerator"),S=t.resolveComponent("KLabel"),P=t.resolveComponent("KRadio"),Z=t.resolveComponent("KInput"),me=t.resolveComponent("KButton"),x=t.resolveComponent("KBadge"),Be=t.resolveComponent("KTooltip"),bo=t.resolveComponent("KCard"),Xh=t.resolveComponent("KSelect"),Qh=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Ah,[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:s.value,onModelUpdated:b[0]||(b[0]=(V,z)=>u.onModelUpdated(V,z))},null,8,["model","options","schema"]),t.createVNode(bo,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(S,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",required:""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",Oh,t.toDisplayString(t.unref(a)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Fh,[t.createElementVNode("div",Uh,[t.createVNode(S,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(a)("rla.window_type.help")},null,8,Dh)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",Lh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,V=>(t.openBlock(),t.createBlock(P,{key:`window-type-${V}`,"model-value":M.value,name:V,"selected-value":V,"onUpdate:modelValue":F},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)(`rla.window_type.options.${V}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",vh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(V,z)=>(t.openBlock(),t.createElementBlock("div",{key:z.toString()},[t.createVNode(S,{for:`rla-form-request-limits-item-${z}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.request_limits.label_index",{index:z+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Ph,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${z}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(Z,{"model-value":V.limit&&V.limit.toString(),placeholder:t.unref(a)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":$t=>y(z,Number.parseInt($t))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.interval_determiner")),1),t.createVNode(Z,{"model-value":V.windowSize&&V.windowSize.toString(),placeholder:t.unref(a)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":$t=>h(z,Number.parseInt($t))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.seconds")),1)],8,qh),t.createElementVNode("div",Rh,[t.createVNode(me,{appearance:"tertiary",disabled:_.value.length<=1,onClick:()=>U(z)},{default:t.withCtx(()=>[t.createVNode(t.unref(rm))]),_:2},1032,["disabled","onClick"]),t.createVNode(me,{appearance:"tertiary",onClick:()=>C(z)},{default:t.withCtx(()=>[t.createVNode(t.unref(lo))]),_:2},1032,["onClick"])])])]))),128))]),d.value.length>0?(t.openBlock(),t.createElementBlock("div",zh,[t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.start_with_a_use_case")),1),t.createElementVNode("div",jh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(V,z)=>(t.openBlock(),t.createBlock(Be,{key:`use-case-${z}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(V.description),1),xh,t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.label"))+": "+t.toDisplayString(V.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.time_interval"))+": "+t.toDisplayString(V.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(x,{appearance:p.value===`${M.value}-${z}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>O(V,`${M.value}-${z}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Xh,{modelValue:k.value,"onUpdate:modelValue":b[1]||(b[1]=V=>k.value=V),class:"rla-form-identifiers",items:m.value,label:t.unref(a)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:b[2]||(b[2]=V=>i.onModelUpdated(V.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:c.value&&c.value.help},null,8,Kh)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(S,{for:"rla-form-error-legend",info:t.unref(a)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",Hh,[t.createVNode(Z,{class:"input-error-code","model-value":f.value&&f.value.toString(),placeholder:t.unref(a)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":b[3]||(b[3]=V=>u.onModelUpdated(Number.parseInt(V),"config-error_code"))},null,8,["model-value","placeholder"]),Yh,t.createVNode(Z,{"model-value":w.value,placeholder:t.unref(a)("rla.error_message.message_placeholder"),"onUpdate:modelValue":b[4]||(b[4]=V=>u.onModelUpdated(V,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(Qh,{modelValue:g.value,"onUpdate:modelValue":b[8]||(b[8]=V=>g.value=V),"trigger-label":t.unref(a)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:b[5]||(b[5]=(V,z)=>u.onModelUpdated(V,z))},null,8,["model","options","schema"]),u.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(bo,{key:0,class:"rla-form-redis-card",title:t.unref(a)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.redis,onModelUpdated:b[6]||(b[6]=(V,z)=>u.onModelUpdated(V,z))},null,8,["model","options","schema"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.afterStrategy,onModelUpdated:b[7]||(b[7]=(V,z)=>u.onModelUpdated(V,z))},null,8,["model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-672119f6"]])},Symbol.toStringTag,{value:"Module"})),Wh=["array","metric","advanced","selectionGroup","object-advanced"],Zh={install:e=>{e.component("VueFormGenerator",Y)}},Jh=(e,n)=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer",...(n==null?void 0:n.useRLARedesignedForm)&&{"rate-limiting-advanced":"RLAForm"}})[e];D.FORMS_API_KEY=ce,D.VueFormGenerator=Y,D.abstractField=cs,D.customFields=Wh,D.default=Zh,D.getSharedFormName=Jh,D.sharedForms=Gh,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
3
+ will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`,config:{limit:500,window_size:3600}}]},o=new Set(["selectionGroup",...["identifier","limit","window_size","error_code","error_message"].map(u=>`config-${u}`)]),r=u=>u===void 0?!1:o.has(u),{t:a}=Qe.createI18n("en-us",Tt),i=e,s=t.computed(()=>{var b,E;const u=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(S=>S.type==="selectionGroup"&&S.model==="selectionGroup");if(u)return{fields:[{...u,horizontalRadios:!0}]}}),l=t.computed(()=>{var Z,me;const u=((me=(Z=i.formSchema)==null?void 0:Z.fields)==null?void 0:me.filter(x=>!r(x.model)))??[],b=[],E=[],S=[];let P=!1;for(const x of u){const Be=x.model;if(Be!==void 0){if(Be.startsWith("config-redis-")){(x.model==="config-redis-cluster_addresses"||x.model==="config-redis-sentinel_addresses")&&(x.inputAttributes.help=a("rla.redis.address_example")),E.push(x);continue}P?S.push(x):b.push(x),x.model==="config-strategy"&&(P=!0)}}return{endsWithStrategy:{fields:b},redis:{fields:E},afterStrategy:{fields:S}}}),d=t.computed(()=>{const u=i.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,u)?n[u]:[]}),c=t.computed(()=>{var u,b;return(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(E=>E.model==="config-identifier")}),m=t.computed(()=>{var u,b,E;return(((E=(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(S=>S.model==="config-identifier"))==null?void 0:E.values)??[]).map(S=>({label:a(`rla.identifiers.options.${S}`),value:S}))}),p=t.ref(),g=t.ref(!0),M=t.computed(()=>{var u,b,E;return i.formModel["config-window_type"]??((E=(b=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:b.find(S=>S.model==="config-window_type"))==null?void 0:E.default)}),B=t.computed(()=>{var b,E,S,P,Z,me;const u=(S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(x=>x.model==="config-window_type"))==null?void 0:S.default;return(((me=(Z=(P=i.formSchema)==null?void 0:P.fields)==null?void 0:Z.find(x=>x.model==="config-window_type"))==null?void 0:me.values)??[]).sort((x,Be)=>x===u?-1:Be===u?1:0)}),_=t.computed(()=>{var b;const u=(b=i.formModel["config-limit"])==null?void 0:b.map((E,S)=>{var P,Z;return{limit:E,windowSize:(Z=(P=i.formModel)==null?void 0:P["config-window_size"])==null?void 0:Z[S]}});return!Array.isArray(u)||u.length===0?[{limit:void 0,windowSize:void 0}]:u}),k=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-identifier"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-identifier"))==null?void 0:S.default)}),f=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-error_code"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-error_code"))==null?void 0:S.default)}),w=t.computed(()=>{var u,b,E,S;return((u=i.formModel)==null?void 0:u["config-error_message"])??((S=(E=(b=i.formSchema)==null?void 0:b.fields)==null?void 0:E.find(P=>P.model==="config-error_message"))==null?void 0:S.default)}),O=(u,b)=>{if(b===p.value){i.onModelUpdated([],"config-limit"),i.onModelUpdated([],"config-window_size"),t.nextTick(()=>{p.value=void 0});return}i.onModelUpdated([u.config.limit],"config-limit"),i.onModelUpdated([u.config.window_size],"config-window_size"),t.nextTick(()=>{p.value=b})},F=u=>{p.value!==void 0&&(p.value=void 0),i.onModelUpdated(u.toString(),"config-window_type")},y=(u,b)=>{var S;p.value!==void 0&&(p.value=void 0);const E=re(((S=i.formModel)==null?void 0:S["config-limit"])??[]);E[u]=b,i.onModelUpdated(E,"config-limit")},h=(u,b)=>{var S;p.value!==void 0&&(p.value=void 0);const E=re(((S=i.formModel)==null?void 0:S["config-window_size"])??[]);E[u]=b,i.onModelUpdated(E,"config-window_size")},C=u=>{var S,P;p.value!==void 0&&(p.value=void 0);const b=re(((S=i.formModel)==null?void 0:S["config-limit"])??[]),E=re(((P=i.formModel)==null?void 0:P["config-window_size"])??[]);b.length===0&&b.push(void 0),E.length===0&&E.push(void 0),b.splice(u+1,0,void 0),E.splice(u+1,0,void 0),i.onModelUpdated(b,"config-limit"),i.onModelUpdated(E,"config-window_size")},U=u=>{var b,E;if(_.value.length>1){p.value!==void 0&&(p.value=void 0);const S=re(((b=i.formModel)==null?void 0:b["config-limit"])??[]),P=re(((E=i.formModel)==null?void 0:E["config-window_size"])??[]);S.length===0&&S.push(void 0),P.length===0&&P.push(void 0),S.splice(u,1),P.splice(u,1),i.onModelUpdated(S,"config-limit"),i.onModelUpdated(P,"config-window_size")}};return(u,b)=>{const E=t.resolveComponent("VueFormGenerator"),S=t.resolveComponent("KLabel"),P=t.resolveComponent("KRadio"),Z=t.resolveComponent("KInput"),me=t.resolveComponent("KButton"),x=t.resolveComponent("KBadge"),Be=t.resolveComponent("KTooltip"),bo=t.resolveComponent("KCard"),Xh=t.resolveComponent("KSelect"),Qh=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Ah,[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:s.value,onModelUpdated:b[0]||(b[0]=(V,j)=>u.onModelUpdated(V,j))},null,8,["model","options","schema"]),t.createVNode(bo,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(S,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",required:""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",Oh,t.toDisplayString(t.unref(a)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Fh,[t.createElementVNode("div",Uh,[t.createVNode(S,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(a)("rla.window_type.help")},null,8,Dh)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",Lh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,V=>(t.openBlock(),t.createBlock(P,{key:`window-type-${V}`,"model-value":M.value,name:V,"selected-value":V,"onUpdate:modelValue":F},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)(`rla.window_type.options.${V}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",vh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(V,j)=>(t.openBlock(),t.createElementBlock("div",{key:j.toString()},[t.createVNode(S,{for:`rla-form-request-limits-item-${j}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.request_limits.label_index",{index:j+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Ph,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${j}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(Z,{"model-value":V.limit&&V.limit.toString(),placeholder:t.unref(a)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":$t=>y(j,Number.parseInt($t))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.interval_determiner")),1),t.createVNode(Z,{"model-value":V.windowSize&&V.windowSize.toString(),placeholder:t.unref(a)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":$t=>h(j,Number.parseInt($t))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.seconds")),1)],8,qh),t.createElementVNode("div",Rh,[t.createVNode(me,{appearance:"tertiary",disabled:_.value.length<=1,onClick:()=>U(j)},{default:t.withCtx(()=>[t.createVNode(t.unref(rm))]),_:2},1032,["disabled","onClick"]),t.createVNode(me,{appearance:"tertiary",onClick:()=>C(j)},{default:t.withCtx(()=>[t.createVNode(t.unref(lo))]),_:2},1032,["onClick"])])])]))),128))]),d.value.length>0?(t.openBlock(),t.createElementBlock("div",jh,[t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.start_with_a_use_case")),1),t.createElementVNode("div",zh,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(V,j)=>(t.openBlock(),t.createBlock(Be,{key:`use-case-${j}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(V.description),1),xh,t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.label"))+": "+t.toDisplayString(V.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.time_interval"))+": "+t.toDisplayString(V.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(x,{appearance:p.value===`${M.value}-${j}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>O(V,`${M.value}-${j}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Xh,{modelValue:k.value,"onUpdate:modelValue":b[1]||(b[1]=V=>k.value=V),class:"rla-form-identifiers",items:m.value,label:t.unref(a)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:b[2]||(b[2]=V=>i.onModelUpdated(V.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:c.value&&c.value.help},null,8,Kh)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(S,{for:"rla-form-error-legend",info:t.unref(a)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",Hh,[t.createVNode(Z,{class:"input-error-code","model-value":f.value&&f.value.toString(),placeholder:t.unref(a)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":b[3]||(b[3]=V=>u.onModelUpdated(Number.parseInt(V),"config-error_code"))},null,8,["model-value","placeholder"]),Yh,t.createVNode(Z,{"model-value":w.value,placeholder:t.unref(a)("rla.error_message.message_placeholder"),"onUpdate:modelValue":b[4]||(b[4]=V=>u.onModelUpdated(V,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(Qh,{modelValue:g.value,"onUpdate:modelValue":b[8]||(b[8]=V=>g.value=V),"trigger-label":t.unref(a)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:b[5]||(b[5]=(V,j)=>u.onModelUpdated(V,j))},null,8,["model","options","schema"]),u.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(bo,{key:0,class:"rla-form-redis-card",title:t.unref(a)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.redis,onModelUpdated:b[6]||(b[6]=(V,j)=>u.onModelUpdated(V,j))},null,8,["model","options","schema"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(E,{model:u.formModel,options:u.formOptions,schema:l.value.afterStrategy,onModelUpdated:b[7]||(b[7]=(V,j)=>u.onModelUpdated(V,j))},null,8,["model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-672119f6"]])},Symbol.toStringTag,{value:"Module"})),Wh=["array","metric","advanced","selectionGroup","object-advanced"],Zh={install:e=>{e.component("VueFormGenerator",Y)}},Jh=(e,n)=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer",...(n==null?void 0:n.useRLARedesignedForm)&&{"rate-limiting-advanced":"RLAForm"}})[e];D.FORMS_API_KEY=ce,D.VueFormGenerator=Y,D.abstractField=cs,D.customFields=Wh,D.default=Zh,D.getSharedFormName=Jh,D.sharedForms=Gh,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});