@kong-ui-public/forms 3.1.13 → 3.2.0
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.es.js +2614 -2038
- package/dist/forms.umd.js +3 -1
- package/dist/style.css +1 -1
- package/dist/types/forms/RLAForm.vue.d.ts +24 -0
- package/dist/types/forms/RLAForm.vue.d.ts.map +1 -0
- package/dist/types/forms/index.d.ts +1 -0
- package/dist/types/forms/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/forms.umd.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(function(M,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],n):(M=typeof globalThis<"u"?globalThis:M||self,n(M["kong-ui-public-forms"]={},M.Vue,M["kong-ui-public-i18n"]))})(this,function(M,n,ut){"use strict";function pt(e,t){for(var r=-1,o=e==null?0:e.length;++r<o&&t(e[r],r,e)!==!1;);return e}function ir(e){return function(t,r,o){for(var a=-1,i=Object(t),l=o(t),s=l.length;s--;){var d=l[e?s:++a];if(r(i[d],d,i)===!1)break}return t}}var ar=ir();const sr=ar;function lr(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}var ft=typeof global=="object"&&global&&global.Object===Object&&global,dr=typeof self=="object"&&self&&self.Object===Object&&self,z=ft||dr||Function("return this")(),K=z.Symbol,gt=Object.prototype,cr=gt.hasOwnProperty,mr=gt.toString,ye=K?K.toStringTag:void 0;function hr(e){var t=cr.call(e,ye),r=e[ye];try{e[ye]=void 0;var o=!0}catch{}var a=mr.call(e);return o&&(t?e[ye]=r:delete e[ye]),a}var ur=Object.prototype,pr=ur.toString;function fr(e){return pr.call(e)}var gr="[object Null]",yr="[object Undefined]",yt=K?K.toStringTag:void 0;function J(e){return e==null?e===void 0?yr:gr:yt&&yt in Object(e)?hr(e):fr(e)}function H(e){return e!=null&&typeof e=="object"}var br="[object Arguments]";function bt(e){return H(e)&&J(e)==br}var kt=Object.prototype,kr=kt.hasOwnProperty,_r=kt.propertyIsEnumerable,qe=bt(function(){return arguments}())?bt:function(e){return H(e)&&kr.call(e,"callee")&&!_r.call(e,"callee")},q=Array.isArray;function Cr(){return!1}var _t=typeof M=="object"&&M&&!M.nodeType&&M,Ct=_t&&typeof module=="object"&&module&&!module.nodeType&&module,wr=Ct&&Ct.exports===_t,wt=wr?z.Buffer:void 0,Er=wt?wt.isBuffer:void 0,be=Er||Cr,Tr=9007199254740991,Sr=/^(?:0|[1-9]\d*)$/;function ze(e,t){var r=typeof e;return t=t??Tr,!!t&&(r=="number"||r!="symbol"&&Sr.test(e))&&e>-1&&e%1==0&&e<t}var $r=9007199254740991;function xe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$r}var Br="[object Arguments]",Mr="[object Array]",Nr="[object Boolean]",Ir="[object Date]",Vr="[object Error]",Ar="[object Function]",Or="[object Map]",Fr="[object Number]",vr="[object Object]",Dr="[object RegExp]",Ur="[object Set]",Lr="[object String]",Pr="[object WeakMap]",jr="[object ArrayBuffer]",Rr="[object DataView]",qr="[object Float32Array]",zr="[object Float64Array]",xr="[object Int8Array]",Kr="[object Int16Array]",Hr="[object Int32Array]",Yr="[object Uint8Array]",Gr="[object Uint8ClampedArray]",Zr="[object Uint16Array]",Wr="[object Uint32Array]",I={};I[qr]=I[zr]=I[xr]=I[Kr]=I[Hr]=I[Yr]=I[Gr]=I[Zr]=I[Wr]=!0,I[Br]=I[Mr]=I[jr]=I[Nr]=I[Rr]=I[Ir]=I[Vr]=I[Ar]=I[Or]=I[Fr]=I[vr]=I[Dr]=I[Ur]=I[Lr]=I[Pr]=!1;function Jr(e){return H(e)&&xe(e.length)&&!!I[J(e)]}function Ke(e){return function(t){return e(t)}}var Et=typeof M=="object"&&M&&!M.nodeType&&M,ke=Et&&typeof module=="object"&&module&&!module.nodeType&&module,Xr=ke&&ke.exports===Et,He=Xr&&ft.process,me=function(){try{var e=ke&&ke.require&&ke.require("util").types;return e||He&&He.binding&&He.binding("util")}catch{}}(),Tt=me&&me.isTypedArray,Ye=Tt?Ke(Tt):Jr,Qr=Object.prototype,eo=Qr.hasOwnProperty;function St(e,t){var r=q(e),o=!r&&qe(e),a=!r&&!o&&be(e),i=!r&&!o&&!a&&Ye(e),l=r||o||a||i,s=l?lr(e.length,String):[],d=s.length;for(var c in e)(t||eo.call(e,c))&&!(l&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ze(c,d)))&&s.push(c);return s}var to=Object.prototype;function Me(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||to;return e===r}function $t(e,t){return function(r){return e(t(r))}}var no=$t(Object.keys,Object),ro=Object.prototype,oo=ro.hasOwnProperty;function Bt(e){if(!Me(e))return no(e);var t=[];for(var r in Object(e))oo.call(e,r)&&r!="constructor"&&t.push(r);return t}function D(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var io="[object AsyncFunction]",ao="[object Function]",so="[object GeneratorFunction]",lo="[object Proxy]";function T(e){if(!D(e))return!1;var t=J(e);return t==ao||t==so||t==io||t==lo}function he(e){return e!=null&&xe(e.length)&&!T(e)}function ue(e){return he(e)?St(e):Bt(e)}function co(e,t){return e&&sr(e,t,ue)}function mo(e,t){return function(r,o){if(r==null)return r;if(!he(r))return e(r,o);for(var a=r.length,i=t?a:-1,l=Object(r);(t?i--:++i<a)&&o(l[i],i,l)!==!1;);return r}}var ho=mo(co);const uo=ho;function Ne(e){return e}function po(e){return typeof e=="function"?e:Ne}function P(e,t){var r=q(e)?pt:uo;return r(e,po(t))}var fo="[object Symbol]";function Ie(e){return typeof e=="symbol"||H(e)&&J(e)==fo}var go=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yo=/^\w*$/;function Ge(e,t){if(q(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Ie(e)?!0:yo.test(e)||!go.test(e)||t!=null&&e in Object(t)}var Ze=z["__core-js_shared__"],Mt=function(){var e=/[^.]+$/.exec(Ze&&Ze.keys&&Ze.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bo(e){return!!Mt&&Mt in e}var ko=Function.prototype,_o=ko.toString;function ne(e){if(e!=null){try{return _o.call(e)}catch{}try{return e+""}catch{}}return""}var Co=/[\\^$.*+?()[\]{}|]/g,wo=/^\[object .+?Constructor\]$/,Eo=Function.prototype,To=Object.prototype,So=Eo.toString,$o=To.hasOwnProperty,Bo=RegExp("^"+So.call($o).replace(Co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mo(e){if(!D(e)||bo(e))return!1;var t=T(e)?Bo:wo;return t.test(ne(e))}function No(e,t){return e==null?void 0:e[t]}function re(e,t){var r=No(e,t);return Mo(r)?r:void 0}var _e=re(Object,"create");function Io(){this.__data__=_e?_e(null):{},this.size=0}function Vo(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ao="__lodash_hash_undefined__",Oo=Object.prototype,Fo=Oo.hasOwnProperty;function vo(e){var t=this.__data__;if(_e){var r=t[e];return r===Ao?void 0:r}return Fo.call(t,e)?t[e]:void 0}var Do=Object.prototype,Uo=Do.hasOwnProperty;function Lo(e){var t=this.__data__;return _e?t[e]!==void 0:Uo.call(t,e)}var Po="__lodash_hash_undefined__";function jo(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_e&&t===void 0?Po:t,this}function oe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}oe.prototype.clear=Io,oe.prototype.delete=Vo,oe.prototype.get=vo,oe.prototype.has=Lo,oe.prototype.set=jo;function Ro(){this.__data__=[],this.size=0}function Ce(e,t){return e===t||e!==e&&t!==t}function Ve(e,t){for(var r=e.length;r--;)if(Ce(e[r][0],t))return r;return-1}var qo=Array.prototype,zo=qo.splice;function xo(e){var t=this.__data__,r=Ve(t,e);if(r<0)return!1;var o=t.length-1;return r==o?t.pop():zo.call(t,r,1),--this.size,!0}function Ko(e){var t=this.__data__,r=Ve(t,e);return r<0?void 0:t[r][1]}function Ho(e){return Ve(this.__data__,e)>-1}function Yo(e,t){var r=this.__data__,o=Ve(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}function Z(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}Z.prototype.clear=Ro,Z.prototype.delete=xo,Z.prototype.get=Ko,Z.prototype.has=Ho,Z.prototype.set=Yo;var we=re(z,"Map");function Go(){this.size=0,this.__data__={hash:new oe,map:new(we||Z),string:new oe}}function Zo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ae(e,t){var r=e.__data__;return Zo(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Wo(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t}function Jo(e){return Ae(this,e).get(e)}function Xo(e){return Ae(this,e).has(e)}function Qo(e,t){var r=Ae(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}function W(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}W.prototype.clear=Go,W.prototype.delete=Wo,W.prototype.get=Jo,W.prototype.has=Xo,W.prototype.set=Qo;var ei="Expected a function";function We(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ei);var r=function(){var o=arguments,a=t?t.apply(this,o):o[0],i=r.cache;if(i.has(a))return i.get(a);var l=e.apply(this,o);return r.cache=i.set(a,l)||i,l};return r.cache=new(We.Cache||W),r}We.Cache=W;var ti=500;function ni(e){var t=We(e,function(o){return r.size===ti&&r.clear(),o}),r=t.cache;return t}var ri=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oi=/\\(\\)?/g,ii=ni(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ri,function(r,o,a,i){t.push(a?i.replace(oi,"$1"):o||r)}),t});function ai(e,t){for(var r=-1,o=e==null?0:e.length,a=Array(o);++r<o;)a[r]=t(e[r],r,e);return a}var si=1/0,Nt=K?K.prototype:void 0,It=Nt?Nt.toString:void 0;function Vt(e){if(typeof e=="string")return e;if(q(e))return ai(e,Vt)+"";if(Ie(e))return It?It.call(e):"";var t=e+"";return t=="0"&&1/e==-si?"-0":t}function At(e){return e==null?"":Vt(e)}function Ot(e,t){return q(e)?e:Ge(e,t)?[e]:ii(At(e))}var li=1/0;function Oe(e){if(typeof e=="string"||Ie(e))return e;var t=e+"";return t=="0"&&1/e==-li?"-0":t}function Ft(e,t){t=Ot(t,e);for(var r=0,o=t.length;e!=null&&r<o;)e=e[Oe(t[r++])];return r&&r==o?e:void 0}function w(e,t,r){var o=e==null?void 0:Ft(e,t);return o===void 0?r:o}function v(e){return e==null}var di="[object String]";function ie(e){return typeof e=="string"||!q(e)&&H(e)&&J(e)==di}const vt={methods:{getFieldRowClasses(e){const t=this.fieldErrors(e).length>0,r={[w(this.options,"validationErrorClass","error")]:t,[w(this.options,"validationSuccessClass","valid")]:!t,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?P(e.styleClasses,o=>r[o]=!0):ie(e.styleClasses)&&(r[e.styleClasses]=!0),v(e.type)||(r["field-"+e.type]=!0),r},fieldErrors(e){return this.errors.filter(r=>r.field.fieldName===e.fieldName).map(r=>r.error)},fieldDisabled(e){return T(e.disabled)?e.disabled.call(this,this.model,e,this):v(e.disabled)?!1:e.disabled},fieldReadonly(e){return T(e.readonly)?e.readonly.call(this,this.model,e,this):v(e.readonly)?!1:e.readonly},fieldFeatured(e){return T(e.featured)?e.featured.call(this,this.model,e,this):v(e.featured)?!1:e.featured},fieldRequired(e){return T(e.required)?e.required.call(this,this.model,e,this):v(e.required)?!1:e.required}}};function ci(){this.__data__=new Z,this.size=0}function mi(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function hi(e){return this.__data__.get(e)}function ui(e){return this.__data__.has(e)}var pi=200;function fi(e,t){var r=this.__data__;if(r instanceof Z){var o=r.__data__;if(!we||o.length<pi-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new W(o)}return r.set(e,t),this.size=r.size,this}function Y(e){var t=this.__data__=new Z(e);this.size=t.size}Y.prototype.clear=ci,Y.prototype.delete=mi,Y.prototype.get=hi,Y.prototype.has=ui,Y.prototype.set=fi;var Fe=function(){try{var e=re(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Dt(e,t,r){t=="__proto__"&&Fe?Fe(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var gi=Object.prototype,yi=gi.hasOwnProperty;function Ut(e,t,r){var o=e[t];(!(yi.call(e,t)&&Ce(o,r))||r===void 0&&!(t in e))&&Dt(e,t,r)}function ve(e,t,r,o){var a=!r;r||(r={});for(var i=-1,l=t.length;++i<l;){var s=t[i],d=o?o(r[s],e[s],s,r,e):void 0;d===void 0&&(d=e[s]),a?Dt(r,s,d):Ut(r,s,d)}return r}function bi(e,t){return e&&ve(t,ue(t),e)}function ki(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var _i=Object.prototype,Ci=_i.hasOwnProperty;function wi(e){if(!D(e))return ki(e);var t=Me(e),r=[];for(var o in e)o=="constructor"&&(t||!Ci.call(e,o))||r.push(o);return r}function De(e){return he(e)?St(e,!0):wi(e)}function Ei(e,t){return e&&ve(t,De(t),e)}var Lt=typeof M=="object"&&M&&!M.nodeType&&M,Pt=Lt&&typeof module=="object"&&module&&!module.nodeType&&module,Ti=Pt&&Pt.exports===Lt,jt=Ti?z.Buffer:void 0,Rt=jt?jt.allocUnsafe:void 0;function Si(e,t){if(t)return e.slice();var r=e.length,o=Rt?Rt(r):new e.constructor(r);return e.copy(o),o}function $i(e,t){var r=-1,o=e.length;for(t||(t=Array(o));++r<o;)t[r]=e[r];return t}function Bi(e,t){for(var r=-1,o=e==null?0:e.length,a=0,i=[];++r<o;){var l=e[r];t(l,r,e)&&(i[a++]=l)}return i}function qt(){return[]}var Mi=Object.prototype,Ni=Mi.propertyIsEnumerable,zt=Object.getOwnPropertySymbols,Je=zt?function(e){return e==null?[]:(e=Object(e),Bi(zt(e),function(t){return Ni.call(e,t)}))}:qt;function Ii(e,t){return ve(e,Je(e),t)}function xt(e,t){for(var r=-1,o=t.length,a=e.length;++r<o;)e[a+r]=t[r];return e}var Vi=$t(Object.getPrototypeOf,Object);const Kt=Vi;var Ai=Object.getOwnPropertySymbols,Ht=Ai?function(e){for(var t=[];e;)xt(t,Je(e)),e=Kt(e);return t}:qt;function Oi(e,t){return ve(e,Ht(e),t)}function Yt(e,t,r){var o=t(e);return q(e)?o:xt(o,r(e))}function Xe(e){return Yt(e,ue,Je)}function Fi(e){return Yt(e,De,Ht)}var Qe=re(z,"DataView"),et=re(z,"Promise"),pe=re(z,"Set"),tt=re(z,"WeakMap"),Gt="[object Map]",vi="[object Object]",Zt="[object Promise]",Wt="[object Set]",Jt="[object WeakMap]",Xt="[object DataView]",Di=ne(Qe),Ui=ne(we),Li=ne(et),Pi=ne(pe),ji=ne(tt),ae=J;(Qe&&ae(new Qe(new ArrayBuffer(1)))!=Xt||we&&ae(new we)!=Gt||et&&ae(et.resolve())!=Zt||pe&&ae(new pe)!=Wt||tt&&ae(new tt)!=Jt)&&(ae=function(e){var t=J(e),r=t==vi?e.constructor:void 0,o=r?ne(r):"";if(o)switch(o){case Di:return Xt;case Ui:return Gt;case Li:return Zt;case Pi:return Wt;case ji:return Jt}return t});const fe=ae;var Ri=Object.prototype,qi=Ri.hasOwnProperty;function zi(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&qi.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Ue=z.Uint8Array;function nt(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function xi(e,t){var r=t?nt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Ki=/\w*$/;function Hi(e){var t=new e.constructor(e.source,Ki.exec(e));return t.lastIndex=e.lastIndex,t}var Qt=K?K.prototype:void 0,en=Qt?Qt.valueOf:void 0;function Yi(e){return en?Object(en.call(e)):{}}function Gi(e,t){var r=t?nt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Zi="[object Boolean]",Wi="[object Date]",Ji="[object Map]",Xi="[object Number]",Qi="[object RegExp]",ea="[object Set]",ta="[object String]",na="[object Symbol]",ra="[object ArrayBuffer]",oa="[object DataView]",ia="[object Float32Array]",aa="[object Float64Array]",sa="[object Int8Array]",la="[object Int16Array]",da="[object Int32Array]",ca="[object Uint8Array]",ma="[object Uint8ClampedArray]",ha="[object Uint16Array]",ua="[object Uint32Array]";function pa(e,t,r){var o=e.constructor;switch(t){case ra:return nt(e);case Zi:case Wi:return new o(+e);case oa:return xi(e,r);case ia:case aa:case sa:case la:case da:case ca:case ma:case ha:case ua:return Gi(e,r);case Ji:return new o;case Xi:case ta:return new o(e);case Qi:return Hi(e);case ea:return new o;case na:return Yi(e)}}var tn=Object.create,fa=function(){function e(){}return function(t){if(!D(t))return{};if(tn)return tn(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ga(e){return typeof e.constructor=="function"&&!Me(e)?fa(Kt(e)):{}}var ya="[object Map]";function ba(e){return H(e)&&fe(e)==ya}var nn=me&&me.isMap,ka=nn?Ke(nn):ba,_a="[object Set]";function Ca(e){return H(e)&&fe(e)==_a}var rn=me&&me.isSet,wa=rn?Ke(rn):Ca,Ea=1,Ta=2,Sa=4,on="[object Arguments]",$a="[object Array]",Ba="[object Boolean]",Ma="[object Date]",Na="[object Error]",an="[object Function]",Ia="[object GeneratorFunction]",Va="[object Map]",Aa="[object Number]",sn="[object Object]",Oa="[object RegExp]",Fa="[object Set]",va="[object String]",Da="[object Symbol]",Ua="[object WeakMap]",La="[object ArrayBuffer]",Pa="[object DataView]",ja="[object Float32Array]",Ra="[object Float64Array]",qa="[object Int8Array]",za="[object Int16Array]",xa="[object Int32Array]",Ka="[object Uint8Array]",Ha="[object Uint8ClampedArray]",Ya="[object Uint16Array]",Ga="[object Uint32Array]",N={};N[on]=N[$a]=N[La]=N[Pa]=N[Ba]=N[Ma]=N[ja]=N[Ra]=N[qa]=N[za]=N[xa]=N[Va]=N[Aa]=N[sn]=N[Oa]=N[Fa]=N[va]=N[Da]=N[Ka]=N[Ha]=N[Ya]=N[Ga]=!0,N[Na]=N[an]=N[Ua]=!1;function Ee(e,t,r,o,a,i){var l,s=t&Ea,d=t&Ta,c=t&Sa;if(r&&(l=a?r(e,o,a,i):r(e)),l!==void 0)return l;if(!D(e))return e;var m=q(e);if(m){if(l=zi(e),!s)return $i(e,l)}else{var g=fe(e),f=g==an||g==Ia;if(be(e))return Si(e,s);if(g==sn||g==on||f&&!a){if(l=d||f?{}:ga(e),!s)return d?Oi(e,Ei(l,e)):Ii(e,bi(l,e))}else{if(!N[g])return a?e:{};l=pa(e,g,s)}}i||(i=new Y);var S=i.get(e);if(S)return S;i.set(e,l),wa(e)?e.forEach(function(k){l.add(Ee(k,t,r,k,e,i))}):ka(e)&&e.forEach(function(k,u){l.set(u,Ee(k,t,r,u,e,i))});var E=c?d?Fi:Xe:d?De:ue,y=m?void 0:E(e);return pt(y||e,function(k,u){y&&(u=k,k=e[u]),Ut(l,u,Ee(k,t,r,u,e,i))}),l}var Za=1,Wa=4;function rt(e){return Ee(e,Za|Wa)}const ot=(e,t="")=>typeof e.id<"u"?t+e.id:t+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),ln=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var it=function(){return z.Date.now()},Ja=/\s/;function Xa(e){for(var t=e.length;t--&&Ja.test(e.charAt(t)););return t}var Qa=/^\s+/;function es(e){return e&&e.slice(0,Xa(e)+1).replace(Qa,"")}var dn=NaN,ts=/^[-+]0x[0-9a-f]+$/i,ns=/^0b[01]+$/i,rs=/^0o[0-7]+$/i,os=parseInt;function at(e){if(typeof e=="number")return e;if(Ie(e))return dn;if(D(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=D(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=es(e);var r=ns.test(e);return r||rs.test(e)?os(e.slice(2),r?2:8):ts.test(e)?dn:+e}var is="Expected a function",as=Math.max,ss=Math.min;function Te(e,t,r){var o,a,i,l,s,d,c=0,m=!1,g=!1,f=!0;if(typeof e!="function")throw new TypeError(is);t=at(t)||0,D(r)&&(m=!!r.leading,g="maxWait"in r,i=g?as(at(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f);function S(h){var _=o,O=a;return o=a=void 0,c=h,l=e.apply(O,_),l}function E(h){return c=h,s=setTimeout(u,t),m?S(h):l}function y(h){var _=h-d,O=h-c,L=t-_;return g?ss(L,i-O):L}function k(h){var _=h-d,O=h-c;return d===void 0||_>=t||_<0||g&&O>=i}function u(){var h=it();if(k(h))return b(h);s=setTimeout(u,y(h))}function b(h){return s=void 0,f&&o?S(h):(o=a=void 0,l)}function V(){s!==void 0&&clearTimeout(s),c=0,o=d=a=s=void 0}function A(){return s===void 0?l:b(it())}function p(){var h=it(),_=k(h);if(o=arguments,a=this,d=h,_){if(s===void 0)return E(d);if(g)return clearTimeout(s),s=setTimeout(u,t),S(d)}return s===void 0&&(s=setTimeout(u,t)),l}return p.cancel=V,p.flush=A,p}var ls="__lodash_hash_undefined__";function ds(e){return this.__data__.set(e,ls),this}function cs(e){return this.__data__.has(e)}function Se(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new W;++t<r;)this.add(e[t])}Se.prototype.add=Se.prototype.push=ds,Se.prototype.has=cs;function cn(e,t,r,o){for(var a=e.length,i=r+(o?1:-1);o?i--:++i<a;)if(t(e[i],i,e))return i;return-1}function ms(e){return e!==e}function hs(e,t,r){for(var o=r-1,a=e.length;++o<a;)if(e[o]===t)return o;return-1}function us(e,t,r){return t===t?hs(e,t,r):cn(e,ms,r)}function ps(e,t){var r=e==null?0:e.length;return!!r&&us(e,t,0)>-1}function fs(e,t,r){for(var o=-1,a=e==null?0:e.length;++o<a;)if(r(t,e[o]))return!0;return!1}function mn(e,t){return e.has(t)}function gs(){}function st(e){var t=-1,r=Array(e.size);return e.forEach(function(o){r[++t]=o}),r}var ys=1/0,bs=pe&&1/st(new pe([,-0]))[1]==ys?function(e){return new pe(e)}:gs,ks=200;function _s(e,t,r){var o=-1,a=ps,i=e.length,l=!0,s=[],d=s;if(r)l=!1,a=fs;else if(i>=ks){var c=t?null:bs(e);if(c)return st(c);l=!1,a=mn,d=new Se}else d=t?[]:s;e:for(;++o<i;){var m=e[o],g=t?t(m):m;if(m=r||m!==0?m:0,l&&g===g){for(var f=d.length;f--;)if(d[f]===g)continue e;t&&d.push(g),s.push(m)}else a(d,g,r)||(d!==s&&d.push(g),s.push(m))}return s}function hn(e){return e&&e.length?_s(e):[]}var Cs=0;function un(e){var t=++Cs;return At(e)+t}function ws(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var pn=Math.max;function Es(e,t,r){return t=pn(t===void 0?e.length-1:t,0),function(){for(var o=arguments,a=-1,i=pn(o.length-t,0),l=Array(i);++a<i;)l[a]=o[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=o[a];return s[t]=r(l),ws(e,this,s)}}function Ts(e){return function(){return e}}var Ss=Fe?function(e,t){return Fe(e,"toString",{configurable:!0,enumerable:!1,value:Ts(t),writable:!0})}:Ne;const $s=Ss;var Bs=800,Ms=16,Ns=Date.now;function Is(e){var t=0,r=0;return function(){var o=Ns(),a=Ms-(o-r);if(r=o,a>0){if(++t>=Bs)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Vs=Is($s);function As(e,t){return Vs(Es(e,t,Ne),e+"")}function Os(e,t,r){if(!D(r))return!1;var o=typeof t;return(o=="number"?he(r)&&ze(t,r.length):o=="string"&&t in r)?Ce(r[t],e):!1}var fn=Object.prototype,Fs=fn.hasOwnProperty,X=As(function(e,t){e=Object(e);var r=-1,o=t.length,a=o>2?t[2]:void 0;for(a&&Os(t[0],t[1],a)&&(o=1);++r<o;)for(var i=t[r],l=De(i),s=-1,d=l.length;++s<d;){var c=l[s],m=e[c];(m===void 0||Ce(m,fn[c])&&!Fs.call(e,c))&&(e[c]=i[c])}return e}),vs=z.isFinite;function Ds(e){return typeof e=="number"&&vs(e)}var gn=1/0,Us=17976931348623157e292;function Ls(e){if(!e)return e===0?e:0;if(e=at(e),e===gn||e===-gn){var t=e<0?-1:1;return t*Us}return e===e?e:0}function yn(e){var t=Ls(e),r=t%1;return t===t?r?t-r:t:0}function Ps(e){return typeof e=="number"&&e==yn(e)}var js="[object Number]";function lt(e){return typeof e=="number"||H(e)&&J(e)==js}var bn=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Q="\\d\\d?",ee="\\d\\d",Rs="\\d{3}",qs="\\d{4}",$e="[^\\s]+",kn=/\[([^]*?)\]/gm;function _n(e,t){for(var r=[],o=0,a=e.length;o<a;o++)r.push(e[o].substr(0,t));return r}var Cn=function(e){return function(t,r){var o=r[e].map(function(i){return i.toLowerCase()}),a=o.indexOf(t.toLowerCase());return a>-1?a:null}};function se(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var o=0,a=t;o<a.length;o++){var i=a[o];for(var l in i)e[l]=i[l]}return e}var wn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],En=["January","February","March","April","May","June","July","August","September","October","November","December"],zs=_n(En,3),xs=_n(wn,3),Tn={dayNamesShort:xs,dayNames:wn,monthNamesShort:zs,monthNames:En,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Le=se({},Tn),Ks=function(e){return Le=se(Le,e)},Sn=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},R=function(e,t){for(t===void 0&&(t=2),e=String(e);e.length<t;)e="0"+e;return e},Hs={D:function(e){return String(e.getDate())},DD:function(e){return R(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return R(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return R(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return R(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return R(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return R(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return R(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return R(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return R(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return R(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return R(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+R(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+R(Math.floor(Math.abs(t)/60),2)+":"+R(Math.abs(t)%60,2)}},$n=function(e){return+e-1},Bn=[null,Q],Mn=[null,$e],Nn=["isPm",$e,function(e,t){var r=e.toLowerCase();return r===t.amPm[0]?0:r===t.amPm[1]?1:null}],In=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var r=+t[1]*60+parseInt(t[2],10);return t[0]==="+"?r:-r}return 0}],Ys={D:["day",Q],DD:["day",ee],Do:["day",Q+$e,function(e){return parseInt(e,10)}],M:["month",Q,$n],MM:["month",ee,$n],YY:["year",ee,function(e){var t=new Date,r=+(""+t.getFullYear()).substr(0,2);return+(""+(+e>68?r-1:r)+e)}],h:["hour",Q,void 0,"isPm"],hh:["hour",ee,void 0,"isPm"],H:["hour",Q],HH:["hour",ee],m:["minute",Q],mm:["minute",ee],s:["second",Q],ss:["second",ee],YYYY:["year",qs],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",ee,function(e){return+e*10}],SSS:["millisecond",Rs],d:Bn,dd:Bn,ddd:Mn,dddd:Mn,MMM:["month",$e,Cn("monthNamesShort")],MMMM:["month",$e,Cn("monthNames")],a:Nn,A:Nn,ZZ:In,Z:In},Pe={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"},Gs=function(e){return se(Pe,e)},Zs=function(e,t,r){if(t===void 0&&(t=Pe.default),r===void 0&&(r={}),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");t=Pe[t]||t;var o=[];t=t.replace(kn,function(i,l){return o.push(l),"@@@"});var a=se(se({},Le),r);return t=t.replace(bn,function(i){return Hs[i](e,a)}),t.replace(/@@@/g,function(){return o.shift()})};function Ws(e,t,r){if(r===void 0&&(r={}),typeof t!="string")throw new Error("Invalid format in fecha parse");if(t=Pe[t]||t,e.length>1e3)return null;var o=new Date,a={year:o.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],l=[],s=t.replace(kn,function(A,p){return l.push(Sn(p)),"@@@"}),d={},c={};s=Sn(s).replace(bn,function(A){var p=Ys[A],h=p[0],_=p[1],O=p[3];if(d[h])throw new Error("Invalid format. "+h+" specified twice in format");return d[h]=!0,O&&(c[O]=!0),i.push(p),"("+_+")"}),Object.keys(c).forEach(function(A){if(!d[A])throw new Error("Invalid format. "+A+" is required in specified format")}),s=s.replace(/@@@/g,function(){return l.shift()});var m=e.match(new RegExp(s,"i"));if(!m)return null;for(var g=se(se({},Le),r),f=1;f<m.length;f++){var S=i[f-1],E=S[0],y=S[2],k=y?y(m[f],g):+m[f];if(k==null)return null;a[E]=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 u;if(a.timezoneOffset==null){u=new Date(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond);for(var b=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],f=0,V=b.length;f<V;f++)if(d[b[f][0]]&&a[b[f][0]]!==u[b[f][1]]())return null}else if(u=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 u}var G={format:Zs,parse:Ws,defaultI18n:Tn,setGlobalDateI18n:Ks,setGlobalDateMasks:Gs};const U={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,t,r=U){return v(e)||e===""?t?[F(r.fieldIsRequired)]:[]:null}function F(e,...t){if(e!=null&&t.length>0)for(let r=0;r<t.length;r++)e=e.replace("{"+(r-1)+"}",t[r]);return e}const le={resources:U,required(e,t,r,o=U){return x(e,t.required,o)},number(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;const i=[];return Ds(e)?(!v(t.min)&&e<t.min&&i.push(F(o.numberTooSmall,t.min)),!v(t.max)&&e>t.max&&i.push(F(o.numberTooBig,t.max))):i.push(F(o.invalidNumber)),i},integer(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;const i=le.number(e,t,r,o);return Ps(e)||i.push(F(o.invalidInteger)),i},double(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;if(!lt(e)||isNaN(e))return[F(o.invalidNumber)]},string(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;const i=[];return ie(e)?(!v(t.min)&&e.length<t.min&&i.push(F(o.textTooSmall,e.length,t.min)),!v(t.max)&&e.length>t.max&&i.push(F(o.textTooBig,e.length,t.max))):i.push(F(o.thisNotText)),i},array(e,t,r,o=U){if(t.required){if(!Array.isArray(e))return[F(o.thisNotArray)];if(e.length===0)return[F(o.fieldIsRequired)]}if(!v(e)){if(!v(t.min)&&e.length<t.min)return[F(o.selectMinItems,t.min)];if(!v(t.max)&&e.length>t.max)return[F(o.selectMaxItems,t.max)]}},date(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;const i=new Date(e);if(isNaN(i.getDate()))return[F(o.invalidDate)];const l=[];if(!v(t.min)){const s=new Date(t.min);i.valueOf()<s.valueOf()&&l.push(F(o.dateIsEarly,G.format(i),G.format(s)))}if(!v(t.max)){const s=new Date(t.max);i.valueOf()>s.valueOf()&&l.push(F(o.dateIsLate,G.format(i),G.format(s)))}return l},regexp(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;if(!v(t.pattern)&&!new RegExp(t.pattern).test(e))return[F(o.invalidFormat)]},email(e,t,r,o=U){const a=x(e,t.required,o);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[F(o.invalidEmail)]},url(e,t,r,o=U){const a=x(e,t.required,o);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[F(o.invalidURL)]},creditCard(e,t,r,o=U){const a=x(e,t.required,o);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})$/,l=e.replace(/[^0-9]+/g,"");if(!i.test(l))return[F(o.invalidCard)];let s=0,d,c,m;for(let g=l.length-1;g>=0;g--)d=l.substring(g,g+1),c=parseInt(d,10),m?(c*=2,c>=10?s+=c%10+1:s+=c):s+=c,m=!m;if(!(s%10===0&&l))return[F(o.invalidCardNumber)]},alpha(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;if(!/^[a-zA-Z]*$/.test(e))return[F(o.invalidTextContainNumber)]},alphaNumeric(e,t,r,o=U){const a=x(e,t.required,o);if(a!=null)return a;if(!/^[a-zA-Z0-9]*$/.test(e))return[F(o.invalidTextContainSpec)]}};Object.keys(le).forEach(e=>{const t=le[e];T(t)&&(t.locale=r=>(o,a,i)=>t(o,a,i,X(r,U)))});function Vn(e){return ie(e)?le[e]!=null?le[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function dt(e,t,r){let o=w(r.context,"schema.attributes",{});const a=t.value||"input";ie(a)&&(o=w(o,a)||o),P(o,(i,l)=>{e.setAttribute(l,i)})}const B={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:dt,updated:dt,componentUpdated:dt}},computed:{value:{cache:!1,get(){let e;return T(w(this.schema,"get"))?e=this.schema.get(this.model):e=w(this.model,this.schema.model),this.formatValueToField(e)},set(e){const t=this.value;e=this.formatValueToModel(e),T(e)?e(e,t):this.updateModelValue(e,t)}}},methods:{validate(e){this.clearValidationErrors();const t=w(this.formOptions,"validateAsync",!1);let r=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const a=[];Array.isArray(this.schema.validator)?P(this.schema.validator,i=>{a.push(Vn(i).bind(this))}):a.push(Vn(this.schema.validator).bind(this)),P(a,i=>{if(t)r.push(i(this.value,this.schema,this.model));else{const l=i(this.value,this.schema,this.model);l&&T(l.then)?l.then(s=>{s&&(this.errors=this.errors.concat(s));const d=this.errors.length===0;this.$emit("validated",d,this.errors,this)}):l&&(r=r.concat(l))}})}const o=a=>{let i=[];P(hn(a),s=>{Array.isArray(s)&&s.length>0?i=i.concat(s):ie(s)&&i.push(s)}),T(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,i,this.schema);const l=i.length===0;return e||this.$emit("validated",l,i,this),this.errors=i,i};return t?Promise.all(r).then(o):o(r)},debouncedValidate(){T(this.debouncedValidateFunc)||(this.debouncedValidateFunc=Te(this.validate.bind(this),w(this.schema,"validateDebounceTime",w(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,t){let r=!1;T(this.schema.set)?(this.schema.set(this.model,e),r=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),r=!0),r&&(this.$emit("modelUpdated",e,this.schema.model),T(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,t,this.schema),w(this.formOptions,"validateAfterChanged",!1)===!0&&(w(this.schema,"validateDebounceTime",w(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,t){let r=e.replace(/\[(\w+)\]/g,".$1");r=r.replace(/^\./,"");let o=this.model;const a=r.split(".");let i=0;const l=a.length;for(;i<l;){const s=a[i];if(i<l-1)o[s]!==void 0||(o[s]={}),o=o[s];else{o[s]=t;return}++i}},getFieldID(e,t=!1){const r=w(this.formOptions,"fieldIdPrefix","");return ot(e,r)+(t?"-"+un():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return w(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},Js=Object.freeze(Object.defineProperty({__proto__:null,default:B},Symbol.toStringTag,{value:"Module"})),Xs={mixins:[B]},Qs=["id","autocomplete","disabled","name","required"];function el(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("input",{id:e.getFieldID(e.schema),type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=s=>e.value=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,class:n.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,Qs)),[[n.vModelCheckbox,e.value],[l,"input"]])}const C=(e,t)=>{const r=e.__vccOpts||e;for(const[o,a]of t)r[o]=a;return r},tl=C(Xs,[["render",el]]);var nl=4;function An(e){return Ee(e,nl)}const rl={class:"wrapper"},ol=["disabled"],il=["id","checked","disabled","onChange","name"],al=["disabled"],sl={class:"info"},ll=n.createElementVNode("div",{class:"arrow"},null,-1),dl={class:"dropList"},cl=["id","checked","disabled","onChange","name"];function ml(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("div",rl,[e.schema.listBox?(n.openBlock(),n.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.items,s=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["list-row",{"is-checked":i.isItemChecked(s)}])},[n.createElementVNode("label",null,[n.withDirectives(n.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(s)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,s),name:i.getInputName(s)},null,40,il),[[l,"input"]]),n.createTextVNode(n.toDisplayString(i.getItemName(s)),1)])],2))),256))],8,ol)):n.createCommentVNode("",!0),e.schema.listBox?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[n.createElementVNode("div",{class:n.normalizeClass(["mainRow",{expanded:a.comboExpanded}]),onClick:t[0]||(t[0]=(...s)=>i.onExpandCombo&&i.onExpandCombo(...s))},[n.createElementVNode("div",sl,n.toDisplayString(i.selectedCount)+" selected",1),ll],2),n.createElementVNode("div",dl,[a.comboExpanded?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(i.items,s=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["list-row",{"is-checked":i.isItemChecked(s)}])},[n.createElementVNode("label",null,[n.withDirectives(n.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(s)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,s),name:i.getInputName(s)},null,40,cl),[[l,"input"]]),n.createTextVNode(n.toDisplayString(i.getItemName(s)),1)])],2))),256)):n.createCommentVNode("",!0)])],8,al))])),[[l,"wrapper"]])}const hl=C({mixins:[B],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?ln(this.schema.inputName+"_"+this.getItemValue(e)):ln(this.getItemValue(e))},getItemValue(e){if(D(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(D(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,t){if((v(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const r=An(this.value);r.push(this.getItemValue(t)),this.value=r}else{const r=An(this.value);r.splice(this.value.indexOf(this.getItemValue(t)),1),this.value=r}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",ml]]);function ul(e){const t=n.ref([]),r=n.ref(null),o=y=>ie(y)?le[y]!=null?le[y]:(console.warn(`'${y}' is not a validator function!`),null):y,a=n.computed({get(){var k,u;let y;return T(w(e.schema,"get"))?y=e.schema.get((k=e.model)==null?void 0:k.value):y=w((u=e.model)==null?void 0:u.value,e.schema.model),S(y)},set(y){const k=a;y=E(y),T(y)?y(y,k):s(y,k)}}),i=y=>{var A;d();const k=(A=e.schema)==null?void 0:A.validator,u=w(e.formOptions,"validateAsync",!1);let b=[];if(k&&e.schema.readonly!==!0&&e.disabled!==!0){const p=[];Array.isArray(k)?P(k,h=>{p.push(o(h))}):p.push(o(k)),P(p,h=>{var _,O;if(u)b.push(h(a.value,e.schema,(_=e.model)==null?void 0:_.value));else{const L=h(a.value,e.schema,(O=e.model)==null?void 0:O.value);L&&T(L.then)?L.then(or=>{or&&(t.value=t.value.concat(or));const mu=t.value.length===0;e.emitValidated&&e.emitValidated({isValid:mu,errors:t.value,field:e.schema})}):L&&(b=b.concat(L))}})}const V=p=>{var _,O;let h=[];if(P(hn(p),L=>{Array.isArray(L)&&L.length>0?h=h.concat(L):ie(L)&&h.push(L)}),T((_=e.schema)==null?void 0:_.onValidated)&&e.schema.onValidated((O=e.model)==null?void 0:O.value,h,e.schema),!y){const L=h.length===0;e.emitValidated&&e.emitValidated({isValid:L,errors:h,field:e.schema})}return p=h,h};return u?Promise.all(b).then(V):V(b)},l=()=>{T(r.value)?r.value():r.value=Te(i,w(e.schema,"validateDebounceTime",w(e.formOptions,"validateDebounceTime",500)))},s=(y,k)=>{var b,V,A;let u=!1;T(e.schema.set)?(e.schema.set((b=e.model)==null?void 0:b.value,y),u=!0):e.schema.model&&(c(e.schema.model,y),u=!0),u&&(e.emitModelUpdated&&((V=e.model)!=null&&V.value)&&e.emitModelUpdated({value:y,model:e.schema.model}),T(e.schema.onChanged)&&e.schema.onChanged((A=e.model)==null?void 0:A.value,y,k,e.schema),w(e.formOptions,"validateAfterChanged",!1)===!0&&(w(e.schema,"validateDebounceTime",w(e.formOptions,"validateDebounceTime",0))>0?l():i()))},d=()=>{t.value.splice(0)},c=(y,k)=>{var h;let u=y.replace(/\[(\w+)\]/g,".$1");u=u.replace(/^\./,"");let b=((h=e.model)==null?void 0:h.value)||{},V=0;const A=u.split("."),p=A.length;for(;V<p;){const _=A[V];if(V<p-1)b[_]!==void 0||(b[_]={}),b=b[_];else{b[_]=k;return}++V}},m=(y,k=!1)=>{const u=w(e.formOptions,"fieldIdPrefix","");return ot(y,u)+(k?"-"+un():"")},g=y=>`${m(y)}-label`,f=()=>w(e.schema,"fieldClasses",[]),S=y=>y,E=y=>y;return{value:a,clearValidationErrors:d,getFieldID:m,getLabelId:g,getFieldClasses:f,updateModelValue:s}}const On={useAbstractFields:ul},pl={class:"form-field-wrapper"},Fn=C(n.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:t,emit:r}){const o=e,a=r,i=n.toRefs(o),{updateModelValue:l,getFieldID:s,clearValidationErrors:d,value:c}=On.useAbstractFields({model:i.model,schema:o.schema,formOptions:o.formOptions,emitModelUpdated:u=>{a("modelUpdated",u.value,u.model)}});t({clearValidationErrors:d});const m=n.computed(()=>{var b;const u=(b=o.schema)==null?void 0:b.inputType.toLowerCase();return u==="string"?"text":u==="datetime"?"datetime-local":u||"text"}),g={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},f=(u,b)=>{var h,_;let V=u;const A=g[m.value]||"",p=G.parse(u,A);p&&((h=o.schema)!=null&&h.format?V=G.format(p,(_=o.schema)==null?void 0:_.format):V=p.valueOf()),l(V,b)},S=(u,b)=>{lt(u)||(u=NaN),l(u,b)},E=u=>{let b=u;switch(m.value){case"number":case"range":lt(parseFloat(u))&&(b=parseFloat(u));break}c.value=b,l(b,u)},y=n.ref(null),k=()=>{var u;T(y.value)&&((u=y.value)==null||u.flush())};return n.onMounted(()=>{switch(m.value){case"number":case"range":y.value=Te((u,b)=>{S(u,b)},parseInt(w(o.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":y.value=Te((u,b)=>{f(u,b)},parseInt(w(o.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),n.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.")}),(u,b)=>{const V=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",pl,[n.createVNode(V,n.mergeProps(u.$attrs,{id:n.unref(s)(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"?n.unref(c):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":n.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":E}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","type","width"])])}}}),[["__scopeId","data-v-b6d4701b"]]),fl=C(n.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 t=e,r=n.toRefs(t),{getFieldID:o,value:a}=On.useAbstractFields({model:r.model,schema:t.schema,formOptions:t.formOptions});return(i,l)=>{const s=n.resolveComponent("KLabel");return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(["field-label",e.schema.fieldClasses])},[n.createVNode(s,{id:n.unref(o)(e.schema)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-852ab959"]]),gl=["disabled"],yl=["id","disabled","name","onClick","value","checked","required"];function bl(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:"radio-list",disabled:e.disabled||null},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.items,s=>n.withDirectives((n.openBlock(),n.createElementBlock("label",{class:n.normalizeClass(i.getItemCssClasses(s))},[n.withDirectives(n.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"radio",disabled:i.isItemDisabled(s)||null,name:i.id,onClick:d=>i.onSelection(s),value:i.getItemValue(s),checked:i.isItemChecked(s)||null,class:n.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,yl),[[l,"input"]]),n.createTextVNode(n.toDisplayString(i.getItemName(s)),1)],2)),[[l,"label"]])),256))],8,gl)),[[l,"wrapper"]])}const kl=C({mixins:[B],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(D(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(D(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 t=w(e,"disabled",!1);return T(t)?t(this.model):t}}},[["render",bl]]);function _l(e,t){for(var r=-1,o=e==null?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}var Cl=1,wl=2;function vn(e,t,r,o,a,i){var l=r&Cl,s=e.length,d=t.length;if(s!=d&&!(l&&d>s))return!1;var c=i.get(e),m=i.get(t);if(c&&m)return c==t&&m==e;var g=-1,f=!0,S=r&wl?new Se:void 0;for(i.set(e,t),i.set(t,e);++g<s;){var E=e[g],y=t[g];if(o)var k=l?o(y,E,g,t,e,i):o(E,y,g,e,t,i);if(k!==void 0){if(k)continue;f=!1;break}if(S){if(!_l(t,function(u,b){if(!mn(S,b)&&(E===u||a(E,u,r,o,i)))return S.push(b)})){f=!1;break}}else if(!(E===y||a(E,y,r,o,i))){f=!1;break}}return i.delete(e),i.delete(t),f}function El(e){var t=-1,r=Array(e.size);return e.forEach(function(o,a){r[++t]=[a,o]}),r}var Tl=1,Sl=2,$l="[object Boolean]",Bl="[object Date]",Ml="[object Error]",Nl="[object Map]",Il="[object Number]",Vl="[object RegExp]",Al="[object Set]",Ol="[object String]",Fl="[object Symbol]",vl="[object ArrayBuffer]",Dl="[object DataView]",Dn=K?K.prototype:void 0,ct=Dn?Dn.valueOf:void 0;function Ul(e,t,r,o,a,i,l){switch(r){case Dl:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vl:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case $l:case Bl:case Il:return Ce(+e,+t);case Ml:return e.name==t.name&&e.message==t.message;case Vl:case Ol:return e==t+"";case Nl:var s=El;case Al:var d=o&Tl;if(s||(s=st),e.size!=t.size&&!d)return!1;var c=l.get(e);if(c)return c==t;o|=Sl,l.set(e,t);var m=vn(s(e),s(t),o,a,i,l);return l.delete(e),m;case Fl:if(ct)return ct.call(e)==ct.call(t)}return!1}var Ll=1,Pl=Object.prototype,jl=Pl.hasOwnProperty;function Rl(e,t,r,o,a,i){var l=r&Ll,s=Xe(e),d=s.length,c=Xe(t),m=c.length;if(d!=m&&!l)return!1;for(var g=d;g--;){var f=s[g];if(!(l?f in t:jl.call(t,f)))return!1}var S=i.get(e),E=i.get(t);if(S&&E)return S==t&&E==e;var y=!0;i.set(e,t),i.set(t,e);for(var k=l;++g<d;){f=s[g];var u=e[f],b=t[f];if(o)var V=l?o(b,u,f,t,e,i):o(u,b,f,e,t,i);if(!(V===void 0?u===b||a(u,b,r,o,i):V)){y=!1;break}k||(k=f=="constructor")}if(y&&!k){var A=e.constructor,p=t.constructor;A!=p&&"constructor"in e&&"constructor"in t&&!(typeof A=="function"&&A instanceof A&&typeof p=="function"&&p instanceof p)&&(y=!1)}return i.delete(e),i.delete(t),y}var ql=1,Un="[object Arguments]",Ln="[object Array]",je="[object Object]",zl=Object.prototype,Pn=zl.hasOwnProperty;function xl(e,t,r,o,a,i){var l=q(e),s=q(t),d=l?Ln:fe(e),c=s?Ln:fe(t);d=d==Un?je:d,c=c==Un?je:c;var m=d==je,g=c==je,f=d==c;if(f&&be(e)){if(!be(t))return!1;l=!0,m=!1}if(f&&!m)return i||(i=new Y),l||Ye(e)?vn(e,t,r,o,a,i):Ul(e,t,d,r,o,a,i);if(!(r&ql)){var S=m&&Pn.call(e,"__wrapped__"),E=g&&Pn.call(t,"__wrapped__");if(S||E){var y=S?e.value():e,k=E?t.value():t;return i||(i=new Y),a(y,k,r,o,i)}}return f?(i||(i=new Y),Rl(e,t,r,o,a,i)):!1}function mt(e,t,r,o,a){return e===t?!0:e==null||t==null||!H(e)&&!H(t)?e!==e&&t!==t:xl(e,t,r,o,mt,a)}var Kl=1,Hl=2;function Yl(e,t,r,o){var a=r.length,i=a,l=!o;if(e==null)return!i;for(e=Object(e);a--;){var s=r[a];if(l&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<i;){s=r[a];var d=s[0],c=e[d],m=s[1];if(l&&s[2]){if(c===void 0&&!(d in e))return!1}else{var g=new Y;if(o)var f=o(c,m,d,e,t,g);if(!(f===void 0?mt(m,c,Kl|Hl,o,g):f))return!1}}return!0}function jn(e){return e===e&&!D(e)}function Gl(e){for(var t=ue(e),r=t.length;r--;){var o=t[r],a=e[o];t[r]=[o,a,jn(a)]}return t}function Rn(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Zl(e){var t=Gl(e);return t.length==1&&t[0][2]?Rn(t[0][0],t[0][1]):function(r){return r===e||Yl(r,e,t)}}function Wl(e,t){return e!=null&&t in Object(e)}function Jl(e,t,r){t=Ot(t,e);for(var o=-1,a=t.length,i=!1;++o<a;){var l=Oe(t[o]);if(!(i=e!=null&&r(e,l)))break;e=e[l]}return i||++o!=a?i:(a=e==null?0:e.length,!!a&&xe(a)&&ze(l,a)&&(q(e)||qe(e)))}function Xl(e,t){return e!=null&&Jl(e,t,Wl)}var Ql=1,ed=2;function td(e,t){return Ge(e)&&jn(t)?Rn(Oe(e),t):function(r){var o=w(r,e);return o===void 0&&o===t?Xl(r,e):mt(t,o,Ql|ed)}}function nd(e){return function(t){return t==null?void 0:t[e]}}function rd(e){return function(t){return Ft(t,e)}}function od(e){return Ge(e)?nd(Oe(e)):rd(e)}function qn(e){return typeof e=="function"?e:e==null?Ne:typeof e=="object"?q(e)?td(e[0],e[1]):Zl(e):od(e)}function id(e){return function(t,r,o){var a=Object(t);if(!he(t)){var i=qn(r);t=ue(t),r=function(s){return i(a[s],s,a)}}var l=e(t,r,o);return l>-1?a[i?t[l]:l]:void 0}}var ad=Math.max;function sd(e,t,r){var o=e==null?0:e.length;if(!o)return-1;var a=r==null?0:yn(r);return a<0&&(a=ad(o+a,0)),cn(e,qn(t),a)}var ld=id(sd);const dd=["disabled","name","id"],cd=["disabled"],md=["label"],hd=["value"],ud=["value"];function pd(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("select",{class:n.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":t[0]||(t[0]=s=>e.value=s),disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},[i.selectOptions.hideNoneSelectedText?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null},n.toDisplayString(i.selectOptions.noneSelectedText||"<Nothing selected>"),9,cd)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.items,s=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[s.group?(n.openBlock(),n.createElementBlock("optgroup",{key:0,label:i.getGroupName(s)},[s.ops?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(s.ops,d=>(n.openBlock(),n.createElementBlock("option",{value:i.getItemValue(d)},n.toDisplayString(i.getItemName(d)),9,hd))),256)):n.createCommentVNode("",!0)],8,md)):n.createCommentVNode("",!0),s.group?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("option",{key:1,value:i.getItemValue(s)},n.toDisplayString(i.getItemName(s)),9,ud))],64))),256))],10,dd)),[[n.vModelSelect,e.value],[l,"input"]])}const zn=C({mixins:[B],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 v(e)?null:e},groupValues(e){const t=[];let r={};return e.forEach(o=>{r=null,o.group&&D(o)?(r=ld(t,a=>a.group===o.group),r?r.ops.push({id:o.id,name:o.name}):(r={group:"",ops:[]},r.group=o.group,r.ops.push({id:o.id,name:o.name}),t.push(r))):t.push(o)}),t},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(D(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(D(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",pd]]);var fd="[object Map]",gd="[object Set]",yd=Object.prototype,bd=yd.hasOwnProperty;function kd(e){if(e==null)return!0;if(he(e)&&(q(e)||typeof e=="string"||typeof e.splice=="function"||be(e)||Ye(e)||qe(e)))return!e.length;var t=fe(e);if(t==fd||t==gd)return!e.size;if(Me(e))return!Bt(e).length;for(var r in e)if(bd.call(e,r))return!1;return!0}const _d=["id","value","name","disabled"];function Cd(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("input",{id:e.getFieldID(e.schema),type:"submit",value:e.schema.buttonText,onClick:t[0]||(t[0]=(...l)=>i.onClick&&i.onClick(...l)),name:e.schema.inputName,disabled:e.disabled||null,class:n.normalizeClass(e.schema.fieldClasses)},null,10,_d)}const wd=C({mixins:[B],methods:{onClick(e){if(this.schema.validateBeforeSubmit===!0){e.preventDefault();const t=w(this.formOptions,"validateAsync",!1),r=this.vfg.validate(),o=a=>{t&&!kd(a)||!t&&!a?T(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,a,e):T(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)};r&&T(r.then)?r.then(o):o(r)}else T(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)}}},[["render",Cd]]),Ed=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function Td(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("textarea",{class:n.normalizeClass(["form-control",e.schema.fieldClasses]),"onUpdate:modelValue":t[0]||(t[0]=s=>e.value=s),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,Ed)),[[n.vModelText,e.value],[l,"input"]])}const xn=C({mixins:[B]},[["render",Td]]),Sd={class:"wrapper"},$d=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function Bd(e,t,r,o,a,i){const l=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("div",Sd,[n.withDirectives(n.createElementVNode("input",{class:"form-control",id:e.getFieldID(e.schema),type:"file",name:e.schema.inputName,onChange:t[0]||(t[0]=(...s)=>i.onChange&&i.onChange(...s)),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,$d),[[l,"input"]])])),[[l,"wrapper"]])}const Md=C({mixins:[B],methods:{onChange(e){T(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,e,this)}}},[["render",Bd]]),Nd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function Id(e,t,r,o,a,i){return n.openBlock(),n.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,Nd)}const Vd=C({mixins:[B],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,X(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",Id]]),Kn={formatValueToField(e){if(e!=null){const t=this.schema.format?G.parse(e,this.schema.format):new Date(e);return G.format(t,this.getDateFormat())}return e},formatValueToModel(e){if(e!=null){const t=G.parse(e,this.getDateFormat());this.schema.format?e=G.format(t,this.schema.format):e=t.valueOf()}return e}},Ad={class:"input-group date"},Od=["autocomplete","disabled","placeholder","readonly","name","id"],Fd=n.createElementVNode("span",{class:"input-group-addon"},[n.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function vd(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("div",Ad,[n.withDirectives(n.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),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,Od),[[n.vModelText,e.value]]),Fd])}const Hn="YYYY-MM-DD HH:mm:ss",Dd={mixins:[B],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const e=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(X(this.schema.dateTimePickerOptions||{},{format:Hn})).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:Hn},...Kn}},Ud=C(Dd,[["render",vd]]),Ld=["autocomplete","disabled","placeholder","readonly","name","id"];function Pd(e,t,r,o,a,i){return n.withDirectives((n.openBlock(),n.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName,debounce:"500",onFocus:t[1]||(t[1]=l=>i.geolocate()),id:e.getFieldID(e.schema)},null,40,Ld)),[[n.vModelText,e.value]])}const jd=C({mixins:[B],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 t={};if(e.address_components!==void 0)for(let r=0;r<e.address_components.length;r++){const o=e.address_components[r].types[0];this.inputs[o]&&(t[o]=e.address_components[r][this.inputs[o]])}T(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,t,e,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{const t={lat:e.coords.latitude,lng:e.coords.longitude},r=new window.google.maps.Circle({center:t,radius:e.coords.accuracy});this.autocomplete.setBounds(r.getBounds())})}}},[["render",Pd]]),Rd={class:"wrapper"},qd=["autocomplete","disabled","placeholder","readonly"],zd=["disabled","name"];function xd(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("div",Rd,[n.withDirectives(n.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":t[0]||(t[0]=l=>i.wrappedValue=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly},null,8,qd),[[n.vShow,e.schema.hideInput!==!0],[n.vModelText,i.wrappedValue]]),e.schema.browse!==!1?(n.openBlock(),n.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:e.disabled||null,onChange:t[1]||(t[1]=(...l)=>i.fileChanged&&i.fileChanged(...l)),name:e.schema.inputName},null,40,zd)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"preview",style:n.normalizeStyle(i.previewStyle)},[n.createElementVNode("div",{class:"remove",title:"Remove image",onClick:t[2]||(t[2]=(...l)=>i.remove&&i.remove(...l))})],4)])}const Kd=C({mixins:[B],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 t=new FileReader;t.onload=r=>{this.value=r.target.result},e.target.files&&e.target.files.length>0&&t.readAsDataURL(e.target.files[0])}}},[["render",xd]]),Hd=["autocomplete","disabled","placeholder","readonly","name","id"];function Yd(e,t,r,o,a,i){return n.withDirectives((n.openBlock(),n.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),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)),[[n.vModelText,e.value]])}const Gd=C({mixins:[B],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",Yd]]),Zd={mixins:[B],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,X(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}}},Wd=["disabled"];function Jd(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["slider",{"contain-pips":i.containPips,"contain-tooltip":i.containTooltip}]),disabled:e.disabled||null},null,10,Wd)}const Xd=C(Zd,[["render",Jd]]),Qd=["autocomplete","disabled","placeholder","readonly","name"];function ec(e,t,r,o,a,i){return n.withDirectives((n.openBlock(),n.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly,name:e.schema.inputName},null,8,Qd)),[[n.vModelText,e.value]])}const tc="YYYY-MM-DD",nc={mixins:[B],data(){return{picker:null,options:null}},mounted(){this.initialize(w(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return w(this.schema,"pikadayOptions.format",tc)},...Kn,initialize(e){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=X({},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!")})}}},rc=C(nc,[["render",ec]]),oc=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function ic(e,t,r,o,a,i){return n.openBlock(),n.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,oc)}const ac=C({mixins:[B],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let e,t;Array.isArray(this.value)?[e,t]=this.value:e=this.value,this.slider&&this.slider.update({from:e,to:t})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let e,t;Array.isArray(this.value)?[e,t]=this.value:e=this.value;const r=this;$(this.$el).ionRangeSlider(X(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:e,to:t,onChange(o){r.slider.options.type==="double"?r.value=[o.from,o.to]:r.value=o.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",ic]]),sc=["disabled","multiple","title","name"],lc=["disabled","selected"],dc=["value"];function cc(e,t,r,o,a,i){return n.withDirectives((n.openBlock(),n.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),disabled:e.disabled||null,multiple:e.schema.multiSelect,title:e.schema.placeholder,"data-width":"100%",name:e.schema.inputName},[e.schema.multiSelect!==!0?(n.openBlock(),n.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null,selected:e.value==null},null,8,lc)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.items,l=>(n.openBlock(),n.createElementBlock("option",{value:i.getItemValue(l)},n.toDisplayString(i.getItemName(l)),9,dc))),256))],8,sc)),[[n.vModelSelect,e.value]])}const mc=C({mixins:[B],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(D(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(D(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",cc]]),hc=["autocomplete","disabled","placeholder","readonly","name","id"];function uc(e,t,r,o,a,i){return n.openBlock(),n.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,hc)}const pc=C({mixins:[B],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(X(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",uc]]),fc=["src"];function gc(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("img",{src:i.mapLink},null,8,fc)}const yc=C({mixins:[B],computed:{mapLink(){let e,t,r;if(this.value){const o=X(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});e=this.value[o.lat],t=this.value[o.lng],r=`http://maps.googleapis.com/maps/api/staticmap?center=${e},${t}&zoom=${o.zoom}&size=${o.sizeX}x${o.sizeY}`;const a=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const i of a)typeof o[i]<"u"&&(r+=`&${i}=${o[i]}`)}return r}}},[["render",gc]]),bc=["autocomplete","disabled","name","id"],kc=["data-on","data-off","for"],_c=n.createElementVNode("span",{class:"handle"},null,-1);function Cc(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("label",null,[n.withDirectives(n.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,name:e.schema.inputName,id:e.getFieldID(e.schema)},null,8,bc),[[n.vModelCheckbox,e.value]]),n.createElementVNode("span",{class:"label","data-on":e.schema.textOn||"On","data-off":e.schema.textOff||"Off",for:e.getFieldID(e.schema)},null,8,kc),_c])}const wc=C({mixins:[B],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",Cc]]),Ec={mixins:[B],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),t={};for(let r=0;r<e.length;r++){const o=e[r];t[o]=typeof this.value[o]}this.keyTypes=t},methods:{removeElement(e){const t=this.value;delete t[e],this.value=JSON.parse(JSON.stringify(t));const r=this.keyTypes;delete r[e],this.keyTypes=JSON.parse(JSON.stringify(r))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},Tc={key:0},Sc={key:1},$c=["id"],Bc={key:0},Mc=["onUpdate:modelValue"],Nc={key:1},Ic=["onUpdate:modelValue"],Vc={key:2},Ac=["onUpdate:modelValue"],Oc=["onClick"],Fc=[n.createElementVNode("option",{value:"string"}," String ",-1),n.createElementVNode("option",{value:"number"}," Number ",-1),n.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function vc(e,t,r,o,a,i){const l=n.resolveComponent("vue-form-generator"),s=n.resolveDirective("attributes");return n.withDirectives((n.openBlock(),n.createElementBlock("div",null,[e.schema.schema?(n.openBlock(),n.createElementBlock("div",Tc,[n.createVNode(l,{model:e.value,options:e.formOptions,schema:e.schema.schema},null,8,["model","options","schema"])])):(n.openBlock(),n.createElementBlock("div",Sc,[n.createElementVNode("table",{id:e.getFieldID(e.schema),class:n.normalizeClass(e.schema.fieldClasses)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.value,(d,c)=>(n.openBlock(),n.createElementBlock("tr",{key:c},[n.createElementVNode("td",null,n.toDisplayString(c),1),a.keyTypes[c]==="string"?(n.openBlock(),n.createElementBlock("td",Bc,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"text"},null,8,Mc),[[n.vModelText,e.value[c]]])])):n.createCommentVNode("",!0),a.keyTypes[c]==="boolean"?(n.openBlock(),n.createElementBlock("td",Nc,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"checkbox"},null,8,Ic),[[n.vModelCheckbox,e.value[c]]])])):n.createCommentVNode("",!0),a.keyTypes[c]==="number"?(n.openBlock(),n.createElementBlock("td",Vc,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":m=>e.value[c]=m,type:"number"},null,8,Ac),[[n.vModelText,e.value[c]]])])):n.createCommentVNode("",!0),n.createElementVNode("td",null,[n.createElementVNode("input",{type:"button",value:"x",onClick:m=>i.removeElement(c)},null,8,Oc)])]))),128))],10,$c),n.withDirectives(n.createElementVNode("select",{"onUpdate:modelValue":t[0]||(t[0]=d=>a.newKeyType=d)},Fc,512),[[n.vModelSelect,a.newKeyType]]),n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>a.newKeyName=d),type:"text"},null,512),[[n.vModelText,a.newKeyName]]),n.createElementVNode("input",{type:"button",value:"Add key",onClick:t[2]||(t[2]=(...d)=>i.addKey&&i.addKey(...d))})]))])),[[s,a.attributes]])}const Yn=C(Ec,[["render",vc]]),Re="24px",Gn=(e,t)=>{const r=e.__vccOpts||e;for(const[o,a]of t)r[o]=a;return r},Dc=e=>(n.pushScopeId("data-v-1d2a8d30"),e=e(),n.popScopeId(),e),Uc=["aria-hidden"],Lc={key:0,"data-testid":"kui-icon-svg-title"},Pc=Dc(()=>n.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),jc=n.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:Re,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const a=String(t.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Re}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(a,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.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?(n.openBlock(),n.createElementBlock("title",Lc,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Pc],8,Uc))]),_:1},8,["aria-hidden","style"]))}}),Rc=Gn(jc,[["__scopeId","data-v-1d2a8d30"]]),qc=e=>(n.pushScopeId("data-v-b199fa56"),e=e(),n.popScopeId(),e),zc=["aria-hidden"],xc={key:0,"data-testid":"kui-icon-svg-title"},Kc=qc(()=>n.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)),Hc=n.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:Re,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const a=String(t.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Re}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(a,i)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.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?(n.openBlock(),n.createElementBlock("title",xc,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Kc],8,zc))]),_:1},8,["aria-hidden","style"]))}}),Be=Gn(Hc,[["__scopeId","data-v-b199fa56"]]),Yc={components:{TrashIcon:Be},mixins:[B],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,t)=>({[this.schema.model]:e[t]}),set:(e,t,r)=>e[t]=r[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 t=this.value;delete t[e],this.value={...t}},transformMapModelValuesToObject(e,t,r){const o={};return Object.keys(e).map(a=>{const i=a.indexOf(r+"-");if(i>-1&&Array.isArray(t))if(t.length>0){const s=a.split("-").filter(c=>t.find(m=>m.model===c)),d=a.split(`-${s}`)[0].split(`${r}-`)[1];s.length?o[d]={...o[d],[s]:e[a]}:o[a.substring(i+`${r}-`.length)]=e[a]}else o[a.substring(`${r}-`.length)]=e[a];else{const s=a.split("-").filter(c=>c===this.schema.model),d=a.split(`-${s}`)[0].split(`${r}-`)[1];d&&(o[d]=e[a])}return a}),o},addKey(){const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",t=this.subSchema?e?[""]:{}:"";this.value[this.newKeyName]=t,this.newKeyName=""},updateModel(e,t){this.$emit("model-updated",this.model[this.schema.model],t)}}},Zn=e=>(n.pushScopeId("data-v-106caf87"),e=e(),n.popScopeId(),e),Gc=["id"],Zc=["data-testid"],Wc={class:"item-wrapper"},Jc={class:"index-wrapper"},Xc=Zn(()=>n.createElementVNode("hr",{class:"divider"},null,-1)),Qc={key:0},em={key:1},tm=["onUpdate:modelValue","placeholder","onInput"],nm={key:0,class:"hint"},rm=Zn(()=>n.createElementVNode("hr",{class:"wide-divider"},null,-1)),om={class:"input-item"},im=["placeholder"],am={key:0,class:"hint"};function sm(e,t,r,o,a,i){const l=n.resolveComponent("TrashIcon"),s=n.resolveComponent("KButton"),d=n.resolveComponent("vue-form-generator");return n.openBlock(),n.createElementBlock("div",{id:e.getFieldID(e.schema),class:n.normalizeClass(["object-advanced-wrapper",e.schema.fieldClasses])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.value,(c,m)=>(n.openBlock(),n.createElementBlock("div",{key:m,"data-testid":`field-object-key-${m}`},[n.createElementVNode("div",null,[n.createElementVNode("div",Wc,[n.createElementVNode("div",Jc,[n.createElementVNode("strong",null,n.toDisplayString(m),1),n.createElementVNode("div",null,[n.createVNode(s,{appearance:"tertiary",class:"delete",type:"button",onClick:g=>i.removeElement(m)},{icon:n.withCtx(()=>[n.createVNode(l)]),_:2},1032,["onClick"])])]),Xc,i.subSchema?(n.openBlock(),n.createElementBlock("div",Qc,[n.createVNode(d,{model:i.transformedModel[m],options:{helpAsHtml:!0},schema:i.subSchema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])):(n.openBlock(),n.createElementBlock("div",em,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":g=>e.value[m]=g,class:"form-control",placeholder:e.schema.fields&&e.schema.fields[0].schema.placeholder,type:"text",onInput:g=>i.updateModel(e.value[m],e.model[e.schema.model])},null,40,tm),[[n.vModelText,e.value[m]]]),e.schema.fields&&e.schema.fields[0].schema.hint?(n.openBlock(),n.createElementBlock("p",nm,n.toDisplayString(e.schema.fields[0].schema.hint),1)):n.createCommentVNode("",!0)])),rm])])],8,Zc))),128)),n.createElementVNode("div",{class:n.normalizeClass(["input-wrapper",{indent:i.hasObjectKeys}])},[n.createElementVNode("div",om,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=c=>a.newKeyName=c),class:"form-control","data-testid":"keyname-input",placeholder:e.schema.placeholder,type:"text"},null,8,im),[[n.vModelText,a.newKeyName]]),n.createVNode(s,{appearance:"tertiary","data-testid":"add-key",disabled:!a.newKeyName,onClick:i.addKey},{default:n.withCtx(()=>[n.createTextVNode(" + Add "+n.toDisplayString(e.schema.buttonLabel||e.schema.label),1)]),_:1},8,["disabled","onClick"])]),e.schema.hintText?(n.openBlock(),n.createElementBlock("p",am,n.toDisplayString(e.schema.hintText),1)):n.createCommentVNode("",!0)],2)],10,Gc)}const Wn=C(Yc,[["render",sm],["__scopeId","data-v-106caf87"]]),lm={class:"array-item"},Jn=C(n.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(t,r)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",lm,[n.renderSlot(t.$slots,"default",{},void 0,!0),n.createVNode(o,{appearance:"tertiary",class:"delete",onClick:r[0]||(r[0]=a=>t.$emit("remove-item"))},{default:n.withCtx(()=>[n.createVNode(n.unref(Be))]),_:1})])}}}),[["__scopeId","data-v-ec926551"]]),dm=e=>(n.pushScopeId("data-v-27d212bd"),e=e(),n.popScopeId(),e),cm={class:"multi-item-wrapper"},mm=dm(()=>n.createElementVNode("hr",null,null,-1)),Xn=C(n.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(t,r)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",cm,[n.renderSlot(t.$slots,"default",{},void 0,!0),n.createVNode(o,{appearance:"danger",class:"delete",onClick:r[0]||(r[0]=a=>t.$emit("remove-item"))},{default:n.withCtx(()=>[n.createTextVNode(" - Remove Field ")]),_:1}),mm])}}}),[["__scopeId","data-v-27d212bd"]]),hm={name:"FieldMetric",components:{AddIcon:Rc,TrashIcon:Be},mixins:[B],emits:["remove-item"],data(){return{contentVisible:!1}}},um={key:0,class:"content"};function pm(e,t,r,o,a,i){const l=n.resolveComponent("AddIcon"),s=n.resolveComponent("TrashIcon"),d=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["field-dropdown",{active:a.contentVisible}])},[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=c=>a.contentVisible=!a.contentVisible)},[n.createTextVNode(n.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),n.createVNode(l,{class:"metric-add-icon"})]),n.createVNode(n.Transition,{name:"slide-fade"},{default:n.withCtx(()=>[a.contentVisible?(n.openBlock(),n.createElementBlock("div",um,[n.renderSlot(e.$slots,"default"),n.createVNode(d,{appearance:"tertiary",class:"metric-remove-button",onClick:t[1]||(t[1]=c=>e.$emit("remove-item"))},{default:n.withCtx(()=>[n.createVNode(s)]),_:1})])):n.createCommentVNode("",!0)]),_:3})],2)}const Qn=C(hm,[["render",pm]]),te="kong-ui-forms-api",fm="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function gm(e){return e?e.length===36&&new RegExp(`^${fm}$`).test(e):!1}const ht=50,de={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 ym(e,t,r){return r?de.SET_REFERRAL_VALUE:e&&!t||!e&&t?de.UPDATE_ENTITY:e&&t?de.CREATE_FROM_ENTITY:de.CREATE_NOT_FROM_ENTITY}const bm={mixins:[B],inject:[te],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ym(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,t;switch(this.fieldState){case de.UPDATE_ENTITY:if(!this[te]){console.warn("[@kong-ui-public/forms] No API service provided");break}t=(await this[te].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?t[this.schema.entityDataKey]:t),this.idValue=e.id;break;case de.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case de.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(r){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",r)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=Te(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const t=[],r=[],o=this.getInputFields(),a=new Set;gm(e)&&o.includes("id")?r.push((async()=>{const i=await this.fetchExact(e);t.push({...i,label:this.getSuggestionLabel(i),value:i.id})})()):r.push(...o.filter(i=>i!=="id").map(async i=>{(await this.fetchSuggestions(e,i)).forEach(s=>{a.has(s.id)||(a.add(s.id),t.push({...s,label:this.getSuggestionLabel(s),value:s.id}))})})),await Promise.all(r),this.items=t,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 t=[];let r=null;if(!this[te])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;t.length<ht;){const o=await this[te].getAll(this.entity,{size:ht,offset:r,...e});if(t.push(...o.data.data),r=o.data.offset,!r)break}return t.slice(0,ht)},async fetchSuggestions(e,t){return this.fetchUntilLimit({[t]:e})},async fetchExact(e){return this[te]?(await this[te].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,t;return((t=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:t.fields)||[]},getSuggestionLabel(e){const t=this.getInputFields();return t.length&&e?t.map(r=>e[r]).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 r;const t=(r=this.schema)==null?void 0:r.returnKey;return t?e[t]:e.id}}},km={class:"field-wrap autosuggest"},_m=["data-testid","data-testlabel"],Cm=["data-testid"],wm={class:"autosuggest__results_message"};function Em(e,t,r,o,a,i){const l=n.resolveComponent("KSelect");return n.openBlock(),n.createElementBlock("div",km,[n.createVNode(l,{id:e.schema.model,ref:"suggestion",modelValue:a.idValue,"onUpdate:modelValue":t[0]||(t[0]=s=>a.idValue=s),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":n.withCtx(({item:s})=>[n.createElementVNode("span",{class:"first-part","data-testid":s.id&&`${s.id}-0`,"data-testlabel":s.label},n.toDisplayString(i.getSuggestionLabel(s).split(" - ")[0]),9,_m),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.getSuggestionLabel(s).split(" - ").slice(1),(d,c)=>(n.openBlock(),n.createElementBlock("span",{key:c,class:"field-span","data-testid":s.id&&`${s.id}-${c+1}`||c+1},n.toDisplayString(d),9,Cm))),128))]),empty:n.withCtx(()=>[n.createElementVNode("div",wm,[n.createElementVNode("span",null,n.toDisplayString(a.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const er=C(bm,[["render",Em],["__scopeId","data-v-647bb712"]]),Tm={class:"array-card-container"},tr=C(n.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null}},emits:["remove-item"],setup(e){return(t,r)=>{const o=n.resolveComponent("KCard"),a=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",Tm,[n.createVNode(o,{class:"card"},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3}),n.createVNode(a,{appearance:"tertiary",class:"array-card-remove-button",onClick:r[0]||(r[0]=i=>t.$emit("remove-item"))},{default:n.withCtx(()=>[n.createVNode(n.unref(Be))]),_:1})])}}}),[["__scopeId","data-v-5fa27cb4"]]),Sm={mixins:[B],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 t=e.target.value.split(",");this.schema.array||(t=t.toString()),this.updateModel(t)}}},$m={class:"selection-group"},Bm={class:"form-group"},Mm=["id","checked","name","value"];function Nm(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("div",$m,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.schema.values,(l,s)=>(n.openBlock(),n.createElementBlock("div",{key:s,class:"option-group"},[n.createElementVNode("div",Bm,[n.createElementVNode("label",{class:n.normalizeClass(["k-label",l.name])},[n.createElementVNode("input",{id:e.schema.name+"-"+s,checked:i.checkOption(l),class:"k-input",name:e.schema.name,type:"radio",value:l.value,onChange:t[0]||(t[0]=(...d)=>i.onChange&&i.onChange(...d))},null,40,Mm),n.createTextVNode(" "+n.toDisplayString(l.name),1)],2)])]))),128))])}const nr=C(Sm,[["render",Nm],["__scopeId","data-v-7e49acd6"]]),Im={name:"FieldArray",components:{FieldArrayItem:Jn,FieldArrayMultiItem:Xn,FieldSelect:zn,FieldMetric:Qn,FieldObject:Yn,FieldObjectAdvanced:Wn,FieldAutoSuggest:er,FieldRadio:nr,FieldArrayCardContainer:tr,FieldTextArea:xn,FieldInput:Fn},mixins:[B],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(e,t,r){var a,i,l;let o;return t&&(o=JSON.parse(JSON.stringify(t)),(l=(i=(a=o.schema)==null?void 0:a.fields)==null?void 0:i.map)==null||l.call(i,s=>(s.id=`${s.id||s.model}-${r}`,s))),{...o,set(s,d){e[r]=d},get(){return e[r]}}},newElement(){let e=this.value,t;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?t=this.schema.items.default():t=this.schema.items.default),e.push(t),this.value=[...e]},removeElement(e){this.value=this.value.filter((t,r)=>r!==e)},getFieldType(e){return"field-"+e.type},modelUpdated(){}}},Vm=["id"],Am={key:1},Om=["onUpdate:modelValue","aria-labelledby","type"],Fm=["value","onClick"],vm=["onUpdate:modelValue","aria-labelledby"],Dm=["value","onClick"];function Um(e,t,r,o,a,i){const l=n.resolveComponent("FieldTextArea"),s=n.resolveComponent("KButton");return e.schema?(n.openBlock(),n.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:n.normalizeClass(e.schema.fieldClasses)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.value,(d,c)=>(n.openBlock(),n.createElementBlock("div",{key:c,class:n.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,model:d,schema:i.generateSchema(e.value,e.schema.items,c),onRemoveItem:m=>i.removeElement(c)},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:d,schema:i.generateSchema(e.value,e.schema.items,c),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):e.schema.items?(n.openBlock(),n.createElementBlock("span",Am,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:d,schema:i.generateSchema(e.value,e.schema.items,c),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${c}`,model:d,schema:i.generateSchema(e.value,e.schema.items,c),onRemoveItem:m=>i.removeElement(c)},{default:n.withCtx(()=>{var m,g;return[((m=e.schema.inputAttributes)==null?void 0:m.type)==="textarea"?(n.openBlock(),n.createBlock(l,{key:0,"aria-labelledby":e.getLabelId(e.schema),class:"k-input","form-options":e.formOptions,model:d,schema:i.generateSchema(e.value,e.schema.items,c),onModelUpdated:i.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):n.withDirectives((n.openBlock(),n.createElementBlock("input",n.mergeProps({key:1,"onUpdate:modelValue":f=>e.value[c]=f,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((g=e.schema.inputAttributes)==null?void 0:g.type)||"text"}),null,16,Om)),[[n.vModelDynamic,e.value[c]]]),e.schema.showRemoveButton?(n.openBlock(),n.createElementBlock("input",n.mergeProps({key:2,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||r.removeElementButtonLabel,onClick:f=>i.removeElement(c)}),null,16,Fm)):n.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):n.withDirectives((n.openBlock(),n.createElementBlock("input",n.mergeProps({key:3,ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":m=>e.value[c]=m,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,vm)),[[n.vModelText,e.value[c]]]),e.schema.showRemoveButton?(n.openBlock(),n.createElementBlock("input",n.mergeProps({key:4,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||r.removeElementButtonLabel,onClick:m=>i.removeElement(c)}),null,16,Dm)):n.createCommentVNode("",!0)],2))),128)),n.createVNode(s,{appearance:"tertiary",class:n.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:i.newElement},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.schema.newElementButtonLabel||r.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Vm)):n.createCommentVNode("",!0)}const Lm=C(Im,[["render",Um],["__scopeId","data-v-19b9d61e"]]),Pm={mixins:[B],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,t){this.$emit("model-updated",e,t)}}},jm={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Rm={class:"material-icons"};function qm(e,t,r,o,a,i){const l=n.resolveComponent("vue-form-generator");return n.openBlock(),n.createElementBlock("div",jm,[n.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:t[0]||(t[0]=(...s)=>i.handleOpen&&i.handleOpen(...s))},[n.createElementVNode("i",Rm,n.toDisplayString(a.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),n.createElementVNode("span",null,n.toDisplayString(i.titleText),1)]),n.createElementVNode("div",{class:n.normalizeClass(["advanced-field-dropdown",i.openClass])},[n.createVNode(l,{model:e.model,options:{helpAsHtml:!0},schema:e.schema,onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const zm=C(Pm,[["render",qm],["__scopeId","data-v-2d8e71e1"]]),xm={mixins:[B],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(e,t){if(t===null){this.fieldModel={...this.model};return}const r=this.schema.fields[e].fields,o=this.schema.fields[t].fields;o&&o.forEach(a=>this.updateModel("",a.model)),r&&r.forEach(a=>this.updateModel(this.fieldModel[a.model],a.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,t)=>{e.fields&&e.fields.forEach(r=>{this.model[r.model]&&(this.checkedGroup=t,this.fieldSchema.push(r.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,t){this.$emit("model-updated",e,t)}}},Km={class:"selection-group"},Hm={class:"form-group"},Ym=["value"],Gm={class:"control-help"},Zm={class:"option-field"},Wm={class:"option-field-container"};function Jm(e,t,r,o,a,i){const l=n.resolveComponent("vue-form-generator");return n.openBlock(),n.createElementBlock("div",Km,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.schema.fields,(s,d)=>(n.openBlock(),n.createElementBlock("div",{key:d,class:"option-group"},[n.createElementVNode("div",Hm,[n.createElementVNode("label",{class:n.normalizeClass(["k-label",`${s.label}-check`])},[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=c=>a.checkedGroup=c),class:"k-input",type:"radio",value:d},null,8,Ym),[[n.vModelRadio,a.checkedGroup]]),n.createTextVNode(" "+n.toDisplayString(s.label)+" ",1),n.createElementVNode("div",Gm,n.toDisplayString(s.description),1)],2)]),n.withDirectives(n.createElementVNode("div",Zm,[n.createElementVNode("div",Wm,[n.createVNode(l,{model:e.model,options:{helpAsHtml:!0},schema:{fields:s.fields},onModelUpdated:i.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[n.vShow,s.fields&&a.checkedGroup===d]])]))),128))])}const Xm=C(xm,[["render",Jm],["__scopeId","data-v-25fe24da"]]),Qm={mixins:[B],emits:["model-updated"],methods:{onUpdate(e){this.$emit("model-updated",e,this.schema.model)}}};function eh(e,t,r,o,a,i){const l=n.resolveComponent("KMultiselect");return n.openBlock(),n.createBlock(l,{"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 th=C(Qm,[["render",eh]]),nh={name:"FieldKeyValuePairs",components:{TrashIcon:Be},mixins:[B],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var t,r;this.value||(this.value={});const e=((r=this.model)==null?void 0:r[(t=this.schema)==null?void 0:t.model])??{};Object.keys(e).forEach(o=>{this.pairs.push({key:o,value:e[o]})})},methods:{onInput(e,t,r){this.pairs[t][r]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:t,value:r})=>({...e,...t&&r?{[t]:r}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},rh={class:"key-value-pairs-editor"},oh=["data-testid","placeholder","value","onInput"],ih=["data-testid","placeholder","value","onInput"];function ah(e,t,r,o,a,i){const l=n.resolveComponent("TrashIcon"),s=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",rh,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.pairs,(d,c)=>(n.openBlock(),n.createElementBlock("div",{key:c,class:"pair-item"},[n.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,oh),n.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,ih),n.createVNode(s,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{i.removePair(c)}},{default:n.withCtx(()=>[n.createVNode(l)]),_:2},1032,["data-testid","onClick"])]))),128)),n.createVNode(s,{appearance:"tertiary",class:n.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:i.addPair},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const sh={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:zm,FieldArray:Lm,FieldArrayCardContainer:tr,FieldArrayItem:Jn,FieldArrayMultiItem:Xn,FieldAutoSuggest:er,FieldCheckbox:tl,FieldChecklist:hl,FieldCleave:Vd,FieldDateTimePicker:Ud,FieldGoogleAddress:jd,FieldImage:Kd,FieldInput:Fn,FieldKeyValuePairs:C(nh,[["render",ah],["__scopeId","data-v-29d15375"]]),FieldLabel:fl,FieldMasked:Gd,FieldMetric:Qn,FieldMultiselect:th,FieldNoUiSlider:Xd,FieldObject:Yn,FieldObjectAdvanced:Wn,FieldPikaday:rc,FieldRadio:nr,FieldRadios:kl,FieldRangeSlider:ac,FieldSelect:zn,FieldSelectEx:mc,FieldSelectionGroup:Xm,FieldSpectrum:pc,FieldStaticMap:yc,FieldSubmit:wd,FieldTextArea:xn,FieldUpload:Md,fieldSwitch:wc},Symbol.toStringTag,{value:"Module"})),mixins:[vt],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:n.ref()}},methods:{fieldTypeHasLabel(e){if(v(e.label))return!1;let t="";switch(e.type==="input"?t=e.inputType:t=e.type,t){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const t=w(this.options,"fieldIdPrefix","");return ot(e,t)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldType(e){return"field-"+e.type},getButtonType(e){return w(e,"type","button")},onFieldValidated(e,t,r){this.$emit("validated",e,t,r)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,t,r){return e.onclick.call(this,this.model,t,r,this)},fieldHint(e){return T(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(t=>t.field.fieldName===e.fieldName).map(t=>t.error)},onModelUpdated(e,t){this.$emit("modelUpdated",e,t)},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\./,""):""}}},lh=e=>(n.pushScopeId("data-v-02e656fb"),e=e(),n.popScopeId(),e),dh=["innerHTML"],ch={class:"icon-wrapper"},mh=["innerHTML"],hh={key:0,class:"link-wrapper"},uh=lh(()=>n.createElementVNode("span",{class:"section-header"},"More info",-1)),ph={class:"field-wrap"},fh={key:0,class:"buttons"},gh=["type","onClick","textContent"],yh=["innerHTML"],bh={key:2,class:"errors help-block"},kh=["innerHTML"];function _h(e,t,r,o,a,i){const l=n.resolveComponent("KExternalLink"),s=n.resolveComponent("KLabel");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["form-group",e.getFieldRowClasses(r.field)])},[i.fieldTypeHasLabel(r.field)?(n.openBlock(),n.createBlock(s,{key:0,"aria-describedby":r.field.help?i.getTooltipId(r.field):void 0,class:n.normalizeClass([r.field.labelClasses,"form-group-label"]),for:i.getFieldID(r.field),info:!r.options.helpAsHtml&&r.field.help?r.field.help:void 0,"tooltip-attributes":r.field.help?{maxWidth:"300",placement:"top",tooltipId:i.getTooltipId(r.field)}:void 0},n.createSlots({default:n.withCtx(()=>[n.createElementVNode("div",ch,[n.createElementVNode("span",{innerHTML:i.formattedLabel(r.field.label)},null,8,mh)]),r.field.link?(n.openBlock(),n.createElementBlock("div",hh,[n.createVNode(l,{href:r.field.link},{default:n.withCtx(()=>[uh]),_:1},8,["href"])])):n.createCommentVNode("",!0)]),_:2},[r.options.helpAsHtml&&r.field.help?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{innerHTML:r.field.help},null,8,dh)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):n.createCommentVNode("",!0),n.createElementVNode("div",ph,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.getFieldType(r.field)),n.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(r.field)||null,"form-options":r.options,hint:r.field.hint&&i.getFieldType(r.field)==="field-input"?i.fieldHint(r.field):void 0,model:r.model,schema:r.field,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onValidated"])),i.buttonVisibility(r.field)?(n.openBlock(),n.createElementBlock("div",fh,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.field.buttons,(d,c)=>(n.openBlock(),n.createElementBlock("button",{key:c,class:n.normalizeClass(d.classes),type:i.getButtonType(d),onClick:m=>i.buttonClickHandler(d,r.field,m),textContent:n.toDisplayString(d.label)},null,10,gh))),128))])):n.createCommentVNode("",!0)]),r.field.hint&&i.getFieldType(r.field)!=="field-input"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"hint",innerHTML:i.fieldHint(r.field)},null,8,yh)):n.createCommentVNode("",!0),i.fieldErrors(r.field).length>0?(n.openBlock(),n.createElementBlock("div",bh,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.fieldErrors(r.field),(d,c)=>(n.openBlock(),n.createElementBlock("span",{key:c,innerHTML:d},null,8,kh))),128))])):n.createCommentVNode("",!0)],2)}const Ch={name:"FormGenerator",components:{formGroup:C(sh,[["render",_h],["__scopeId","data-v-02e656fb"]])},mixins:[vt],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:n.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:n.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&P(this.schema.fields,t=>{(!this.multiple||t.multi===!0)&&e.push(t)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&P(this.schema.groups.slice(0),t=>{e.push(t)}),e}},watch:{model:{deep:!0,handler(e,t){t!==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 T(e.visible)?e.visible.call(this,this.model,e,this):v(e.visible)?!0:e.visible},onFieldValidated(e,t,r){this.errors=this.errors.filter(a=>a.field.fieldName!==r.schema.fieldName),!e&&t&&t.length>0&&P(t,a=>{this.errors.push({field:r.schema,error:a})});const o=this.errors.length===0;this.$emit("validated",o,this.errors,this)},onModelUpdated(e,t){this.$emit("modelUpdated",e,t)},validate(e=null){e===null&&(e=w(this.options,"validateAsync",!1)),this.clearValidationErrors();const t=[],r=[];P(this.$refs.children,a=>{T(a.validate)&&(t.push(a.$refs.child),r.push(a.$refs.child.validate(!0)))});const o=a=>{const i=[];P(a,(s,d)=>{Array.isArray(s)&&s.length>0&&P(s,c=>{i.push({field:t[d].schema,error:c})})}),this.errors=i;const l=i.length===0;return this.$emit("validated",l,i,this),e?i:l};return e?Promise.all(r).then(o):o(r)},clearValidationErrors(){this.errors.splice(0),P(this.$refs.children,e=>{e.clearValidationErrors()})}}},wh={key:0,class:"vue-form-generator"},Eh={key:0};function Th(e,t,r,o,a,i){const l=n.resolveComponent("form-group"),s=n.resolveComponent("KCollapse");return r.schema!=null?(n.openBlock(),n.createElementBlock("div",wh,[r.schema.fields?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.tag),{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.fields,d=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:d.model},[i.fieldVisible(d)?(n.openBlock(),n.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:d,model:r.model,options:r.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):n.createCommentVNode("",!0)],64))),128))]),_:1})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.groups,(d,c)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:`group-${c}`},[d.collapsible!==void 0&&d.collapsible!==!1?(n.openBlock(),n.createBlock(s,{key:0,class:"root-level-collapse","model-value":!1,title:d.collapsible.title},n.createSlots({default:n.withCtx(()=>{var m,g,f,S;return[(m=d.slots)!=null&&m.beforeContent?n.renderSlot(e.$slots,(g=d.slots)==null?void 0:g.beforeContent,{key:0}):n.createCommentVNode("",!0),d.fields.length===0&&((f=d.slots)!=null&&f.emptyState)?n.renderSlot(e.$slots,(S=d.slots)==null?void 0:S.emptyState,{key:1}):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.tag),{key:2,class:n.normalizeClass(e.getFieldRowClasses(d))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.fields,E=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:E.model},[i.fieldVisible(E)?(n.openBlock(),n.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:E,model:r.model,options:r.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):n.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),d.collapsible!==!0&&d.collapsible.nestedCollapsible&&d.collapsible.nestedCollapsible.fields.length>0?(n.openBlock(),n.createBlock(s,{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":E=>a.collapseStates[`group-${c}-nested`]=E},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.tag),{class:n.normalizeClass(e.getFieldRowClasses(d))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.collapsible.nestedCollapsible.fields,E=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:E.model},[i.fieldVisible(E)?(n.openBlock(),n.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:E,model:r.model,options:r.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):n.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):n.createCommentVNode("",!0)]}),_:2},[d.collapsible.description?{name:"visible-content",fn:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.tag),{key:1,class:n.normalizeClass(e.getFieldRowClasses(d))},{default:n.withCtx(()=>[d.legend?(n.openBlock(),n.createElementBlock("legend",Eh,n.toDisplayString(d.legend),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.fields,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m.model},[i.fieldVisible(m)?(n.openBlock(),n.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:m,model:r.model,options:r.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):n.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):n.createCommentVNode("",!0)}const j=C(Ch,[["render",Th]]),Sh={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"}]},$h={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"}]},Bh={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"}]},Mh={name:"OIDCForm",components:{VueFormGenerator:j},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 t;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(r=>!r.model.startsWith("config")&&r.model!=="tags")},this.commonFieldsSchema={...Sh},this.authFieldsSchema={...$h},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(r=>r.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(o=>o.model===r.model).length&&!this.authFieldsSchema.fields.filter(o=>o.model===r.model).length||r.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(r=>{const o=Bh.fields.find(a=>a.model===r.model);return o||r}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(r=>r.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 r of this.formSchema.fields)e[r.model]=r;for(const r of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const o of r.fields){const a=(t=e[o.model])==null?void 0:t.help;o.help===void 0&&typeof a=="string"&&(o.help=a)}},getAuthMethodsValue(e,t){const r=[];for(let o=0;o<this.authMethods.length;o++)this.authMethods[o].prop&&this.authMethods[o].value!==e&&r.push(this.authMethods[o].value);return this.sessionManagement&&e&&r.push("session"),t&&(e?r.push(e):r.push("session")),r},handleUpdate(e,t){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(t,e),this.onModelUpdated()}}},ge=e=>(n.pushScopeId("data-v-e7395ff0"),e=e(),n.popScopeId(),e),Nh={class:"general-settings"},Ih={class:"link-wrapper"},Vh=ge(()=>n.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Ah=ge(()=>n.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"},Fh={class:"general-settings"},vh={class:"link-wrapper"},Dh=ge(()=>n.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Uh=ge(()=>n.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),Lh={class:"general-settings"},Ph={class:"link-wrapper"},jh=ge(()=>n.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Rh=ge(()=>n.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function qh(e,t,r,o,a,i){const l=n.resolveComponent("VueFormGenerator"),s=n.resolveComponent("KExternalLink"),d=n.resolveComponent("KLabel"),c=n.resolveComponent("KCheckbox"),m=n.resolveComponent("KInputSwitch"),g=n.resolveComponent("KTabs");return n.openBlock(),n.createElementBlock("div",null,[r.formModel.id&&r.isEditing||!r.isEditing?(n.openBlock(),n.createBlock(l,{key:0,class:"global-fields",model:r.formModel,options:r.formOptions,schema:a.globalFields,onModelUpdated:r.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),n.createVNode(g,{tabs:a.tabs},{common:n.withCtx(()=>[n.createElementVNode("div",Nh,[n.createElementVNode("div",Ih,[n.createVNode(s,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:n.withCtx(()=>[Vh]),_:1})]),Ah,i.displayForm?(n.openBlock(),n.createBlock(l,{key:0,model:r.formModel,options:r.formOptions,schema:a.commonFieldsSchema,onModelUpdated:r.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),n.createVNode(d,null,{default:n.withCtx(()=>[n.createTextVNode("Auth Methods")]),_:1}),n.createElementVNode("div",Oh,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.authMethods,f=>(n.openBlock(),n.createElementBlock("div",{key:f.value,class:"auth-method"},[n.createVNode(c,{modelValue:f.prop,"onUpdate:modelValue":S=>f.prop=S,onChange:S=>i.handleUpdate(S,f.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),n.createVNode(m,{modelValue:a.sessionManagement,"onUpdate:modelValue":t[0]||(t[0]=f=>a.sessionManagement=f),label:"Enable Session Management",onChange:i.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:n.withCtx(()=>[n.createElementVNode("div",Fh,[n.createElementVNode("div",vh,[n.createVNode(s,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:n.withCtx(()=>[Dh]),_:1})]),Uh,i.displayForm?(n.openBlock(),n.createBlock(l,{key:0,model:r.formModel,options:r.formOptions,schema:a.authFieldsSchema,onModelUpdated:r.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)])]),advanced:n.withCtx(()=>[n.createElementVNode("div",Lh,[n.createElementVNode("div",Ph,[n.createVNode(s,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:n.withCtx(()=>[jh]),_:1})]),Rh,i.displayForm?(n.openBlock(),n.createBlock(l,{key:0,model:r.formModel,options:r.formOptions,schema:a.advancedFieldsSchema,onModelUpdated:r.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const zh=C(Mh,[["render",qh],["__scopeId","data-v-e7395ff0"]]),rr={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"}}},xh=C(n.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,te:r}=ut.createI18n("en-us",rr),o=e,a=n.computed(()=>o.formModel.id&&o.isEditing||!o.isEditing),i=n.computed(()=>{const l=o.formSchema;return l.fields.map(s=>{const d=`post-function.${s.model}`;return s.hint=r(`${d}.hint`)&&t(`${d}.hint`)||s.hint,s.help=r(`${d}.help`)&&t(`${d}.help`)||s.help,s.newElementButtonLabel=r(`${d}.newElementButtonLabel`)&&t(`${d}.newElementButtonLabel`)||s.newElementButtonLabel,s.model!=="tags"&&(s.valueType==="array"||s.type==="array")&&(s.type="array",s.valueArrayType="array",s.itemContainerComponent="FieldArrayItem",s.fieldClasses="post-function-array-item-container",s.fieldItemsClasses="post-function-array-item",s.inputAttributes={...s.inputAttributes,type:"textarea"}),s}),l});return(l,s)=>a.value?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),Kh=C(n.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,te:r}=ut.createI18n("en-us",rr),o=e,a=n.computed(()=>o.formModel.id&&o.isEditing||!o.isEditing),i=n.computed(()=>{const l=o.formSchema;return l.fields.map(s=>{const d=`exit-transformer.${s.model}`;return s.hint=r(`${d}.hint`)&&t(`${d}.hint`)||s.hint,s.help=r(`${d}.help`)&&t(`${d}.help`)||s.help,s.newElementButtonLabel=r(`${d}.newElementButtonLabel`)&&t(`${d}.newElementButtonLabel`)||s.newElementButtonLabel,s.model!=="tags"&&(s.valueType==="array"||s.type==="array")&&(s.type="array",s.valueArrayType="array",s.itemContainerComponent="FieldArrayItem",s.fieldClasses="exit-transformer-array-item-container",s.fieldItemsClasses="exit-transformer-array-item",s.inputAttributes={...s.inputAttributes,type:"textarea"}),s}),l});return(l,s)=>a.value?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),Hh={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}]},Gh={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}]},ce=e=>(n.pushScopeId("data-v-b9df1c3f"),e=e(),n.popScopeId(),e),Zh={class:"general-settings"},Wh=ce(()=>n.createElementVNode("div",{class:"header-wrapper"},[n.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),Jh=ce(()=>n.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Xh=ce(()=>n.createElementVNode("hr",null,null,-1)),Qh={class:"sub-form"},eu={class:"general-settings"},tu=ce(()=>n.createElementVNode("div",{class:"header-wrapper"},[n.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),nu=ce(()=>n.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),ru={class:"sub-form"},ou={class:"general-settings"},iu=ce(()=>n.createElementVNode("div",{class:"header-wrapper"},[n.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),au=ce(()=>n.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),su=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:C(n.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 t=e,r=n.ref("zeroSsl"),o=n.ref("shm"),a=n.computed(()=>{var h;const p={};if((h=t.formSchema)!=null&&h.fields)for(const _ of t.formSchema.fields)p[_.model]=_;return p}),i=n.computed(()=>{var h;const p=rt(Hh);for(const _ of p.fields){const O=(h=a.value[_.model])==null?void 0:h.help;_.help===void 0&&typeof O=="string"&&(_.help=O)}return p}),l=n.computed(()=>{var h;const p=rt(Yh);for(const _ of p.fields){const O=(h=a.value[_.model])==null?void 0:h.help;_.help===void 0&&typeof O=="string"&&(_.help=O)}return p}),s=n.computed(()=>{var h;const p=rt(Gh);for(const _ of p.fields){const O=(h=a.value[_.model])==null?void 0:h.help;_.help===void 0&&typeof O=="string"&&(_.help=O)}return p}),d=n.computed(()=>({fields:t.formSchema.fields.filter(p=>!p.model.startsWith("config")&&p.model!=="tags")})),c=n.computed(()=>({fields:i.value.fields.filter(h=>!l.value.fields.some(_=>_.model===h.model)&&!s.value.fields.some(_=>_.model===h.model))})),m=n.computed(()=>({fields:t.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"))})),g=n.computed(()=>({fields:t.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-consul"))})),f=n.computed(()=>({fields:t.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-redis"))})),S=n.computed(()=>({fields:t.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-shm"))})),E=n.computed(()=>({fields:t.formSchema.fields.filter(h=>h.model.startsWith("config-storage_config-vault"))})),y=n.computed(()=>({fields:t.formSchema.fields.filter(p=>p.model.startsWith("config")&&!c.value.fields.filter(h=>h.model===p.model).length&&!m.value.fields.filter(h=>h.model===p.model).length||p.model==="tags")})),k=n.computed(()=>t.formModel.id&&t.isEditing||!t.isEditing),u=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],b=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];n.onMounted(()=>{r.value==="zeroSsl"&&(t.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const V=p=>{r.value=p.value,(p.value==="zeroSsl"||p.value==="other")&&(p.value==="zeroSsl"?t.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":t.formModel["config-api_uri"]="https://acme.example.com/",t.formModel["config-tos_accepted"]=!1),p.value==="letsEncrypt"&&(t.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",t.formModel["config-eab_hmac_key"]="",t.formModel["config-eab_kid"]=""),t.onModelUpdated()},A=(p,h)=>{h==="config-storage"&&(o.value=p),t.onModelUpdated()};return(p,h)=>{const _=n.resolveComponent("KSelect"),O=n.resolveComponent("KTabs");return n.openBlock(),n.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(n.openBlock(),n.createBlock(j,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:d.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),n.createVNode(O,{tabs:u},{general:n.withCtx(()=>[n.createElementVNode("div",Zh,[Wh,Jh,k.value?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),Xh,n.createVNode(_,{class:"issuer-select",items:b,label:"Issuer",onChange:V}),n.createElementVNode("div",Qh,[r.value==="letsEncrypt"?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),r.value==="zeroSsl"||r.value==="other"?(n.openBlock(),n.createBlock(j,{key:1,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)])])]),storage:n.withCtx(()=>[n.createElementVNode("div",eu,[tu,nu,k.value?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:A},null,8,["model","options","schema"])):n.createCommentVNode("",!0),n.createElementVNode("div",ru,[o.value==="consul"?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:g.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),o.value==="redis"?(n.openBlock(),n.createBlock(j,{key:1,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),o.value==="shm"?(n.openBlock(),n.createBlock(j,{key:2,model:e.formModel,options:e.formOptions,schema:S.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0),o.value==="vault"?(n.openBlock(),n.createBlock(j,{key:3,model:e.formModel,options:e.formOptions,schema:E.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)])])]),advanced:n.withCtx(()=>[n.createElementVNode("div",ou,[iu,au,k.value?(n.openBlock(),n.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:y.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):n.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-b9df1c3f"]]),ExitTransformer:Kh,OIDCForm:zh,PostFunction:xh},Symbol.toStringTag,{value:"Module"})),lu=["array","metric","advanced","selectionGroup","object-advanced"],du={install:e=>{e.component("VueFormGenerator",j)}},cu=(e,t=!1)=>({...t&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[e];M.FORMS_API_KEY=te,M.VueFormGenerator=j,M.abstractField=Js,M.customFields=lu,M.default=du,M.getSharedFormName=cu,M.sharedForms=su,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(U,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):(U=typeof globalThis<"u"?globalThis:U||self,t(U["kong-ui-public-forms"]={},U.Vue,U["kong-ui-public-i18n"]))})(this,function(U,t,Ze){"use strict";function Tt(e,n){for(var o=-1,i=e==null?0:e.length;++o<i&&n(e[o],o,e)!==!1;);return e}function go(e){return function(n,o,i){for(var a=-1,r=Object(n),s=i(n),l=s.length;l--;){var d=s[e?l:++a];if(o(r[d],d,r)===!1)break}return n}}var yo=go();const bo=yo;function _o(e,n){for(var o=-1,i=Array(e);++o<e;)i[o]=n(o);return i}var $t=typeof global=="object"&&global&&global.Object===Object&&global,wo=typeof self=="object"&&self&&self.Object===Object&&self,Y=$t||wo||Function("return this")(),W=Y.Symbol,Bt=Object.prototype,ko=Bt.hasOwnProperty,Co=Bt.toString,Te=W?W.toStringTag:void 0;function Eo(e){var n=ko.call(e,Te),o=e[Te];try{e[Te]=void 0;var i=!0}catch{}var a=Co.call(e);return i&&(n?e[Te]=o:delete e[Te]),a}var So=Object.prototype,To=So.toString;function $o(e){return To.call(e)}var Bo="[object Null]",No="[object Undefined]",Nt=W?W.toStringTag:void 0;function oe(e){return e==null?e===void 0?No:Bo:Nt&&Nt in Object(e)?Eo(e):$o(e)}function Z(e){return e!=null&&typeof e=="object"}var Mo="[object Arguments]";function Mt(e){return Z(e)&&oe(e)==Mo}var Vt=Object.prototype,Vo=Vt.hasOwnProperty,Io=Vt.propertyIsEnumerable,Je=Mt(function(){return arguments}())?Mt:function(e){return Z(e)&&Vo.call(e,"callee")&&!Io.call(e,"callee")},H=Array.isArray;function Ao(){return!1}var It=typeof U=="object"&&U&&!U.nodeType&&U,At=It&&typeof module=="object"&&module&&!module.nodeType&&module,Oo=At&&At.exports===It,Ot=Oo?Y.Buffer:void 0,Fo=Ot?Ot.isBuffer:void 0,$e=Fo||Ao,Uo=9007199254740991,Do=/^(?:0|[1-9]\d*)$/;function Xe(e,n){var o=typeof e;return n=n??Uo,!!n&&(o=="number"||o!="symbol"&&Do.test(e))&&e>-1&&e%1==0&&e<n}var Lo=9007199254740991;function Qe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Lo}var vo="[object Arguments]",Po="[object Array]",qo="[object Boolean]",Ro="[object Date]",xo="[object Error]",zo="[object Function]",jo="[object Map]",Ko="[object Number]",Ho="[object Object]",Yo="[object RegExp]",Go="[object Set]",Wo="[object String]",Zo="[object WeakMap]",Jo="[object ArrayBuffer]",Xo="[object DataView]",Qo="[object Float32Array]",ei="[object Float64Array]",ti="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ii="[object Uint8Array]",ri="[object Uint8ClampedArray]",ai="[object Uint16Array]",li="[object Uint32Array]",L={};L[Qo]=L[ei]=L[ti]=L[ni]=L[oi]=L[ii]=L[ri]=L[ai]=L[li]=!0,L[vo]=L[Po]=L[Jo]=L[qo]=L[Xo]=L[Ro]=L[xo]=L[zo]=L[jo]=L[Ko]=L[Ho]=L[Yo]=L[Go]=L[Wo]=L[Zo]=!1;function si(e){return Z(e)&&Qe(e.length)&&!!L[oe(e)]}function et(e){return function(n){return e(n)}}var Ft=typeof U=="object"&&U&&!U.nodeType&&U,Be=Ft&&typeof module=="object"&&module&&!module.nodeType&&module,di=Be&&Be.exports===Ft,tt=di&&$t.process,be=function(){try{var e=Be&&Be.require&&Be.require("util").types;return e||tt&&tt.binding&&tt.binding("util")}catch{}}(),Ut=be&&be.isTypedArray,nt=Ut?et(Ut):si,ci=Object.prototype,mi=ci.hasOwnProperty;function Dt(e,n){var o=H(e),i=!o&&Je(e),a=!o&&!i&&$e(e),r=!o&&!i&&!a&&nt(e),s=o||i||a||r,l=s?_o(e.length,String):[],d=l.length;for(var c in e)(n||mi.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||r&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Xe(c,d)))&&l.push(c);return l}var hi=Object.prototype;function Le(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||hi;return e===o}function Lt(e,n){return function(o){return e(n(o))}}var ui=Lt(Object.keys,Object),pi=Object.prototype,fi=pi.hasOwnProperty;function vt(e){if(!Le(e))return ui(e);var n=[];for(var o in Object(e))fi.call(e,o)&&o!="constructor"&&n.push(o);return n}function q(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var gi="[object AsyncFunction]",yi="[object Function]",bi="[object GeneratorFunction]",_i="[object Proxy]";function V(e){if(!q(e))return!1;var n=oe(e);return n==yi||n==bi||n==gi||n==_i}function _e(e){return e!=null&&Qe(e.length)&&!V(e)}function we(e){return _e(e)?Dt(e):vt(e)}function wi(e,n){return e&&bo(e,n,we)}function ki(e,n){return function(o,i){if(o==null)return o;if(!_e(o))return e(o,i);for(var a=o.length,r=n?a:-1,s=Object(o);(n?r--:++r<a)&&i(s[r],r,s)!==!1;);return o}}var Ci=ki(wi);const Ei=Ci;function ve(e){return e}function Si(e){return typeof e=="function"?e:ve}function z(e,n){var o=H(e)?Tt:Ei;return o(e,Si(n))}var Ti="[object Symbol]";function Pe(e){return typeof e=="symbol"||Z(e)&&oe(e)==Ti}var $i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bi=/^\w*$/;function ot(e,n){if(H(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||Pe(e)?!0:Bi.test(e)||!$i.test(e)||n!=null&&e in Object(n)}var it=Y["__core-js_shared__"],Pt=function(){var e=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ni(e){return!!Pt&&Pt in e}var Mi=Function.prototype,Vi=Mi.toString;function se(e){if(e!=null){try{return Vi.call(e)}catch{}try{return e+""}catch{}}return""}var Ii=/[\\^$.*+?()[\]{}|]/g,Ai=/^\[object .+?Constructor\]$/,Oi=Function.prototype,Fi=Object.prototype,Ui=Oi.toString,Di=Fi.hasOwnProperty,Li=RegExp("^"+Ui.call(Di).replace(Ii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vi(e){if(!q(e)||Ni(e))return!1;var n=V(e)?Li:Ai;return n.test(se(e))}function Pi(e,n){return e==null?void 0:e[n]}function de(e,n){var o=Pi(e,n);return vi(o)?o:void 0}var Ne=de(Object,"create");function qi(){this.__data__=Ne?Ne(null):{},this.size=0}function Ri(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var xi="__lodash_hash_undefined__",zi=Object.prototype,ji=zi.hasOwnProperty;function Ki(e){var n=this.__data__;if(Ne){var o=n[e];return o===xi?void 0:o}return ji.call(n,e)?n[e]:void 0}var Hi=Object.prototype,Yi=Hi.hasOwnProperty;function Gi(e){var n=this.__data__;return Ne?n[e]!==void 0:Yi.call(n,e)}var Wi="__lodash_hash_undefined__";function Zi(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Ne&&n===void 0?Wi:n,this}function ce(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var i=e[n];this.set(i[0],i[1])}}ce.prototype.clear=qi,ce.prototype.delete=Ri,ce.prototype.get=Ki,ce.prototype.has=Gi,ce.prototype.set=Zi;function Ji(){this.__data__=[],this.size=0}function Me(e,n){return e===n||e!==e&&n!==n}function qe(e,n){for(var o=e.length;o--;)if(Me(e[o][0],n))return o;return-1}var Xi=Array.prototype,Qi=Xi.splice;function er(e){var n=this.__data__,o=qe(n,e);if(o<0)return!1;var i=n.length-1;return o==i?n.pop():Qi.call(n,o,1),--this.size,!0}function tr(e){var n=this.__data__,o=qe(n,e);return o<0?void 0:n[o][1]}function nr(e){return qe(this.__data__,e)>-1}function or(e,n){var o=this.__data__,i=qe(o,e);return i<0?(++this.size,o.push([e,n])):o[i][1]=n,this}function ee(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var i=e[n];this.set(i[0],i[1])}}ee.prototype.clear=Ji,ee.prototype.delete=er,ee.prototype.get=tr,ee.prototype.has=nr,ee.prototype.set=or;var Ve=de(Y,"Map");function ir(){this.size=0,this.__data__={hash:new ce,map:new(Ve||ee),string:new ce}}function rr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Re(e,n){var o=e.__data__;return rr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function ar(e){var n=Re(this,e).delete(e);return this.size-=n?1:0,n}function lr(e){return Re(this,e).get(e)}function sr(e){return Re(this,e).has(e)}function dr(e,n){var o=Re(this,e),i=o.size;return o.set(e,n),this.size+=o.size==i?0:1,this}function te(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var i=e[n];this.set(i[0],i[1])}}te.prototype.clear=ir,te.prototype.delete=ar,te.prototype.get=lr,te.prototype.has=sr,te.prototype.set=dr;var cr="Expected a function";function rt(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(cr);var o=function(){var i=arguments,a=n?n.apply(this,i):i[0],r=o.cache;if(r.has(a))return r.get(a);var s=e.apply(this,i);return o.cache=r.set(a,s)||r,s};return o.cache=new(rt.Cache||te),o}rt.Cache=te;var mr=500;function hr(e){var n=rt(e,function(i){return o.size===mr&&o.clear(),i}),o=n.cache;return n}var ur=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pr=/\\(\\)?/g,fr=hr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(ur,function(o,i,a,r){n.push(a?r.replace(pr,"$1"):i||o)}),n});function gr(e,n){for(var o=-1,i=e==null?0:e.length,a=Array(i);++o<i;)a[o]=n(e[o],o,e);return a}var yr=1/0,qt=W?W.prototype:void 0,Rt=qt?qt.toString:void 0;function xt(e){if(typeof e=="string")return e;if(H(e))return gr(e,xt)+"";if(Pe(e))return Rt?Rt.call(e):"";var n=e+"";return n=="0"&&1/e==-yr?"-0":n}function zt(e){return e==null?"":xt(e)}function jt(e,n){return H(e)?e:ot(e,n)?[e]:fr(zt(e))}var br=1/0;function xe(e){if(typeof e=="string"||Pe(e))return e;var n=e+"";return n=="0"&&1/e==-br?"-0":n}function Kt(e,n){n=jt(n,e);for(var o=0,i=n.length;e!=null&&o<i;)e=e[xe(n[o++])];return o&&o==i?e:void 0}function N(e,n,o){var i=e==null?void 0:Kt(e,n);return i===void 0?o:i}function P(e){return e==null}var _r="[object String]";function me(e){return typeof e=="string"||!H(e)&&Z(e)&&oe(e)==_r}const Ht={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)?z(e.styleClasses,i=>o[i]=!0):me(e.styleClasses)&&(o[e.styleClasses]=!0),P(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 V(e.disabled)?e.disabled.call(this,this.model,e,this):P(e.disabled)?!1:e.disabled},fieldReadonly(e){return V(e.readonly)?e.readonly.call(this,this.model,e,this):P(e.readonly)?!1:e.readonly},fieldFeatured(e){return V(e.featured)?e.featured.call(this,this.model,e,this):P(e.featured)?!1:e.featured},fieldRequired(e){return V(e.required)?e.required.call(this,this.model,e,this):P(e.required)?!1:e.required}}};function wr(){this.__data__=new ee,this.size=0}function kr(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Cr(e){return this.__data__.get(e)}function Er(e){return this.__data__.has(e)}var Sr=200;function Tr(e,n){var o=this.__data__;if(o instanceof ee){var i=o.__data__;if(!Ve||i.length<Sr-1)return i.push([e,n]),this.size=++o.size,this;o=this.__data__=new te(i)}return o.set(e,n),this.size=o.size,this}function J(e){var n=this.__data__=new ee(e);this.size=n.size}J.prototype.clear=wr,J.prototype.delete=kr,J.prototype.get=Cr,J.prototype.has=Er,J.prototype.set=Tr;var ze=function(){try{var e=de(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Yt(e,n,o){n=="__proto__"&&ze?ze(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var $r=Object.prototype,Br=$r.hasOwnProperty;function Gt(e,n,o){var i=e[n];(!(Br.call(e,n)&&Me(i,o))||o===void 0&&!(n in e))&&Yt(e,n,o)}function je(e,n,o,i){var a=!o;o||(o={});for(var r=-1,s=n.length;++r<s;){var l=n[r],d=i?i(o[l],e[l],l,o,e):void 0;d===void 0&&(d=e[l]),a?Yt(o,l,d):Gt(o,l,d)}return o}function Nr(e,n){return e&&je(n,we(n),e)}function Mr(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Vr=Object.prototype,Ir=Vr.hasOwnProperty;function Ar(e){if(!q(e))return Mr(e);var n=Le(e),o=[];for(var i in e)i=="constructor"&&(n||!Ir.call(e,i))||o.push(i);return o}function Ke(e){return _e(e)?Dt(e,!0):Ar(e)}function Or(e,n){return e&&je(n,Ke(n),e)}var Wt=typeof U=="object"&&U&&!U.nodeType&&U,Zt=Wt&&typeof module=="object"&&module&&!module.nodeType&&module,Fr=Zt&&Zt.exports===Wt,Jt=Fr?Y.Buffer:void 0,Xt=Jt?Jt.allocUnsafe:void 0;function Ur(e,n){if(n)return e.slice();var o=e.length,i=Xt?Xt(o):new e.constructor(o);return e.copy(i),i}function Dr(e,n){var o=-1,i=e.length;for(n||(n=Array(i));++o<i;)n[o]=e[o];return n}function Lr(e,n){for(var o=-1,i=e==null?0:e.length,a=0,r=[];++o<i;){var s=e[o];n(s,o,e)&&(r[a++]=s)}return r}function Qt(){return[]}var vr=Object.prototype,Pr=vr.propertyIsEnumerable,en=Object.getOwnPropertySymbols,at=en?function(e){return e==null?[]:(e=Object(e),Lr(en(e),function(n){return Pr.call(e,n)}))}:Qt;function qr(e,n){return je(e,at(e),n)}function tn(e,n){for(var o=-1,i=n.length,a=e.length;++o<i;)e[a+o]=n[o];return e}var Rr=Lt(Object.getPrototypeOf,Object);const nn=Rr;var xr=Object.getOwnPropertySymbols,on=xr?function(e){for(var n=[];e;)tn(n,at(e)),e=nn(e);return n}:Qt;function zr(e,n){return je(e,on(e),n)}function rn(e,n,o){var i=n(e);return H(e)?i:tn(i,o(e))}function lt(e){return rn(e,we,at)}function jr(e){return rn(e,Ke,on)}var st=de(Y,"DataView"),dt=de(Y,"Promise"),ke=de(Y,"Set"),ct=de(Y,"WeakMap"),an="[object Map]",Kr="[object Object]",ln="[object Promise]",sn="[object Set]",dn="[object WeakMap]",cn="[object DataView]",Hr=se(st),Yr=se(Ve),Gr=se(dt),Wr=se(ke),Zr=se(ct),he=oe;(st&&he(new st(new ArrayBuffer(1)))!=cn||Ve&&he(new Ve)!=an||dt&&he(dt.resolve())!=ln||ke&&he(new ke)!=sn||ct&&he(new ct)!=dn)&&(he=function(e){var n=oe(e),o=n==Kr?e.constructor:void 0,i=o?se(o):"";if(i)switch(i){case Hr:return cn;case Yr:return an;case Gr:return ln;case Wr:return sn;case Zr:return dn}return n});const Ce=he;var Jr=Object.prototype,Xr=Jr.hasOwnProperty;function Qr(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&Xr.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var He=Y.Uint8Array;function mt(e){var n=new e.constructor(e.byteLength);return new He(n).set(new He(e)),n}function ea(e,n){var o=n?mt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ta=/\w*$/;function na(e){var n=new e.constructor(e.source,ta.exec(e));return n.lastIndex=e.lastIndex,n}var mn=W?W.prototype:void 0,hn=mn?mn.valueOf:void 0;function oa(e){return hn?Object(hn.call(e)):{}}function ia(e,n){var o=n?mt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ra="[object Boolean]",aa="[object Date]",la="[object Map]",sa="[object Number]",da="[object RegExp]",ca="[object Set]",ma="[object String]",ha="[object Symbol]",ua="[object ArrayBuffer]",pa="[object DataView]",fa="[object Float32Array]",ga="[object Float64Array]",ya="[object Int8Array]",ba="[object Int16Array]",_a="[object Int32Array]",wa="[object Uint8Array]",ka="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Ea="[object Uint32Array]";function Sa(e,n,o){var i=e.constructor;switch(n){case ua:return mt(e);case ra:case aa:return new i(+e);case pa:return ea(e,o);case fa:case ga:case ya:case ba:case _a:case wa:case ka:case Ca:case Ea:return ia(e,o);case la:return new i;case sa:case ma:return new i(e);case da:return na(e);case ca:return new i;case ha:return oa(e)}}var un=Object.create,Ta=function(){function e(){}return function(n){if(!q(n))return{};if(un)return un(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function $a(e){return typeof e.constructor=="function"&&!Le(e)?Ta(nn(e)):{}}var Ba="[object Map]";function Na(e){return Z(e)&&Ce(e)==Ba}var pn=be&&be.isMap,Ma=pn?et(pn):Na,Va="[object Set]";function Ia(e){return Z(e)&&Ce(e)==Va}var fn=be&&be.isSet,Aa=fn?et(fn):Ia,Oa=1,Fa=2,Ua=4,gn="[object Arguments]",Da="[object Array]",La="[object Boolean]",va="[object Date]",Pa="[object Error]",yn="[object Function]",qa="[object GeneratorFunction]",Ra="[object Map]",xa="[object Number]",bn="[object Object]",za="[object RegExp]",ja="[object Set]",Ka="[object String]",Ha="[object Symbol]",Ya="[object WeakMap]",Ga="[object ArrayBuffer]",Wa="[object DataView]",Za="[object Float32Array]",Ja="[object Float64Array]",Xa="[object Int8Array]",Qa="[object Int16Array]",el="[object Int32Array]",tl="[object Uint8Array]",nl="[object Uint8ClampedArray]",ol="[object Uint16Array]",il="[object Uint32Array]",D={};D[gn]=D[Da]=D[Ga]=D[Wa]=D[La]=D[va]=D[Za]=D[Ja]=D[Xa]=D[Qa]=D[el]=D[Ra]=D[xa]=D[bn]=D[za]=D[ja]=D[Ka]=D[Ha]=D[tl]=D[nl]=D[ol]=D[il]=!0,D[Pa]=D[yn]=D[Ya]=!1;function Ie(e,n,o,i,a,r){var s,l=n&Oa,d=n&Fa,c=n&Ua;if(o&&(s=a?o(e,i,a,r):o(e)),s!==void 0)return s;if(!q(e))return e;var h=H(e);if(h){if(s=Qr(e),!l)return Dr(e,s)}else{var y=Ce(e),b=y==yn||y==qa;if($e(e))return Ur(e,l);if(y==bn||y==gn||b&&!a){if(s=d||b?{}:$a(e),!l)return d?zr(e,Or(s,e)):qr(e,Nr(s,e))}else{if(!D[y])return a?e:{};s=Sa(e,y,l)}}r||(r=new J);var B=r.get(e);if(B)return B;r.set(e,s),Aa(e)?e.forEach(function(C){s.add(Ie(C,n,o,C,e,r))}):Ma(e)&&e.forEach(function(C,f){s.set(f,Ie(C,n,o,f,e,r))});var T=c?d?jr:lt:d?Ke:we,_=h?void 0:T(e);return Tt(_||e,function(C,f){_&&(f=C,C=e[f]),Gt(s,f,Ie(C,n,o,f,e,r))}),s}var rl=1,al=4;function ne(e){return Ie(e,rl|al)}const ht=(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,""),_n=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var ut=function(){return Y.Date.now()},ll=/\s/;function sl(e){for(var n=e.length;n--&&ll.test(e.charAt(n)););return n}var dl=/^\s+/;function cl(e){return e&&e.slice(0,sl(e)+1).replace(dl,"")}var wn=NaN,ml=/^[-+]0x[0-9a-f]+$/i,hl=/^0b[01]+$/i,ul=/^0o[0-7]+$/i,pl=parseInt;function pt(e){if(typeof e=="number")return e;if(Pe(e))return wn;if(q(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=q(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=cl(e);var o=hl.test(e);return o||ul.test(e)?pl(e.slice(2),o?2:8):ml.test(e)?wn:+e}var fl="Expected a function",gl=Math.max,yl=Math.min;function Ae(e,n,o){var i,a,r,s,l,d,c=0,h=!1,y=!1,b=!0;if(typeof e!="function")throw new TypeError(fl);n=pt(n)||0,q(o)&&(h=!!o.leading,y="maxWait"in o,r=y?gl(pt(o.maxWait)||0,n):r,b="trailing"in o?!!o.trailing:b);function B(p){var m=i,u=a;return i=a=void 0,c=p,s=e.apply(u,m),s}function T(p){return c=p,l=setTimeout(f,n),h?B(p):s}function _(p){var m=p-d,u=p-c,w=n-m;return y?yl(w,r-u):w}function C(p){var m=p-d,u=p-c;return d===void 0||m>=n||m<0||y&&u>=r}function f(){var p=ut();if(C(p))return k(p);l=setTimeout(f,_(p))}function k(p){return l=void 0,b&&i?B(p):(i=a=void 0,s)}function O(){l!==void 0&&clearTimeout(l),c=0,i=d=a=l=void 0}function F(){return l===void 0?s:k(ut())}function g(){var p=ut(),m=C(p);if(i=arguments,a=this,d=p,m){if(l===void 0)return T(d);if(y)return clearTimeout(l),l=setTimeout(f,n),B(d)}return l===void 0&&(l=setTimeout(f,n)),s}return g.cancel=O,g.flush=F,g}var bl="__lodash_hash_undefined__";function _l(e){return this.__data__.set(e,bl),this}function wl(e){return this.__data__.has(e)}function Oe(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new te;++n<o;)this.add(e[n])}Oe.prototype.add=Oe.prototype.push=_l,Oe.prototype.has=wl;function kn(e,n,o,i){for(var a=e.length,r=o+(i?1:-1);i?r--:++r<a;)if(n(e[r],r,e))return r;return-1}function kl(e){return e!==e}function Cl(e,n,o){for(var i=o-1,a=e.length;++i<a;)if(e[i]===n)return i;return-1}function El(e,n,o){return n===n?Cl(e,n,o):kn(e,kl,o)}function Sl(e,n){var o=e==null?0:e.length;return!!o&&El(e,n,0)>-1}function Tl(e,n,o){for(var i=-1,a=e==null?0:e.length;++i<a;)if(o(n,e[i]))return!0;return!1}function Cn(e,n){return e.has(n)}function $l(){}function ft(e){var n=-1,o=Array(e.size);return e.forEach(function(i){o[++n]=i}),o}var Bl=1/0,Nl=ke&&1/ft(new ke([,-0]))[1]==Bl?function(e){return new ke(e)}:$l,Ml=200;function Vl(e,n,o){var i=-1,a=Sl,r=e.length,s=!0,l=[],d=l;if(o)s=!1,a=Tl;else if(r>=Ml){var c=n?null:Nl(e);if(c)return ft(c);s=!1,a=Cn,d=new Oe}else d=n?[]:l;e:for(;++i<r;){var h=e[i],y=n?n(h):h;if(h=o||h!==0?h:0,s&&y===y){for(var b=d.length;b--;)if(d[b]===y)continue e;n&&d.push(y),l.push(h)}else a(d,y,o)||(d!==l&&d.push(y),l.push(h))}return l}function En(e){return e&&e.length?Vl(e):[]}var Il=0;function Sn(e){var n=++Il;return zt(e)+n}function Al(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 Tn=Math.max;function Ol(e,n,o){return n=Tn(n===void 0?e.length-1:n,0),function(){for(var i=arguments,a=-1,r=Tn(i.length-n,0),s=Array(r);++a<r;)s[a]=i[n+a];a=-1;for(var l=Array(n+1);++a<n;)l[a]=i[a];return l[n]=o(s),Al(e,this,l)}}function Fl(e){return function(){return e}}var Ul=ze?function(e,n){return ze(e,"toString",{configurable:!0,enumerable:!1,value:Fl(n),writable:!0})}:ve;const Dl=Ul;var Ll=800,vl=16,Pl=Date.now;function ql(e){var n=0,o=0;return function(){var i=Pl(),a=vl-(i-o);if(o=i,a>0){if(++n>=Ll)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var Rl=ql(Dl);function xl(e,n){return Rl(Ol(e,n,ve),e+"")}function zl(e,n,o){if(!q(o))return!1;var i=typeof n;return(i=="number"?_e(o)&&Xe(n,o.length):i=="string"&&n in o)?Me(o[n],e):!1}var $n=Object.prototype,jl=$n.hasOwnProperty,ie=xl(function(e,n){e=Object(e);var o=-1,i=n.length,a=i>2?n[2]:void 0;for(a&&zl(n[0],n[1],a)&&(i=1);++o<i;)for(var r=n[o],s=Ke(r),l=-1,d=s.length;++l<d;){var c=s[l],h=e[c];(h===void 0||Me(h,$n[c])&&!jl.call(e,c))&&(e[c]=r[c])}return e}),Kl=Y.isFinite;function Hl(e){return typeof e=="number"&&Kl(e)}var Bn=1/0,Yl=17976931348623157e292;function Gl(e){if(!e)return e===0?e:0;if(e=pt(e),e===Bn||e===-Bn){var n=e<0?-1:1;return n*Yl}return e===e?e:0}function Nn(e){var n=Gl(e),o=n%1;return n===n?o?n-o:n:0}function Wl(e){return typeof e=="number"&&e==Nn(e)}var Zl="[object Number]";function gt(e){return typeof e=="number"||Z(e)&&oe(e)==Zl}var Mn=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,re="\\d\\d?",ae="\\d\\d",Jl="\\d{3}",Xl="\\d{4}",Fe="[^\\s]+",Vn=/\[([^]*?)\]/gm;function In(e,n){for(var o=[],i=0,a=e.length;i<a;i++)o.push(e[i].substr(0,n));return o}var An=function(e){return function(n,o){var i=o[e].map(function(r){return r.toLowerCase()}),a=i.indexOf(n.toLowerCase());return a>-1?a:null}};function ue(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var i=0,a=n;i<a.length;i++){var r=a[i];for(var s in r)e[s]=r[s]}return e}var On=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Fn=["January","February","March","April","May","June","July","August","September","October","November","December"],Ql=In(Fn,3),es=In(On,3),Un={dayNamesShort:es,dayNames:On,monthNamesShort:Ql,monthNames:Fn,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Ye=ue({},Un),ts=function(e){return Ye=ue(Ye,e)},Dn=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},K=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},ns={D:function(e){return String(e.getDate())},DD:function(e){return K(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return K(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 K(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 K(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return K(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return K(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return K(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return K(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return K(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return K(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return K(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?"-":"+")+K(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+K(Math.floor(Math.abs(n)/60),2)+":"+K(Math.abs(n)%60,2)}},Ln=function(e){return+e-1},vn=[null,re],Pn=[null,Fe],qn=["isPm",Fe,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],Rn=["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}],os={D:["day",re],DD:["day",ae],Do:["day",re+Fe,function(e){return parseInt(e,10)}],M:["month",re,Ln],MM:["month",ae,Ln],YY:["year",ae,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",re,void 0,"isPm"],hh:["hour",ae,void 0,"isPm"],H:["hour",re],HH:["hour",ae],m:["minute",re],mm:["minute",ae],s:["second",re],ss:["second",ae],YYYY:["year",Xl],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",ae,function(e){return+e*10}],SSS:["millisecond",Jl],d:vn,dd:vn,ddd:Pn,dddd:Pn,MMM:["month",Fe,An("monthNamesShort")],MMMM:["month",Fe,An("monthNames")],a:qn,A:qn,ZZ:Rn,Z:Rn},Ge={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"},is=function(e){return ue(Ge,e)},rs=function(e,n,o){if(n===void 0&&(n=Ge.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=Ge[n]||n;var i=[];n=n.replace(Vn,function(r,s){return i.push(s),"@@@"});var a=ue(ue({},Ye),o);return n=n.replace(Mn,function(r){return ns[r](e,a)}),n.replace(/@@@/g,function(){return i.shift()})};function as(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=Ge[n]||n,e.length>1e3)return null;var i=new Date,a={year:i.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],s=[],l=n.replace(Vn,function(F,g){return s.push(Dn(g)),"@@@"}),d={},c={};l=Dn(l).replace(Mn,function(F){var g=os[F],p=g[0],m=g[1],u=g[3];if(d[p])throw new Error("Invalid format. "+p+" specified twice in format");return d[p]=!0,u&&(c[u]=!0),r.push(g),"("+m+")"}),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 h=e.match(new RegExp(l,"i"));if(!h)return null;for(var y=ue(ue({},Ye),o),b=1;b<h.length;b++){var B=r[b-1],T=B[0],_=B[2],C=_?_(h[b],y):+h[b];if(C==null)return null;a[T]=C}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 k=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],b=0,O=k.length;b<O;b++)if(d[k[b][0]]&&a[k[b][0]]!==f[k[b][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 X={format:rs,parse:as,defaultI18n:Un,setGlobalDateI18n:ts,setGlobalDateMasks:is};const x={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 G(e,n,o=x){return P(e)||e===""?n?[v(o.fieldIsRequired)]:[]:null}function v(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 pe={resources:x,required(e,n,o,i=x){return G(e,n.required,i)},number(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;const r=[];return Hl(e)?(!P(n.min)&&e<n.min&&r.push(v(i.numberTooSmall,n.min)),!P(n.max)&&e>n.max&&r.push(v(i.numberTooBig,n.max))):r.push(v(i.invalidNumber)),r},integer(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;const r=pe.number(e,n,o,i);return Wl(e)||r.push(v(i.invalidInteger)),r},double(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;if(!gt(e)||isNaN(e))return[v(i.invalidNumber)]},string(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;const r=[];return me(e)?(!P(n.min)&&e.length<n.min&&r.push(v(i.textTooSmall,e.length,n.min)),!P(n.max)&&e.length>n.max&&r.push(v(i.textTooBig,e.length,n.max))):r.push(v(i.thisNotText)),r},array(e,n,o,i=x){if(n.required){if(!Array.isArray(e))return[v(i.thisNotArray)];if(e.length===0)return[v(i.fieldIsRequired)]}if(!P(e)){if(!P(n.min)&&e.length<n.min)return[v(i.selectMinItems,n.min)];if(!P(n.max)&&e.length>n.max)return[v(i.selectMaxItems,n.max)]}},date(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;const r=new Date(e);if(isNaN(r.getDate()))return[v(i.invalidDate)];const s=[];if(!P(n.min)){const l=new Date(n.min);r.valueOf()<l.valueOf()&&s.push(v(i.dateIsEarly,X.format(r),X.format(l)))}if(!P(n.max)){const l=new Date(n.max);r.valueOf()>l.valueOf()&&s.push(v(i.dateIsLate,X.format(r),X.format(l)))}return s},regexp(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;if(!P(n.pattern)&&!new RegExp(n.pattern).test(e))return[v(i.invalidFormat)]},email(e,n,o,i=x){const a=G(e,n.required,i);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[v(i.invalidEmail)]},url(e,n,o,i=x){const a=G(e,n.required,i);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[v(i.invalidURL)]},creditCard(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;const r=/^(?: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(!r.test(s))return[v(i.invalidCard)];let l=0,d,c,h;for(let y=s.length-1;y>=0;y--)d=s.substring(y,y+1),c=parseInt(d,10),h?(c*=2,c>=10?l+=c%10+1:l+=c):l+=c,h=!h;if(!(l%10===0&&s))return[v(i.invalidCardNumber)]},alpha(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;if(!/^[a-zA-Z]*$/.test(e))return[v(i.invalidTextContainNumber)]},alphaNumeric(e,n,o,i=x){const a=G(e,n.required,i);if(a!=null)return a;if(!/^[a-zA-Z0-9]*$/.test(e))return[v(i.invalidTextContainSpec)]}};Object.keys(pe).forEach(e=>{const n=pe[e];V(n)&&(n.locale=o=>(i,a,r)=>n(i,a,r,ie(o,x)))});function xn(e){return me(e)?pe[e]!=null?pe[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function yt(e,n,o){let i=N(o.context,"schema.attributes",{});const a=n.value||"input";me(a)&&(i=N(i,a)||i),z(i,(r,s)=>{e.setAttribute(s,r)})}const I={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:yt,updated:yt,componentUpdated:yt}},computed:{value:{cache:!1,get(){let e;return V(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),V(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)?z(this.schema.validator,r=>{a.push(xn(r).bind(this))}):a.push(xn(this.schema.validator).bind(this)),z(a,r=>{if(n)o.push(r(this.value,this.schema,this.model));else{const s=r(this.value,this.schema,this.model);s&&V(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 i=a=>{let r=[];z(En(a),l=>{Array.isArray(l)&&l.length>0?r=r.concat(l):me(l)&&r.push(l)}),V(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,r,this.schema);const s=r.length===0;return e||this.$emit("validated",s,r,this),this.errors=r,r};return n?Promise.all(o).then(i):i(o)},debouncedValidate(){V(this.debouncedValidateFunc)||(this.debouncedValidateFunc=Ae(this.validate.bind(this),N(this.schema,"validateDebounceTime",N(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;V(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),V(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 i=this.model;const a=o.split(".");let r=0;const s=a.length;for(;r<s;){const l=a[r];if(r<s-1)i[l]!==void 0||(i[l]={}),i=i[l];else{i[l]=n;return}++r}},getFieldID(e,n=!1){const o=N(this.formOptions,"fieldIdPrefix","");return ht(e,o)+(n?"-"+Sn():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return N(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},ls=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"})),ss={mixins:[I]},ds=["id","autocomplete","disabled","name","required"];function cs(e,n,o,i,a,r){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,ds)),[[t.vModelCheckbox,e.value],[s,"input"]])}const S=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},ms=S(ss,[["render",cs]]);var hs=4;function zn(e){return Ie(e,hs)}const us={class:"wrapper"},ps=["disabled"],fs=["id","checked","disabled","onChange","name"],gs=["disabled"],ys={class:"info"},bs=t.createElementVNode("div",{class:"arrow"},null,-1),_s={class:"dropList"},ws=["id","checked","disabled","onChange","name"];function ks(e,n,o,i,a,r){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",us,[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(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>r.onChanged(d,l),name:r.getInputName(l)},null,40,fs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256))],8,ps)):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)=>r.onExpandCombo&&r.onExpandCombo(...l))},[t.createElementVNode("div",ys,t.toDisplayString(r.selectedCount)+" selected",1),bs],2),t.createElementVNode("div",_s,[a.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>r.onChanged(d,l),name:r.getInputName(l)},null,40,ws),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,gs))])),[[s,"wrapper"]])}const Cs=S({mixins:[I],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?_n(this.schema.inputName+"_"+this.getItemValue(e)):_n(this.getItemValue(e))},getItemValue(e){if(q(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(q(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((P(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=zn(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=zn(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",ks]]);function Es(e){const n=t.ref([]),o=t.ref(null),i=_=>me(_)?pe[_]!=null?pe[_]:(console.warn(`'${_}' is not a validator function!`),null):_,a=t.computed({get(){var C,f;let _;return V(N(e.schema,"get"))?_=e.schema.get((C=e.model)==null?void 0:C.value):_=N((f=e.model)==null?void 0:f.value,e.schema.model),B(_)},set(_){const C=a;_=T(_),V(_)?_(_,C):l(_,C)}}),r=_=>{var F;d();const C=(F=e.schema)==null?void 0:F.validator,f=N(e.formOptions,"validateAsync",!1);let k=[];if(C&&e.schema.readonly!==!0&&e.disabled!==!0){const g=[];Array.isArray(C)?z(C,p=>{g.push(i(p))}):g.push(i(C)),z(g,p=>{var m,u;if(f)k.push(p(a.value,e.schema,(m=e.model)==null?void 0:m.value));else{const w=p(a.value,e.schema,(u=e.model)==null?void 0:u.value);w&&V(w.then)?w.then(E=>{E&&(n.value=n.value.concat(E));const M=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:M,errors:n.value,field:e.schema})}):w&&(k=k.concat(w))}})}const O=g=>{var m,u;let p=[];if(z(En(g),w=>{Array.isArray(w)&&w.length>0?p=p.concat(w):me(w)&&p.push(w)}),V((m=e.schema)==null?void 0:m.onValidated)&&e.schema.onValidated((u=e.model)==null?void 0:u.value,p,e.schema),!_){const w=p.length===0;e.emitValidated&&e.emitValidated({isValid:w,errors:p,field:e.schema})}return g=p,p};return f?Promise.all(k).then(O):O(k)},s=()=>{V(o.value)?o.value():o.value=Ae(r,N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",500)))},l=(_,C)=>{var k,O,F;let f=!1;V(e.schema.set)?(e.schema.set((k=e.model)==null?void 0:k.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}),V(e.schema.onChanged)&&e.schema.onChanged((F=e.model)==null?void 0:F.value,_,C,e.schema),N(e.formOptions,"validateAfterChanged",!1)===!0&&(N(e.schema,"validateDebounceTime",N(e.formOptions,"validateDebounceTime",0))>0?s():r()))},d=()=>{n.value.splice(0)},c=(_,C)=>{var p;let f=_.replace(/\[(\w+)\]/g,".$1");f=f.replace(/^\./,"");let k=((p=e.model)==null?void 0:p.value)||{},O=0;const F=f.split("."),g=F.length;for(;O<g;){const m=F[O];if(O<g-1)k[m]!==void 0||(k[m]={}),k=k[m];else{k[m]=C;return}++O}},h=(_,C=!1)=>{const f=N(e.formOptions,"fieldIdPrefix","");return ht(_,f)+(C?"-"+Sn():"")},y=_=>`${h(_)}-label`,b=()=>N(e.schema,"fieldClasses",[]),B=_=>_,T=_=>_;return{value:a,clearValidationErrors:d,getFieldID:h,getLabelId:y,getFieldClasses:b,updateModelValue:l}}const jn={useAbstractFields:Es},Ss={class:"form-field-wrapper"},Kn=S(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 i=e,a=o,r=t.toRefs(i),{updateModelValue:s,getFieldID:l,clearValidationErrors:d,value:c}=jn.useAbstractFields({model:r.model,schema:i.schema,formOptions:i.formOptions,emitModelUpdated:f=>{a("modelUpdated",f.value,f.model)}});n({clearValidationErrors:d});const h=t.computed(()=>{var k;const f=(k=i.schema)==null?void 0:k.inputType.toLowerCase();return f==="string"?"text":f==="datetime"?"datetime-local":f||"text"}),y={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},b=(f,k)=>{var p,m;let O=f;const F=y[h.value]||"",g=X.parse(f,F);g&&((p=i.schema)!=null&&p.format?O=X.format(g,(m=i.schema)==null?void 0:m.format):O=g.valueOf()),s(O,k)},B=(f,k)=>{gt(f)||(f=NaN),s(f,k)},T=f=>{let k=f;switch(h.value){case"number":case"range":gt(parseFloat(f))&&(k=parseFloat(f));break}c.value=k,s(k,f)},_=t.ref(null),C=()=>{var f;V(_.value)&&((f=_.value)==null||f.flush())};return t.onMounted(()=>{switch(h.value){case"number":case"range":_.value=Ae((f,k)=>{B(f,k)},parseInt(N(i.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":_.value=Ae((f,k)=>{b(f,k)},parseInt(N(i.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{h.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):h.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):h.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(f,k)=>{const O=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",Ss,[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:h.value==="color"||h.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:h.value,width:e.schema.width,onBlur:C,"onUpdate:modelValue":T}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","type","width"])])}}}),[["__scopeId","data-v-b6d4701b"]]),Ts=S(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:i,value:a}=jn.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(r,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(i)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-852ab959"]]),$s=["disabled"],Bs=["id","disabled","name","onClick","value","checked","required"];function Ns(e,n,o,i,a,r){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(r.items,l=>t.withDirectives((t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(r.getItemCssClasses(l))},[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"radio",disabled:r.isItemDisabled(l)||null,name:r.id,onClick:d=>r.onSelection(l),value:r.getItemValue(l),checked:r.isItemChecked(l)||null,class:t.normalizeClass(e.schema.fieldClasses),required:e.schema.required},null,10,Bs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)],2)),[[s,"label"]])),256))],8,$s)),[[s,"wrapper"]])}const Ms=S({mixins:[I],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(q(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(q(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 V(n)?n(this.model):n}}},[["render",Ns]]);function Vs(e,n){for(var o=-1,i=e==null?0:e.length;++o<i;)if(n(e[o],o,e))return!0;return!1}var Is=1,As=2;function Hn(e,n,o,i,a,r){var s=o&Is,l=e.length,d=n.length;if(l!=d&&!(s&&d>l))return!1;var c=r.get(e),h=r.get(n);if(c&&h)return c==n&&h==e;var y=-1,b=!0,B=o&As?new Oe:void 0;for(r.set(e,n),r.set(n,e);++y<l;){var T=e[y],_=n[y];if(i)var C=s?i(_,T,y,n,e,r):i(T,_,y,e,n,r);if(C!==void 0){if(C)continue;b=!1;break}if(B){if(!Vs(n,function(f,k){if(!Cn(B,k)&&(T===f||a(T,f,o,i,r)))return B.push(k)})){b=!1;break}}else if(!(T===_||a(T,_,o,i,r))){b=!1;break}}return r.delete(e),r.delete(n),b}function Os(e){var n=-1,o=Array(e.size);return e.forEach(function(i,a){o[++n]=[a,i]}),o}var Fs=1,Us=2,Ds="[object Boolean]",Ls="[object Date]",vs="[object Error]",Ps="[object Map]",qs="[object Number]",Rs="[object RegExp]",xs="[object Set]",zs="[object String]",js="[object Symbol]",Ks="[object ArrayBuffer]",Hs="[object DataView]",Yn=W?W.prototype:void 0,bt=Yn?Yn.valueOf:void 0;function Ys(e,n,o,i,a,r,s){switch(o){case Hs:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case Ks:return!(e.byteLength!=n.byteLength||!r(new He(e),new He(n)));case Ds:case Ls:case qs:return Me(+e,+n);case vs:return e.name==n.name&&e.message==n.message;case Rs:case zs:return e==n+"";case Ps:var l=Os;case xs:var d=i&Fs;if(l||(l=ft),e.size!=n.size&&!d)return!1;var c=s.get(e);if(c)return c==n;i|=Us,s.set(e,n);var h=Hn(l(e),l(n),i,a,r,s);return s.delete(e),h;case js:if(bt)return bt.call(e)==bt.call(n)}return!1}var Gs=1,Ws=Object.prototype,Zs=Ws.hasOwnProperty;function Js(e,n,o,i,a,r){var s=o&Gs,l=lt(e),d=l.length,c=lt(n),h=c.length;if(d!=h&&!s)return!1;for(var y=d;y--;){var b=l[y];if(!(s?b in n:Zs.call(n,b)))return!1}var B=r.get(e),T=r.get(n);if(B&&T)return B==n&&T==e;var _=!0;r.set(e,n),r.set(n,e);for(var C=s;++y<d;){b=l[y];var f=e[b],k=n[b];if(i)var O=s?i(k,f,b,n,e,r):i(f,k,b,e,n,r);if(!(O===void 0?f===k||a(f,k,o,i,r):O)){_=!1;break}C||(C=b=="constructor")}if(_&&!C){var F=e.constructor,g=n.constructor;F!=g&&"constructor"in e&&"constructor"in n&&!(typeof F=="function"&&F instanceof F&&typeof g=="function"&&g instanceof g)&&(_=!1)}return r.delete(e),r.delete(n),_}var Xs=1,Gn="[object Arguments]",Wn="[object Array]",We="[object Object]",Qs=Object.prototype,Zn=Qs.hasOwnProperty;function ed(e,n,o,i,a,r){var s=H(e),l=H(n),d=s?Wn:Ce(e),c=l?Wn:Ce(n);d=d==Gn?We:d,c=c==Gn?We:c;var h=d==We,y=c==We,b=d==c;if(b&&$e(e)){if(!$e(n))return!1;s=!0,h=!1}if(b&&!h)return r||(r=new J),s||nt(e)?Hn(e,n,o,i,a,r):Ys(e,n,d,o,i,a,r);if(!(o&Xs)){var B=h&&Zn.call(e,"__wrapped__"),T=y&&Zn.call(n,"__wrapped__");if(B||T){var _=B?e.value():e,C=T?n.value():n;return r||(r=new J),a(_,C,o,i,r)}}return b?(r||(r=new J),Js(e,n,o,i,a,r)):!1}function _t(e,n,o,i,a){return e===n?!0:e==null||n==null||!Z(e)&&!Z(n)?e!==e&&n!==n:ed(e,n,o,i,_t,a)}var td=1,nd=2;function od(e,n,o,i){var a=o.length,r=a,s=!i;if(e==null)return!r;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<r;){l=o[a];var d=l[0],c=e[d],h=l[1];if(s&&l[2]){if(c===void 0&&!(d in e))return!1}else{var y=new J;if(i)var b=i(c,h,d,e,n,y);if(!(b===void 0?_t(h,c,td|nd,i,y):b))return!1}}return!0}function Jn(e){return e===e&&!q(e)}function id(e){for(var n=we(e),o=n.length;o--;){var i=n[o],a=e[i];n[o]=[i,a,Jn(a)]}return n}function Xn(e,n){return function(o){return o==null?!1:o[e]===n&&(n!==void 0||e in Object(o))}}function rd(e){var n=id(e);return n.length==1&&n[0][2]?Xn(n[0][0],n[0][1]):function(o){return o===e||od(o,e,n)}}function ad(e,n){return e!=null&&n in Object(e)}function ld(e,n,o){n=jt(n,e);for(var i=-1,a=n.length,r=!1;++i<a;){var s=xe(n[i]);if(!(r=e!=null&&o(e,s)))break;e=e[s]}return r||++i!=a?r:(a=e==null?0:e.length,!!a&&Qe(a)&&Xe(s,a)&&(H(e)||Je(e)))}function sd(e,n){return e!=null&&ld(e,n,ad)}var dd=1,cd=2;function md(e,n){return ot(e)&&Jn(n)?Xn(xe(e),n):function(o){var i=N(o,e);return i===void 0&&i===n?sd(o,e):_t(n,i,dd|cd)}}function hd(e){return function(n){return n==null?void 0:n[e]}}function ud(e){return function(n){return Kt(n,e)}}function pd(e){return ot(e)?hd(xe(e)):ud(e)}function Qn(e){return typeof e=="function"?e:e==null?ve:typeof e=="object"?H(e)?md(e[0],e[1]):rd(e):pd(e)}function fd(e){return function(n,o,i){var a=Object(n);if(!_e(n)){var r=Qn(o);n=we(n),o=function(l){return r(a[l],l,a)}}var s=e(n,o,i);return s>-1?a[r?n[s]:s]:void 0}}var gd=Math.max;function yd(e,n,o){var i=e==null?0:e.length;if(!i)return-1;var a=o==null?0:Nn(o);return a<0&&(a=gd(i+a,0)),kn(e,Qn(n),a)}var bd=fd(yd);const _d=["disabled","name","id"],wd=["disabled"],kd=["label"],Cd=["value"],Ed=["value"];function Sd(e,n,o,i,a,r){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)},[r.selectOptions.hideNoneSelectedText?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:0,disabled:e.schema.required||null,value:null},t.toDisplayString(r.selectOptions.noneSelectedText||"<Nothing selected>"),9,wd)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[l.group?(t.openBlock(),t.createElementBlock("optgroup",{key:0,label:r.getGroupName(l)},[l.ops?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(l.ops,d=>(t.openBlock(),t.createElementBlock("option",{value:r.getItemValue(d)},t.toDisplayString(r.getItemName(d)),9,Cd))),256)):t.createCommentVNode("",!0)],8,kd)):t.createCommentVNode("",!0),l.group?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("option",{key:1,value:r.getItemValue(l)},t.toDisplayString(r.getItemName(l)),9,Ed))],64))),256))],10,_d)),[[t.vModelSelect,e.value],[s,"input"]])}const eo=S({mixins:[I],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 P(e)?null:e},groupValues(e){const n=[];let o={};return e.forEach(i=>{o=null,i.group&&q(i)?(o=bd(n,a=>a.group===i.group),o?o.ops.push({id:i.id,name:i.name}):(o={group:"",ops:[]},o.group=i.group,o.ops.push({id:i.id,name:i.name}),n.push(o))):n.push(i)}),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(q(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(q(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",Sd]]);var Td="[object Map]",$d="[object Set]",Bd=Object.prototype,Nd=Bd.hasOwnProperty;function Md(e){if(e==null)return!0;if(_e(e)&&(H(e)||typeof e=="string"||typeof e.splice=="function"||$e(e)||nt(e)||Je(e)))return!e.length;var n=Ce(e);if(n==Td||n==$d)return!e.size;if(Le(e))return!vt(e).length;for(var o in e)if(Nd.call(e,o))return!1;return!0}const Vd=["id","value","name","disabled"];function Id(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("input",{id:e.getFieldID(e.schema),type:"submit",value:e.schema.buttonText,onClick:n[0]||(n[0]=(...s)=>r.onClick&&r.onClick(...s)),name:e.schema.inputName,disabled:e.disabled||null,class:t.normalizeClass(e.schema.fieldClasses)},null,10,Vd)}const Ad=S({mixins:[I],methods:{onClick(e){if(this.schema.validateBeforeSubmit===!0){e.preventDefault();const n=N(this.formOptions,"validateAsync",!1),o=this.vfg.validate(),i=a=>{n&&!Md(a)||!n&&!a?V(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,a,e):V(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)};o&&V(o.then)?o.then(i):i(o)}else V(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,e)}}},[["render",Id]]),Od=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function Fd(e,n,o,i,a,r){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,Od)),[[t.vModelText,e.value],[s,"input"]])}const to=S({mixins:[I]},[["render",Fd]]),Ud={class:"wrapper"},Dd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function Ld(e,n,o,i,a,r){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Ud,[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)=>r.onChange&&r.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,Dd),[[s,"input"]])])),[[s,"wrapper"]])}const vd=S({mixins:[I],methods:{onChange(e){V(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,e,this)}}},[["render",Ld]]),Pd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function qd(e,n,o,i,a,r){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,Pd)}const Rd=S({mixins:[I],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,ie(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",qd]]),no={formatValueToField(e){if(e!=null){const n=this.schema.format?X.parse(e,this.schema.format):new Date(e);return X.format(n,this.getDateFormat())}return e},formatValueToModel(e){if(e!=null){const n=X.parse(e,this.getDateFormat());this.schema.format?e=X.format(n,this.schema.format):e=n.valueOf()}return e}},xd={class:"input-group date"},zd=["autocomplete","disabled","placeholder","readonly","name","id"],jd=t.createElementVNode("span",{class:"input-group-addon"},[t.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function Kd(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("div",xd,[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,zd),[[t.vModelText,e.value]]),jd])}const oo="YYYY-MM-DD HH:mm:ss",Hd={mixins:[I],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const e=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(ie(this.schema.dateTimePickerOptions||{},{format:oo})).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:oo},...no}},Yd=S(Hd,[["render",Kd]]),Gd=["autocomplete","disabled","placeholder","readonly","name","id"];function Wd(e,n,o,i,a,r){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=>r.geolocate()),id:e.getFieldID(e.schema)},null,40,Gd)),[[t.vModelText,e.value]])}const Zd=S({mixins:[I],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 i=e.address_components[o].types[0];this.inputs[i]&&(n[i]=e.address_components[o][this.inputs[i]])}V(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",Wd]]),Jd={class:"wrapper"},Xd=["autocomplete","disabled","placeholder","readonly"],Qd=["disabled","name"];function ec(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("div",Jd,[t.withDirectives(t.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":n[0]||(n[0]=s=>r.wrappedValue=s),autocomplete:e.schema.autocomplete,disabled:e.disabled||null,placeholder:e.schema.placeholder,readonly:e.schema.readonly},null,8,Xd),[[t.vShow,e.schema.hideInput!==!0],[t.vModelText,r.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)=>r.fileChanged&&r.fileChanged(...s)),name:e.schema.inputName},null,40,Qd)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"preview",style:t.normalizeStyle(r.previewStyle)},[t.createElementVNode("div",{class:"remove",title:"Remove image",onClick:n[2]||(n[2]=(...s)=>r.remove&&r.remove(...s))})],4)])}const tc=S({mixins:[I],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",ec]]),nc=["autocomplete","disabled","placeholder","readonly","name","id"];function oc(e,n,o,i,a,r){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,nc)),[[t.vModelText,e.value]])}const ic=S({mixins:[I],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",oc]]),rc={mixins:[I],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,ie(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}}},ac=["disabled"];function lc(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["slider",{"contain-pips":r.containPips,"contain-tooltip":r.containTooltip}]),disabled:e.disabled||null},null,10,ac)}const sc=S(rc,[["render",lc]]),dc=["autocomplete","disabled","placeholder","readonly","name"];function cc(e,n,o,i,a,r){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,dc)),[[t.vModelText,e.value]])}const mc="YYYY-MM-DD",hc={mixins:[I],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",mc)},...no,initialize(e){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=ie({},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!")})}}},uc=S(hc,[["render",cc]]),pc=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function fc(e,n,o,i,a,r){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,pc)}const gc=S({mixins:[I],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(ie(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:e,to:n,onChange(i){o.slider.options.type==="double"?o.value=[i.from,i.to]:o.value=i.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",fc]]),yc=["disabled","multiple","title","name"],bc=["disabled","selected"],_c=["value"];function wc(e,n,o,i,a,r){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,bc)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,s=>(t.openBlock(),t.createElementBlock("option",{value:r.getItemValue(s)},t.toDisplayString(r.getItemName(s)),9,_c))),256))],8,yc)),[[t.vModelSelect,e.value]])}const kc=S({mixins:[I],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(q(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(q(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",wc]]),Cc=["autocomplete","disabled","placeholder","readonly","name","id"];function Ec(e,n,o,i,a,r){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,Cc)}const Sc=S({mixins:[I],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(ie(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",Ec]]),Tc=["src"];function $c(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("img",{src:r.mapLink},null,8,Tc)}const Bc=S({mixins:[I],computed:{mapLink(){let e,n,o;if(this.value){const i=ie(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});e=this.value[i.lat],n=this.value[i.lng],o=`http://maps.googleapis.com/maps/api/staticmap?center=${e},${n}&zoom=${i.zoom}&size=${i.sizeX}x${i.sizeY}`;const a=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const r of a)typeof i[r]<"u"&&(o+=`&${r}=${i[r]}`)}return o}}},[["render",$c]]),Nc=["autocomplete","disabled","name","id"],Mc=["data-on","data-off","for"],Vc=t.createElementVNode("span",{class:"handle"},null,-1);function Ic(e,n,o,i,a,r){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,Nc),[[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,Mc),Vc])}const Ac=S({mixins:[I],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",Ic]]),Oc={mixins:[I],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 i=e[o];n[i]=typeof this.value[i]}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=""}}},Fc={key:0},Uc={key:1},Dc=["id"],Lc={key:0},vc=["onUpdate:modelValue"],Pc={key:1},qc=["onUpdate:modelValue"],Rc={key:2},xc=["onUpdate:modelValue"],zc=["onClick"],jc=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function Kc(e,n,o,i,a,r){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",Fc,[t.createVNode(s,{model:e.value,options:e.formOptions,schema:e.schema.schema},null,8,["model","options","schema"])])):(t.openBlock(),t.createElementBlock("div",Uc,[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",Lc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":h=>e.value[c]=h,type:"text"},null,8,vc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="boolean"?(t.openBlock(),t.createElementBlock("td",Pc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":h=>e.value[c]=h,type:"checkbox"},null,8,qc),[[t.vModelCheckbox,e.value[c]]])])):t.createCommentVNode("",!0),a.keyTypes[c]==="number"?(t.openBlock(),t.createElementBlock("td",Rc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":h=>e.value[c]=h,type:"number"},null,8,xc),[[t.vModelText,e.value[c]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:h=>r.removeElement(c)},null,8,zc)])]))),128))],10,Dc),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":n[0]||(n[0]=d=>a.newKeyType=d)},jc,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)=>r.addKey&&r.addKey(...d))})]))])),[[l,a.attributes]])}const io=S(Oc,[["render",Kc]]),Ee="24px",wt=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},Hc=e=>(t.pushScopeId("data-v-1d2a8d30"),e=e(),t.popScopeId(),e),Yc=["aria-hidden"],Gc={key:0,"data-testid":"kui-icon-svg-title"},Wc=Hc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Zc=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:Ee,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,""),r=Number(a);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return`${r}px`}return Ee}),i=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,r)=>(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(i.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",Gc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Wc],8,Yc))]),_:1},8,["aria-hidden","style"]))}}),ro=wt(Zc,[["__scopeId","data-v-1d2a8d30"]]),Jc=e=>(t.pushScopeId("data-v-ddb48b32"),e=e(),t.popScopeId(),e),Xc=["aria-hidden"],Qc={key:0,"data-testid":"kui-icon-svg-title"},em=Jc(()=>t.createElementVNode("path",{d:"M5 13V11H19V13H5Z",fill:"currentColor"},null,-1)),tm=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:Ee,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,""),r=Number(a);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return`${r}px`}return Ee}),i=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,r)=>(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(i.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",Qc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),em],8,Xc))]),_:1},8,["aria-hidden","style"]))}}),nm=wt(tm,[["__scopeId","data-v-ddb48b32"]]),om=e=>(t.pushScopeId("data-v-b199fa56"),e=e(),t.popScopeId(),e),im=["aria-hidden"],rm={key:0,"data-testid":"kui-icon-svg-title"},am=om(()=>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)),lm=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:Ee,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,""),r=Number(a);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return`${r}px`}return Ee}),i=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,r)=>(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(i.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",rm,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),am],8,im))]),_:1},8,["aria-hidden","style"]))}}),Ue=wt(lm,[["__scopeId","data-v-b199fa56"]]),sm={components:{TrashIcon:Ue},mixins:[I],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 i={};return Object.keys(e).map(a=>{const r=a.indexOf(o+"-");if(r>-1&&Array.isArray(n))if(n.length>0){const l=a.split("-").filter(c=>n.find(h=>h.model===c)),d=a.split(`-${l}`)[0].split(`${o}-`)[1];l.length?i[d]={...i[d],[l]:e[a]}:i[a.substring(r+`${o}-`.length)]=e[a]}else i[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&&(i[d]=e[a])}return a}),i},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)}}},ao=e=>(t.pushScopeId("data-v-106caf87"),e=e(),t.popScopeId(),e),dm=["id"],cm=["data-testid"],mm={class:"item-wrapper"},hm={class:"index-wrapper"},um=ao(()=>t.createElementVNode("hr",{class:"divider"},null,-1)),pm={key:0},fm={key:1},gm=["onUpdate:modelValue","placeholder","onInput"],ym={key:0,class:"hint"},bm=ao(()=>t.createElementVNode("hr",{class:"wide-divider"},null,-1)),_m={class:"input-item"},wm=["placeholder"],km={key:0,class:"hint"};function Cm(e,n,o,i,a,r){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,h)=>(t.openBlock(),t.createElementBlock("div",{key:h,"data-testid":`field-object-key-${h}`},[t.createElementVNode("div",null,[t.createElementVNode("div",mm,[t.createElementVNode("div",hm,[t.createElementVNode("strong",null,t.toDisplayString(h),1),t.createElementVNode("div",null,[t.createVNode(l,{appearance:"tertiary",class:"delete",type:"button",onClick:y=>r.removeElement(h)},{icon:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["onClick"])])]),um,r.subSchema?(t.openBlock(),t.createElementBlock("div",pm,[t.createVNode(d,{model:r.transformedModel[h],options:{helpAsHtml:!0},schema:r.subSchema,onModelUpdated:r.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",fm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":y=>e.value[h]=y,class:"form-control",placeholder:e.schema.fields&&e.schema.fields[0].schema.placeholder,type:"text",onInput:y=>r.updateModel(e.value[h],e.model[e.schema.model])},null,40,gm),[[t.vModelText,e.value[h]]]),e.schema.fields&&e.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",ym,t.toDisplayString(e.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0)])),bm])])],8,cm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:r.hasObjectKeys}])},[t.createElementVNode("div",_m,[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,wm),[[t.vModelText,a.newKeyName]]),t.createVNode(l,{appearance:"tertiary","data-testid":"add-key",disabled:!a.newKeyName,onClick:r.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",km,t.toDisplayString(e.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,dm)}const lo=S(sm,[["render",Cm],["__scopeId","data-v-106caf87"]]),Em={class:"array-item"},so=S(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const i=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Em,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(i,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ue))]),_:1})])}}}),[["__scopeId","data-v-ec926551"]]),Sm=e=>(t.pushScopeId("data-v-27d212bd"),e=e(),t.popScopeId(),e),Tm={class:"multi-item-wrapper"},$m=Sm(()=>t.createElementVNode("hr",null,null,-1)),co=S(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const i=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Tm,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(i,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createTextVNode(" - Remove Field ")]),_:1}),$m])}}}),[["__scopeId","data-v-27d212bd"]]),Bm={name:"FieldMetric",components:{AddIcon:ro,TrashIcon:Ue},mixins:[I],emits:["remove-item"],data(){return{contentVisible:!1}}},Nm={key:0,class:"content"};function Mm(e,n,o,i,a,r){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",Nm,[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 mo=S(Bm,[["render",Mm]]),le="kong-ui-forms-api",Vm="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function Im(e){return e?e.length===36&&new RegExp(`^${Vm}$`).test(e):!1}const kt=50,fe={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 Am(e,n,o){return o?fe.SET_REFERRAL_VALUE:e&&!n||!e&&n?fe.UPDATE_ENTITY:e&&n?fe.CREATE_FROM_ENTITY:fe.CREATE_NOT_FROM_ENTITY}const Om={mixins:[I],inject:[le],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return Am(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 fe.UPDATE_ENTITY:if(!this[le]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[le].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 fe.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case fe.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=Ae(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],i=this.getInputFields(),a=new Set;Im(e)&&i.includes("id")?o.push((async()=>{const r=await this.fetchExact(e);n.push({...r,label:this.getSuggestionLabel(r),value:r.id})})()):o.push(...i.filter(r=>r!=="id").map(async r=>{(await this.fetchSuggestions(e,r)).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[le])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<kt;){const i=await this[le].getAll(this.entity,{size:kt,offset:o,...e});if(n.push(...i.data.data),o=i.data.offset,!o)break}return n.slice(0,kt)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[le]?(await this[le].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}}},Fm={class:"field-wrap autosuggest"},Um=["data-testid","data-testlabel"],Dm=["data-testid"],Lm={class:"autosuggest__results_message"};function vm(e,n,o,i,a,r){const s=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock("div",Fm,[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:r.onSelected,onQueryChange:r.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(r.getSuggestionLabel(l).split(" - ")[0]),9,Um),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.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,Dm))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Lm,[t.createElementVNode("span",null,t.toDisplayString(a.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const ho=S(Om,[["render",vm],["__scopeId","data-v-647bb712"]]),Pm={class:"array-card-container"},uo=S(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null}},emits:["remove-item"],setup(e){return(n,o)=>{const i=t.resolveComponent("KCard"),a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Pm,[t.createVNode(i,{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]=r=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ue))]),_:1})])}}}),[["__scopeId","data-v-5fa27cb4"]]),qm={mixins:[I],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)}}},Rm={class:"selection-group"},xm={class:"form-group"},zm=["id","checked","name","value"];function jm(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("div",Rm,[(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",xm,[t.createElementVNode("label",{class:t.normalizeClass(["k-label",s.name])},[t.createElementVNode("input",{id:e.schema.name+"-"+l,checked:r.checkOption(s),class:"k-input",name:e.schema.name,type:"radio",value:s.value,onChange:n[0]||(n[0]=(...d)=>r.onChange&&r.onChange(...d))},null,40,zm),t.createTextVNode(" "+t.toDisplayString(s.name),1)],2)])]))),128))])}const po=S(qm,[["render",jm],["__scopeId","data-v-7e49acd6"]]),Km={name:"FieldArray",components:{FieldArrayItem:so,FieldArrayMultiItem:co,FieldSelect:eo,FieldMetric:mo,FieldObject:io,FieldObjectAdvanced:lo,FieldAutoSuggest:ho,FieldRadio:po,FieldArrayCardContainer:uo,FieldTextArea:to,FieldInput:Kn},mixins:[I],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(e,n,o){var a,r,s;let i;return n&&(i=JSON.parse(JSON.stringify(n)),(s=(r=(a=i.schema)==null?void 0:a.fields)==null?void 0:r.map)==null||s.call(r,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...i,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(){}}},Hm=["id"],Ym={key:1},Gm=["onUpdate:modelValue","aria-labelledby","type"],Wm=["value","onClick"],Zm=["onUpdate:modelValue","aria-labelledby"],Jm=["value","onClick"];function Xm(e,n,o,i,a,r){const s=t.resolveComponent("FieldTextArea"),l=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,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,model:d,schema:r.generateSchema(e.value,e.schema.items,c),onRemoveItem:h=>r.removeElement(c)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:d,schema:r.generateSchema(e.value,e.schema.items,c),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Ym,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldType(e.schema.items)),{"form-options":e.formOptions,model:d,schema:r.generateSchema(e.value,e.schema.items,c),onModelUpdated:r.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-${c}`,model:d,schema:r.generateSchema(e.value,e.schema.items,c),onRemoveItem:h=>r.removeElement(c)},{default:t.withCtx(()=>{var h,y;return[((h=e.schema.inputAttributes)==null?void 0:h.type)==="textarea"?(t.openBlock(),t.createBlock(s,{key:0,"aria-labelledby":e.getLabelId(e.schema),class:"k-input","form-options":e.formOptions,model:d,schema:r.generateSchema(e.value,e.schema.items,c),onModelUpdated:r.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:1,"onUpdate:modelValue":b=>e.value[c]=b,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((y=e.schema.inputAttributes)==null?void 0:y.type)||"text"}),null,16,Gm)),[[t.vModelDynamic,e.value[c]]]),e.schema.showRemoveButton?(t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,ref_for:!0},e.schema.removeElementButtonAttributes,{type:"button",value:e.schema.removeElementButtonLabel||o.removeElementButtonLabel,onClick:b=>r.removeElement(c)}),null,16,Wm)):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":h=>e.value[c]=h,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Zm)),[[t.vModelText,e.value[c]]]),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:h=>r.removeElement(c)}),null,16,Jm)):t.createCommentVNode("",!0)],2))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:r.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Hm)):t.createCommentVNode("",!0)}const Qm=S(Km,[["render",Xm],["__scopeId","data-v-19b9d61e"]]),eh={mixins:[I],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)}}},th={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},nh={class:"material-icons"};function oh(e,n,o,i,a,r){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",th,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:n[0]||(n[0]=(...l)=>r.handleOpen&&r.handleOpen(...l))},[t.createElementVNode("i",nh,t.toDisplayString(a.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(r.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",r.openClass])},[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:e.schema,onModelUpdated:r.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const ih=S(eh,[["render",oh],["__scopeId","data-v-2d8e71e1"]]),rh={mixins:[I],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,i=this.schema.fields[n].fields;i&&i.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)}}},ah={class:"selection-group"},lh={class:"form-group horizontal-radios"},sh={class:"radio-group"},dh=["value"],ch={class:"control-help"},mh={class:"option-field"},hh={class:"option-field-container"},uh={class:"form-group"},ph=["value"],fh={class:"control-help"},gh={class:"option-field"},yh={class:"option-field-container"};function bh(e,n,o,i,a,r){const s=t.resolveComponent("vue-form-generator");return t.openBlock(),t.createElementBlock("div",ah,[e.schema.horizontalRadios?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",lh,[t.createElementVNode("div",sh,[(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,dh),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",ch,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",mh,[t.createElementVNode("div",hh,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:r.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",uh,[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,ph),[[t.vModelRadio,a.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(l.label)+" ",1),t.createElementVNode("div",fh,t.toDisplayString(l.description),1)],2)]),t.withDirectives(t.createElementVNode("div",gh,[t.createElementVNode("div",yh,[t.createVNode(s,{model:e.model,options:{helpAsHtml:!0},schema:{fields:l.fields},onModelUpdated:r.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,l.fields&&a.checkedGroup===d]])]))),128))])}const _h=S(rh,[["render",bh],["__scopeId","data-v-22882f4c"]]),wh={mixins:[I],emits:["model-updated"],methods:{onUpdate(e){this.$emit("model-updated",e,this.schema.model)}}};function kh(e,n,o,i,a,r){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":r.onUpdate},null,8,["aria-labelledby","items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Ch=S(wh,[["render",kh]]),Eh={name:"FieldKeyValuePairs",components:{TrashIcon:Ue},mixins:[I],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(i=>{this.pairs.push({key:i,value:e[i]})})},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)}}},Sh={class:"key-value-pairs-editor"},Th=["data-testid","placeholder","value","onInput"],$h=["data-testid","placeholder","value","onInput"];function Bh(e,n,o,i,a,r){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Sh,[(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:h=>{r.onInput(h,c,"key")}},null,40,Th),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:h=>{r.onInput(h,c,"value")}},null,40,$h),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{r.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:r.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Nh={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:ih,FieldArray:Qm,FieldArrayCardContainer:uo,FieldArrayItem:so,FieldArrayMultiItem:co,FieldAutoSuggest:ho,FieldCheckbox:ms,FieldChecklist:Cs,FieldCleave:Rd,FieldDateTimePicker:Yd,FieldGoogleAddress:Zd,FieldImage:tc,FieldInput:Kn,FieldKeyValuePairs:S(Eh,[["render",Bh],["__scopeId","data-v-29d15375"]]),FieldLabel:Ts,FieldMasked:ic,FieldMetric:mo,FieldMultiselect:Ch,FieldNoUiSlider:sc,FieldObject:io,FieldObjectAdvanced:lo,FieldPikaday:uc,FieldRadio:po,FieldRadios:Ms,FieldRangeSlider:gc,FieldSelect:eo,FieldSelectEx:kc,FieldSelectionGroup:_h,FieldSpectrum:Sc,FieldStaticMap:Bc,FieldSubmit:Ad,FieldTextArea:to,FieldUpload:vd,fieldSwitch:Ac},Symbol.toStringTag,{value:"Module"})),mixins:[Ht],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(P(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 ht(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 V(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\./,""):""}}},Mh=e=>(t.pushScopeId("data-v-02e656fb"),e=e(),t.popScopeId(),e),Vh=["innerHTML"],Ih={class:"icon-wrapper"},Ah=["innerHTML"],Oh={key:0,class:"link-wrapper"},Fh=Mh(()=>t.createElementVNode("span",{class:"section-header"},"More info",-1)),Uh={class:"field-wrap"},Dh={key:0,class:"buttons"},Lh=["type","onClick","textContent"],vh=["innerHTML"],Ph={key:2,class:"errors help-block"},qh=["innerHTML"];function Rh(e,n,o,i,a,r){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[r.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?r.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:r.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:r.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",Ih,[t.createElementVNode("span",{innerHTML:r.formattedLabel(o.field.label)},null,8,Ah)]),o.field.link?(t.openBlock(),t.createElementBlock("div",Oh,[t.createVNode(s,{href:o.field.link},{default:t.withCtx(()=>[Fh]),_: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,Vh)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",Uh,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldType(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&r.getFieldType(o.field)==="field-input"?r.fieldHint(o.field):void 0,model:o.model,schema:o.field,vfg:o.vfg,onModelUpdated:r.onModelUpdated,onValidated:r.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onValidated"])),r.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",Dh,[(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:r.getButtonType(d),onClick:h=>r.buttonClickHandler(d,o.field,h),textContent:t.toDisplayString(d.label)},null,10,Lh))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&r.getFieldType(o.field)!=="field-input"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hint",innerHTML:r.fieldHint(o.field)},null,8,vh)):t.createCommentVNode("",!0),r.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",Ph,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fieldErrors(o.field),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,innerHTML:d},null,8,qh))),128))])):t.createCommentVNode("",!0)],2)}const xh={name:"FormGenerator",components:{formGroup:S(Nh,[["render",Rh],["__scopeId","data-v-02e656fb"]])},mixins:[Ht],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&&z(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&z(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 V(e.visible)?e.visible.call(this,this.model,e,this):P(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&&z(n,a=>{this.errors.push({field:o.schema,error:a})});const i=this.errors.length===0;this.$emit("validated",i,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=[];z(this.$refs.children,a=>{V(a.validate)&&(n.push(a.$refs.child),o.push(a.$refs.child.validate(!0)))});const i=a=>{const r=[];z(a,(l,d)=>{Array.isArray(l)&&l.length>0&&z(l,c=>{r.push({field:n[d].schema,error:c})})}),this.errors=r;const s=r.length===0;return this.$emit("validated",s,r,this),e?r:s};return e?Promise.all(o).then(i):i(o)},clearValidationErrors(){this.errors.splice(0),z(this.$refs.children,e=>{e.clearValidationErrors()})}}},zh={key:0,class:"vue-form-generator"},jh={key:0};function Kh(e,n,o,i,a,r){const s=t.resolveComponent("form-group"),l=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",zh,[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(r.fields,d=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:d.model},[r.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:r.onModelUpdated,onValidated:r.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(r.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 h,y,b,B;return[(h=d.slots)!=null&&h.beforeContent?t.renderSlot(e.$slots,(y=d.slots)==null?void 0:y.beforeContent,{key:0}):t.createCommentVNode("",!0),d.fields.length===0&&((b=d.slots)!=null&&b.emptyState)?t.renderSlot(e.$slots,(B=d.slots)==null?void 0:B.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,T=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:T.model},[r.fieldVisible(T)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:T,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:r.onModelUpdated,onValidated:r.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":T=>a.collapseStates[`group-${c}-nested`]=T},{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,T=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:T.model},[r.fieldVisible(T)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:T,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:r.onModelUpdated,onValidated:r.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",jh,t.toDisplayString(d.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[r.fieldVisible(h)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:h,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:r.onModelUpdated,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const j=S(xh,[["render",Kh]]),Hh={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"}]},Yh={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"}]},Gh={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"}]},Wh={name:"OIDCForm",components:{VueFormGenerator:j},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={...Hh},this.authFieldsSchema={...Yh},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(o=>o.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(i=>i.model===o.model).length&&!this.authFieldsSchema.fields.filter(i=>i.model===o.model).length||o.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(o=>{const i=Gh.fields.find(a=>a.model===o.model);return i||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 i of o.fields){const a=(n=e[i.model])==null?void 0:n.help;i.help===void 0&&typeof a=="string"&&(i.help=a)}},getAuthMethodsValue(e,n){const o=[];for(let i=0;i<this.authMethods.length;i++)this.authMethods[i].prop&&this.authMethods[i].value!==e&&o.push(this.authMethods[i].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()}}},Se=e=>(t.pushScopeId("data-v-e7395ff0"),e=e(),t.popScopeId(),e),Zh={class:"general-settings"},Jh={class:"link-wrapper"},Xh=Se(()=>t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Qh=Se(()=>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)),eu={class:"auth-method-container"},tu={class:"general-settings"},nu={class:"link-wrapper"},ou=Se(()=>t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),iu=Se(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),ru={class:"general-settings"},au={class:"link-wrapper"},lu=Se(()=>t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),su=Se(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function du(e,n,o,i,a,r){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KLabel"),c=t.resolveComponent("KCheckbox"),h=t.resolveComponent("KInputSwitch"),y=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(y,{tabs:a.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Zh,[t.createElementVNode("div",Jh,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:t.withCtx(()=>[Xh]),_:1})]),Qh,r.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",eu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.authMethods,b=>(t.openBlock(),t.createElementBlock("div",{key:b.value,class:"auth-method"},[t.createVNode(c,{modelValue:b.prop,"onUpdate:modelValue":B=>b.prop=B,onChange:B=>r.handleUpdate(B,b.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(b.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(h,{modelValue:a.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=b=>a.sessionManagement=b),label:"Enable Session Management",onChange:r.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",tu,[t.createElementVNode("div",nu,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:t.withCtx(()=>[ou]),_:1})]),iu,r.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",ru,[t.createElementVNode("div",au,[t.createVNode(l,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:t.withCtx(()=>[lu]),_:1})]),su,r.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 cu=S(Wh,[["render",du],["__scopeId","data-v-e7395ff0"]]),Ct={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's counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Advanced control on request rate with customizable limits and window sizes.",label:"Limit",label_index:"Limit {index}",help:"Set one or more requests-per-window limits and window sizes to apply a limit to (defined in seconds). There must be a matching number of window limits and sizes specified.",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},try_a_use_case:"Start with a prebuilt 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_address_example:"e.g. localhost:6379"}},mu=S(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}=Ze.createI18n("en-us",Ct),i=e,a=t.computed(()=>i.formModel.id&&i.isEditing||!i.isEditing),r=t.computed(()=>{const s=i.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(j,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),hu=S(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}=Ze.createI18n("en-us",Ct),i=e,a=t.computed(()=>i.formModel.id&&i.isEditing||!i.isEditing),r=t.computed(()=>{const s=i.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(j,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),uu={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}]},pu={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}]},fu={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}]},ge=e=>(t.pushScopeId("data-v-b9df1c3f"),e=e(),t.popScopeId(),e),gu={class:"general-settings"},yu=ge(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),bu=ge(()=>t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),_u=ge(()=>t.createElementVNode("hr",null,null,-1)),wu={class:"sub-form"},ku={class:"general-settings"},Cu=ge(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Eu=ge(()=>t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Su={class:"sub-form"},Tu={class:"general-settings"},$u=ge(()=>t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),Bu=ge(()=>t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),Nu=S(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"),i=t.ref("shm"),a=t.computed(()=>{var p;const g={};if((p=n.formSchema)!=null&&p.fields)for(const m of n.formSchema.fields)g[m.model]=m;return g}),r=t.computed(()=>{var p;const g=ne(uu);for(const m of g.fields){const u=(p=a.value[m.model])==null?void 0:p.help;m.help===void 0&&typeof u=="string"&&(m.help=u)}return g}),s=t.computed(()=>{var p;const g=ne(pu);for(const m of g.fields){const u=(p=a.value[m.model])==null?void 0:p.help;m.help===void 0&&typeof u=="string"&&(m.help=u)}return g}),l=t.computed(()=>{var p;const g=ne(fu);for(const m of g.fields){const u=(p=a.value[m.model])==null?void 0:p.help;m.help===void 0&&typeof u=="string"&&(m.help=u)}return g}),d=t.computed(()=>({fields:n.formSchema.fields.filter(g=>!g.model.startsWith("config")&&g.model!=="tags")})),c=t.computed(()=>({fields:r.value.fields.filter(p=>!s.value.fields.some(m=>m.model===p.model)&&!l.value.fields.some(m=>m.model===p.model))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage")&&!p.model.startsWith("config-storage_config-consul")&&!p.model.startsWith("config-storage_config-redis")&&!p.model.startsWith("config-storage_config-shm")&&!p.model.startsWith("config-storage_config-vault"))})),y=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-consul"))})),b=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-redis"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-shm"))})),T=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-vault"))})),_=t.computed(()=>({fields:n.formSchema.fields.filter(g=>g.model.startsWith("config")&&!c.value.fields.filter(p=>p.model===g.model).length&&!h.value.fields.filter(p=>p.model===g.model).length||g.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),f=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],k=[{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=g=>{o.value=g.value,(g.value==="zeroSsl"||g.value==="other")&&(g.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),g.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=(g,p)=>{p==="config-storage"&&(i.value=g),n.onModelUpdated()};return(g,p)=>{const m=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(j,{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",gu,[yu,bu,C.value?(t.openBlock(),t.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),_u,t.createVNode(m,{class:"issuer-select",items:k,label:"Issuer",onChange:O}),t.createElementVNode("div",wu,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(j,{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(j,{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",ku,[Cu,Eu,C.value?(t.openBlock(),t.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:F},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",Su,[i.value==="consul"?(t.openBlock(),t.createBlock(j,{key:0,model:e.formModel,options:e.formOptions,schema:y.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),i.value==="redis"?(t.openBlock(),t.createBlock(j,{key:1,model:e.formModel,options:e.formOptions,schema:b.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),i.value==="shm"?(t.openBlock(),t.createBlock(j,{key:2,model:e.formModel,options:e.formOptions,schema:B.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),i.value==="vault"?(t.openBlock(),t.createBlock(j,{key:3,model:e.formModel,options:e.formOptions,schema:T.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",Tu,[$u,Bu,C.value?(t.openBlock(),t.createBlock(j,{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-b9df1c3f"]]),fo=e=>(t.pushScopeId("data-v-04007e41"),e=e(),t.popScopeId(),e),Mu={class:"rla-form-basic-fields"},Vu={class:"rla-form-request-limits-subtitle"},Iu={class:"rla-form-request-limits-content"},Au={class:"rla-form-window-type"},Ou=["innerHTML"],Fu={class:"rla-form-window-type-radios"},Uu={class:"rla-form-request-limits-items"},Du={class:"rla-form-request-limits-row"},Lu=["id"],vu={class:"rla-form-request-limits-actions"},Pu={key:0,class:"rla-form-request-limits-examples"},qu={class:"rla-form-request-limits-examples-badges"},Ru=fo(()=>t.createElementVNode("br",null,null,-1)),xu=["innerHTML"],zu={id:"rla-form-error-legend",class:"rla-form-error-inputs"},ju=fo(()=>t.createElementVNode("div",null,":",-1)),Ku=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:Nu,ExitTransformer:hu,OIDCForm:cu,PostFunction:mu,RLAForm:S(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},isEditing:{type:Boolean}},setup(e){const n=[{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,window_type:"fixed"}},{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,window_type:"fixed"}},{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,window_type:"fixed"}},{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,window_type:"sliding"}},{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,window_type:"sliding"}},{description:`Each user is allowed 500 requests per hour.
|
|
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,window_type:"sliding",disable_penalty:!1}}],{t:o}=Ze.createI18n("en-us",Ct),i=e,a=t.computed(()=>{var u,w;const m=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.find(E=>E.model==="selectionGroup");if(m)return{fields:[{...m,horizontalRadios:!0}]}}),r=t.computed(()=>{var u,w,E;const m=new Set(["selectionGroup",...["identifier","limit","window_size","error_code","error_message"].map(M=>`config-${M}`)]);return{fields:(E=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.filter(M=>typeof M.model=="string"&&!m.has(M.model)))==null?void 0:E.map(M=>((M.model==="config-redis-cluster_addresses"||M.model==="config-redis-sentinel_addresses")&&(M.hint=o("rla.redis_address_example")),M))}}),s=t.computed(()=>n.filter(m=>i.formModel["config-window_type"]===m.config.window_type)),l=t.computed(()=>{var m,u;return(u=(m=i.formSchema)==null?void 0:m.fields)==null?void 0:u.find(w=>w.model==="config-identifier")}),d=t.computed(()=>{var m,u,w;return(((w=(u=(m=i.formSchema)==null?void 0:m.fields)==null?void 0:u.find(E=>E.model==="config-identifier"))==null?void 0:w.values)??[]).map(E=>({label:o(`rla.identifiers.options.${E}`),value:E}))}),c=t.ref(),h=t.ref(!0),y=t.computed(()=>{var m,u,w;return i.formModel["config-window_type"]??((w=(u=(m=i.formSchema)==null?void 0:m.fields)==null?void 0:u.find(E=>E.model==="config-window_type"))==null?void 0:w.default)}),b=t.computed(()=>{var u,w,E,M,Q,De;const m=(E=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.find(ye=>ye.model==="config-window_type"))==null?void 0:E.default;return(((De=(Q=(M=i.formSchema)==null?void 0:M.fields)==null?void 0:Q.find(ye=>ye.model==="config-window_type"))==null?void 0:De.values)??[]).sort((ye,Et)=>ye===m?-1:Et===m?1:0)}),B=t.computed(()=>{var u;const m=(u=i.formModel["config-limit"])==null?void 0:u.map((w,E)=>{var M,Q;return{limit:w,windowSize:(Q=(M=i.formModel)==null?void 0:M["config-window_size"])==null?void 0:Q[E]}});return!Array.isArray(m)||m.length===0?[{limit:void 0,windowSize:void 0}]:m}),T=t.computed(()=>{var m,u,w,E;return((m=i.formModel)==null?void 0:m["config-identifier"])??((E=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.find(M=>M.model==="config-identifier"))==null?void 0:E.default)}),_=t.computed(()=>{var m,u,w,E;return((m=i.formModel)==null?void 0:m["config-error_code"])??((E=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.find(M=>M.model==="config-error_code"))==null?void 0:E.default)}),C=t.computed(()=>{var m,u,w,E;return((m=i.formModel)==null?void 0:m["config-error_message"])??((E=(w=(u=i.formSchema)==null?void 0:u.fields)==null?void 0:w.find(M=>M.model==="config-error_message"))==null?void 0:E.default)}),f=(m,u)=>{if(u===c.value){i.onModelUpdated([],"config-limit"),i.onModelUpdated([],"config-window_size"),t.nextTick(()=>{c.value=void 0});return}i.onModelUpdated([m.config.limit],"config-limit"),i.onModelUpdated([m.config.window_size],"config-window_size"),t.nextTick(()=>{c.value=u})},k=m=>{c.value!==void 0&&(c.value=void 0),i.onModelUpdated(m,"config-window_type")},O=(m,u)=>{var E;c.value!==void 0&&(c.value=void 0);const w=ne(((E=i.formModel)==null?void 0:E["config-limit"])??[]);w[m]=u,i.onModelUpdated(w,"config-limit")},F=(m,u)=>{var E;c.value!==void 0&&(c.value=void 0);const w=ne(((E=i.formModel)==null?void 0:E["config-window_size"])??[]);w[m]=u,i.onModelUpdated(w,"config-window_size")},g=m=>{var E,M;c.value!==void 0&&(c.value=void 0);const u=ne(((E=i.formModel)==null?void 0:E["config-limit"])??[]),w=ne(((M=i.formModel)==null?void 0:M["config-window_size"])??[]);u.length===0&&u.push(void 0),w.length===0&&w.push(void 0),u.splice(m+1,0,void 0),w.splice(m+1,0,void 0),i.onModelUpdated(u,"config-limit"),i.onModelUpdated(w,"config-window_size")},p=m=>{var u,w;if(B.value.length>1){c.value!==void 0&&(c.value=void 0);const E=ne(((u=i.formModel)==null?void 0:u["config-limit"])??[]),M=ne(((w=i.formModel)==null?void 0:w["config-window_size"])??[]);E.length===0&&E.push(void 0),M.length===0&&M.push(void 0),E.splice(m,1),M.splice(m,1),i.onModelUpdated(E,"config-limit"),i.onModelUpdated(M,"config-window_size")}};return(m,u)=>{const w=t.resolveComponent("VueFormGenerator"),E=t.resolveComponent("KLabel"),M=t.resolveComponent("KRadio"),Q=t.resolveComponent("KInput"),De=t.resolveComponent("KButton"),ye=t.resolveComponent("KBadge"),Et=t.resolveComponent("KTooltip"),Wu=t.resolveComponent("KCard"),Zu=t.resolveComponent("KSelect"),Ju=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Mu,[t.createVNode(w,{model:m.formModel,options:m.formOptions,schema:a.value,onModelUpdated:u[0]||(u[0]=(A,R)=>m.onModelUpdated(A,R))},null,8,["model","options","schema"]),t.createVNode(Wu,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(E,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",info:t.unref(o)("rla.request_limits.help"),"tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("rla.request_limits.title")),1)]),_:1},8,["info"]),t.createElementVNode("div",Vu,t.toDisplayString(t.unref(o)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Iu,[t.createElementVNode("div",Au,[t.createVNode(E,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(o)("rla.window_type.help")},null,8,Ou)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",Fu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,A=>(t.openBlock(),t.createBlock(M,{key:`window-type-${A}`,"model-value":y.value,name:A,"selected-value":A,"onUpdate:modelValue":k},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)(`rla.window_type.options.${A}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",Uu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,(A,R)=>(t.openBlock(),t.createElementBlock("div",{key:R.toString()},[t.createVNode(E,{for:`rla-form-request-limits-item-${R}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("rla.request_limits.label_index",{index:R+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Du,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${R}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(Q,{"model-value":A.limit&&A.limit.toString(),placeholder:t.unref(o)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":St=>O(R,Number.parseInt(St))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("rla.request_limits.interval_determiner")),1),t.createVNode(Q,{"model-value":A.windowSize&&A.windowSize.toString(),placeholder:t.unref(o)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":St=>F(R,Number.parseInt(St))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("rla.request_limits.seconds")),1)],8,Lu),t.createElementVNode("div",vu,[t.createVNode(De,{appearance:"tertiary",disabled:B.value.length<=1,onClick:()=>p(R)},{default:t.withCtx(()=>[t.createVNode(t.unref(nm))]),_:2},1032,["disabled","onClick"]),t.createVNode(De,{appearance:"tertiary",onClick:()=>g(R)},{default:t.withCtx(()=>[t.createVNode(t.unref(ro))]),_:2},1032,["onClick"])])])]))),128))]),s.value.length>0?(t.openBlock(),t.createElementBlock("div",Pu,[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("rla.try_a_use_case"))+":",1),t.createElementVNode("div",qu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(A,R)=>(t.openBlock(),t.createBlock(Et,{key:`use-case-${R}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(A.description),1),Ru,t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("rla.request_limits.label"))+": "+t.toDisplayString(A.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("rla.request_limits.time_interval"))+": "+t.toDisplayString(A.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(ye,{appearance:c.value===`${y.value}-${R}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>f(A,`${y.value}-${R}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("rla.use_case_index",{index:R+1})),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Zu,{modelValue:T.value,"onUpdate:modelValue":u[1]||(u[1]=A=>T.value=A),class:"rla-form-identifiers",items:d.value,label:t.unref(o)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},onSelected:u[2]||(u[2]=A=>i.onModelUpdated(A.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:l.value&&l.value.help},null,8,xu)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(E,{for:"rla-form-error-legend",info:t.unref(o)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",zu,[t.createVNode(Q,{class:"input-error-code","model-value":_.value&&_.value.toString(),placeholder:t.unref(o)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":u[3]||(u[3]=A=>m.onModelUpdated(Number.parseInt(A),"config-error_code"))},null,8,["model-value","placeholder"]),ju,t.createVNode(Q,{"model-value":C.value,placeholder:t.unref(o)("rla.error_message.message_placeholder"),"onUpdate:modelValue":u[4]||(u[4]=A=>m.onModelUpdated(A,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(Ju,{modelValue:h.value,"onUpdate:modelValue":u[6]||(u[6]=A=>h.value=A),"trigger-label":t.unref(o)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(w,{model:m.formModel,options:m.formOptions,schema:r.value,onModelUpdated:u[5]||(u[5]=(A,R)=>m.onModelUpdated(A,R))},null,8,["model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-04007e41"]])},Symbol.toStringTag,{value:"Module"})),Hu=["array","metric","advanced","selectionGroup","object-advanced"],Yu={install:e=>{e.component("VueFormGenerator",j)}},Gu=(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];U.FORMS_API_KEY=le,U.VueFormGenerator=j,U.abstractField=ls,U.customFields=Hu,U.default=Yu,U.getSharedFormName=Gu,U.sharedForms=Ku,Object.defineProperties(U,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|