@kong-ui-public/forms 2.1.4 → 2.1.5
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 +3 -3
- package/dist/forms.umd.js +1 -1
- package/package.json +2 -2
package/dist/forms.es.js
CHANGED
|
@@ -5789,7 +5789,7 @@ const Rl = /* @__PURE__ */ W(my, [["render", Ey], ["__scopeId", "data-v-22600a29
|
|
|
5789
5789
|
for (const [h, f] of a)
|
|
5790
5790
|
s[h] = f;
|
|
5791
5791
|
return s;
|
|
5792
|
-
}, Fy = (n) => (an("data-v-
|
|
5792
|
+
}, Fy = (n) => (an("data-v-2cc22034"), n = n(), on(), n), $y = ["aria-hidden"], Oy = {
|
|
5793
5793
|
key: 0,
|
|
5794
5794
|
"data-testid": "kui-icon-svg-title"
|
|
5795
5795
|
}, ky = /* @__PURE__ */ Fy(() => /* @__PURE__ */ M("path", {
|
|
@@ -5888,7 +5888,7 @@ const Rl = /* @__PURE__ */ W(my, [["render", Ey], ["__scopeId", "data-v-22600a29
|
|
|
5888
5888
|
_: 1
|
|
5889
5889
|
}, 8, ["aria-hidden", "style"]));
|
|
5890
5890
|
}
|
|
5891
|
-
}), Uy = /* @__PURE__ */ Dl(Ly, [["__scopeId", "data-v-
|
|
5891
|
+
}), Uy = /* @__PURE__ */ Dl(Ly, [["__scopeId", "data-v-2cc22034"]]), Ry = (n) => (an("data-v-103127a9"), n = n(), on(), n), Dy = ["aria-hidden"], Ny = {
|
|
5892
5892
|
key: 0,
|
|
5893
5893
|
"data-testid": "kui-icon-svg-title"
|
|
5894
5894
|
}, xy = /* @__PURE__ */ Ry(() => /* @__PURE__ */ M("path", {
|
|
@@ -5987,7 +5987,7 @@ const Rl = /* @__PURE__ */ W(my, [["render", Ey], ["__scopeId", "data-v-22600a29
|
|
|
5987
5987
|
_: 1
|
|
5988
5988
|
}, 8, ["aria-hidden", "style"]));
|
|
5989
5989
|
}
|
|
5990
|
-
}), Qi = /* @__PURE__ */ Dl(By, [["__scopeId", "data-v-
|
|
5990
|
+
}), Qi = /* @__PURE__ */ Dl(By, [["__scopeId", "data-v-103127a9"]]);
|
|
5991
5991
|
const Py = {
|
|
5992
5992
|
name: "FieldArrayItem",
|
|
5993
5993
|
components: { TrashIcon: Qi },
|
package/dist/forms.umd.js
CHANGED
|
@@ -24,4 +24,4 @@ __p += '`),W&&(S+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+S+`return __p
|
|
27
|
-
}`;var U=pa(function(){return G(c,A+"return "+S).apply(s,f)});if(U.source=S,Hr(U))throw U;return U}function l1(e){return Z(e).toLowerCase()}function a1(e){return Z(e).toUpperCase()}function d1(e,t,i){if(e=Z(e),e&&(i||t===s))return vs(e);if(!e||!(t=$e(t)))return e;var o=Je(e),a=Je(t),c=Ss(o,a),f=Ts(o,a)+1;return Mt(o,c,f).join("")}function c1(e,t,i){if(e=Z(e),e&&(i||t===s))return e.slice(0,Is(e)+1);if(!e||!(t=$e(t)))return e;var o=Je(e),a=Ts(o,Je(t))+1;return Mt(o,0,a).join("")}function u1(e,t,i){if(e=Z(e),e&&(i||t===s))return e.replace(Hi,"");if(!e||!(t=$e(t)))return e;var o=Je(e),a=Ss(o,Je(t));return Mt(o,a).join("")}function f1(e,t){var i=oh,o=sh;if(re(t)){var a="separator"in t?t.separator:a;i="length"in t?x(t.length):i,o="omission"in t?$e(t.omission):o}e=Z(e);var c=e.length;if(Zt(e)){var f=Je(e);c=f.length}if(i>=c)return e;var p=i-Jt(o);if(p<1)return o;var y=f?Mt(f,0,p).join(""):e.slice(0,p);if(a===s)return y+o;if(f&&(p+=y.length-p),Wr(a)){if(e.slice(p).search(a)){var E,v=y;for(a.global||(a=lr(a.source,Z(Ko.exec(a))+"g")),a.lastIndex=0;E=a.exec(v);)var S=E.index;y=y.slice(0,S===s?p:S)}}else if(e.indexOf($e(a),p)!=p){var B=y.lastIndexOf(a);B>-1&&(y=y.slice(0,B))}return y+o}function h1(e){return e=Z(e),e&&vh.test(e)?e.replace(zo,qm):e}var m1=rn(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),Gr=gl("toUpperCase");function ma(e,t,i){return e=Z(e),t=i?s:t,t===s?Lm(e)?Wm(e):Im(e):e.match(t)||[]}var pa=R(function(e,t){try{return Ne(e,s,t)}catch(i){return Hr(i)?i:new D(i)}}),p1=ft(function(e,t){return Re(t,function(i){i=ot(i),ct(e,i,qr(e[i],e))}),e});function g1(e){var t=e==null?0:e.length,i=N();return e=t?ne(e,function(o){if(typeof o[1]!="function")throw new Pe(b);return[i(o[0]),o[1]]}):[],R(function(o){for(var a=-1;++a<t;){var c=e[a];if(Ne(c[0],this,o))return Ne(c[1],this,o)}})}function _1(e){return qp(ze(e,j))}function Zr(e){return function(){return e}}function y1(e,t){return e==null||e!==e?t:e}var b1=yl(),w1=yl(!0);function Ae(e){return e}function Jr(e){return Gs(typeof e=="function"?e:ze(e,j))}function C1(e){return Js(ze(e,j))}function k1(e,t){return Xs(e,ze(t,j))}var E1=R(function(e,t){return function(i){return Tn(i,e,t)}}),v1=R(function(e,t){return function(i){return Tn(e,i,t)}});function Xr(e,t,i){var o=ue(t),a=ui(t,o);i==null&&!(re(t)&&(a.length||!o.length))&&(i=t,t=e,e=this,a=ui(t,ue(t)));var c=!(re(i)&&"chain"in i)||!!i.chain,f=mt(e);return Re(a,function(p){var y=t[p];e[p]=y,f&&(e.prototype[p]=function(){var E=this.__chain__;if(c||E){var v=e(this.__wrapped__),S=v.__actions__=Be(this.__actions__);return S.push({func:y,args:arguments,thisArg:e}),v.__chain__=E,v}return y.apply(e,Et([this.value()],arguments))})}),e}function S1(){return me._===this&&(me._=Xm),this}function Qr(){}function T1(e){return e=x(e),R(function(t){return Qs(t,e)})}var B1=Mr(ne),I1=Mr(bs),M1=Mr(er);function ga(e){return Dr(e)?tr(ot(e)):og(e)}function A1(e){return function(t){return e==null?s:Rt(e,t)}}var N1=wl(),F1=wl(!0);function jr(){return[]}function eo(){return!1}function $1(){return{}}function V1(){return""}function O1(){return!0}function D1(e,t){if(e=x(e),e<1||e>Ct)return[];var i=nt,o=_e(e,nt);t=N(t),e-=nt;for(var a=rr(o,t);++i<e;)t(i);return a}function L1(e){return L(e)?ne(e,ot):Ve(e)?[e]:Be(Dl(Z(e)))}function x1(e){var t=++Zm;return Z(e)+t}var U1=_i(function(e,t){return e+t},0),R1=Ar("ceil"),P1=_i(function(e,t){return e/t},1),q1=Ar("floor");function z1(e){return e&&e.length?ci(e,Ae,pr):s}function H1(e,t){return e&&e.length?ci(e,N(t,2),pr):s}function W1(e){return ks(e,Ae)}function K1(e,t){return ks(e,N(t,2))}function Y1(e){return e&&e.length?ci(e,Ae,br):s}function G1(e,t){return e&&e.length?ci(e,N(t,2),br):s}var Z1=_i(function(e,t){return e*t},1),J1=Ar("round"),X1=_i(function(e,t){return e-t},0);function Q1(e){return e&&e.length?ir(e,Ae):0}function j1(e,t){return e&&e.length?ir(e,N(t,2)):0}return d.after=Cy,d.ary=Yl,d.assign=a0,d.assignIn=la,d.assignInWith=Ai,d.assignWith=d0,d.at=c0,d.before=Gl,d.bind=qr,d.bindAll=p1,d.bindKey=Zl,d.castArray=$y,d.chain=Hl,d.chunk=qg,d.compact=zg,d.concat=Hg,d.cond=g1,d.conforms=_1,d.constant=Zr,d.countBy=Q_,d.create=u0,d.curry=Jl,d.curryRight=Xl,d.debounce=Ql,d.defaults=f0,d.defaultsDeep=h0,d.defer=ky,d.delay=Ey,d.difference=Wg,d.differenceBy=Kg,d.differenceWith=Yg,d.drop=Gg,d.dropRight=Zg,d.dropRightWhile=Jg,d.dropWhile=Xg,d.fill=Qg,d.filter=ey,d.flatMap=iy,d.flatMapDeep=ry,d.flatMapDepth=oy,d.flatten=Rl,d.flattenDeep=jg,d.flattenDepth=e_,d.flip=vy,d.flow=b1,d.flowRight=w1,d.fromPairs=t_,d.functions=w0,d.functionsIn=C0,d.groupBy=sy,d.initial=i_,d.intersection=r_,d.intersectionBy=o_,d.intersectionWith=s_,d.invert=E0,d.invertBy=v0,d.invokeMap=ay,d.iteratee=Jr,d.keyBy=dy,d.keys=ue,d.keysIn=Me,d.map=vi,d.mapKeys=T0,d.mapValues=B0,d.matches=C1,d.matchesProperty=k1,d.memoize=Ti,d.merge=I0,d.mergeWith=aa,d.method=E1,d.methodOf=v1,d.mixin=Xr,d.negate=Bi,d.nthArg=T1,d.omit=M0,d.omitBy=A0,d.once=Sy,d.orderBy=cy,d.over=B1,d.overArgs=Ty,d.overEvery=I1,d.overSome=M1,d.partial=zr,d.partialRight=jl,d.partition=uy,d.pick=N0,d.pickBy=da,d.property=ga,d.propertyOf=A1,d.pull=c_,d.pullAll=ql,d.pullAllBy=u_,d.pullAllWith=f_,d.pullAt=h_,d.range=N1,d.rangeRight=F1,d.rearg=By,d.reject=my,d.remove=m_,d.rest=Iy,d.reverse=Rr,d.sampleSize=gy,d.set=$0,d.setWith=V0,d.shuffle=_y,d.slice=p_,d.sortBy=wy,d.sortedUniq=k_,d.sortedUniqBy=E_,d.split=i1,d.spread=My,d.tail=v_,d.take=S_,d.takeRight=T_,d.takeRightWhile=B_,d.takeWhile=I_,d.tap=z_,d.throttle=Ay,d.thru=Ei,d.toArray=ra,d.toPairs=ca,d.toPairsIn=ua,d.toPath=L1,d.toPlainObject=sa,d.transform=O0,d.unary=Ny,d.union=M_,d.unionBy=A_,d.unionWith=N_,d.uniq=F_,d.uniqBy=$_,d.uniqWith=V_,d.unset=D0,d.unzip=Pr,d.unzipWith=zl,d.update=L0,d.updateWith=x0,d.values=ln,d.valuesIn=U0,d.without=O_,d.words=ma,d.wrap=Fy,d.xor=D_,d.xorBy=L_,d.xorWith=x_,d.zip=U_,d.zipObject=R_,d.zipObjectDeep=P_,d.zipWith=q_,d.entries=ca,d.entriesIn=ua,d.extend=la,d.extendWith=Ai,Xr(d,d),d.add=U1,d.attempt=pa,d.camelCase=z0,d.capitalize=fa,d.ceil=R1,d.clamp=R0,d.clone=Vy,d.cloneDeep=Dy,d.cloneDeepWith=Ly,d.cloneWith=Oy,d.conformsTo=xy,d.deburr=ha,d.defaultTo=y1,d.divide=P1,d.endsWith=H0,d.eq=Qe,d.escape=W0,d.escapeRegExp=K0,d.every=j_,d.find=ty,d.findIndex=xl,d.findKey=m0,d.findLast=ny,d.findLastIndex=Ul,d.findLastKey=p0,d.floor=q1,d.forEach=Wl,d.forEachRight=Kl,d.forIn=g0,d.forInRight=_0,d.forOwn=y0,d.forOwnRight=b0,d.get=Kr,d.gt=Uy,d.gte=Ry,d.has=k0,d.hasIn=Yr,d.head=Pl,d.identity=Ae,d.includes=ly,d.indexOf=n_,d.inRange=P0,d.invoke=S0,d.isArguments=zt,d.isArray=L,d.isArrayBuffer=Py,d.isArrayLike=Ie,d.isArrayLikeObject=se,d.isBoolean=qy,d.isBuffer=At,d.isDate=zy,d.isElement=Hy,d.isEmpty=Wy,d.isEqual=Ky,d.isEqualWith=Yy,d.isError=Hr,d.isFinite=Gy,d.isFunction=mt,d.isInteger=ea,d.isLength=Ii,d.isMap=ta,d.isMatch=Zy,d.isMatchWith=Jy,d.isNaN=Xy,d.isNative=Qy,d.isNil=e0,d.isNull=jy,d.isNumber=na,d.isObject=re,d.isObjectLike=oe,d.isPlainObject=Fn,d.isRegExp=Wr,d.isSafeInteger=t0,d.isSet=ia,d.isString=Mi,d.isSymbol=Ve,d.isTypedArray=sn,d.isUndefined=n0,d.isWeakMap=i0,d.isWeakSet=r0,d.join=l_,d.kebabCase=Y0,d.last=We,d.lastIndexOf=a_,d.lowerCase=G0,d.lowerFirst=Z0,d.lt=o0,d.lte=s0,d.max=z1,d.maxBy=H1,d.mean=W1,d.meanBy=K1,d.min=Y1,d.minBy=G1,d.stubArray=jr,d.stubFalse=eo,d.stubObject=$1,d.stubString=V1,d.stubTrue=O1,d.multiply=Z1,d.nth=d_,d.noConflict=S1,d.noop=Qr,d.now=Si,d.pad=J0,d.padEnd=X0,d.padStart=Q0,d.parseInt=j0,d.random=q0,d.reduce=fy,d.reduceRight=hy,d.repeat=e1,d.replace=t1,d.result=F0,d.round=J1,d.runInContext=_,d.sample=py,d.size=yy,d.snakeCase=n1,d.some=by,d.sortedIndex=g_,d.sortedIndexBy=__,d.sortedIndexOf=y_,d.sortedLastIndex=b_,d.sortedLastIndexBy=w_,d.sortedLastIndexOf=C_,d.startCase=r1,d.startsWith=o1,d.subtract=X1,d.sum=Q1,d.sumBy=j1,d.template=s1,d.times=D1,d.toFinite=pt,d.toInteger=x,d.toLength=oa,d.toLower=l1,d.toNumber=Ke,d.toSafeInteger=l0,d.toString=Z,d.toUpper=a1,d.trim=d1,d.trimEnd=c1,d.trimStart=u1,d.truncate=f1,d.unescape=h1,d.uniqueId=x1,d.upperCase=m1,d.upperFirst=Gr,d.each=Wl,d.eachRight=Kl,d.first=Pl,Xr(d,function(){var e={};return it(d,function(t,i){X.call(d.prototype,i)||(e[i]=t)}),e}(),{chain:!1}),d.VERSION=m,Re(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),Re(["drop","take"],function(e,t){z.prototype[e]=function(i){i=i===s?1:de(x(i),0);var o=this.__filtered__&&!t?new z(this):this.clone();return o.__filtered__?o.__takeCount__=_e(i,o.__takeCount__):o.__views__.push({size:_e(i,nt),type:e+(o.__dir__<0?"Right":"")}),o},z.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),Re(["filter","map","takeWhile"],function(e,t){var i=t+1,o=i==Ro||i==ch;z.prototype[e]=function(a){var c=this.clone();return c.__iteratees__.push({iteratee:N(a,3),type:i}),c.__filtered__=c.__filtered__||o,c}}),Re(["head","last"],function(e,t){var i="take"+(t?"Right":"");z.prototype[e]=function(){return this[i](1).value()[0]}}),Re(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");z.prototype[e]=function(){return this.__filtered__?new z(this):this[i](1)}}),z.prototype.compact=function(){return this.filter(Ae)},z.prototype.find=function(e){return this.filter(e).head()},z.prototype.findLast=function(e){return this.reverse().find(e)},z.prototype.invokeMap=R(function(e,t){return typeof e=="function"?new z(this):this.map(function(i){return Tn(i,e,t)})}),z.prototype.reject=function(e){return this.filter(Bi(N(e)))},z.prototype.slice=function(e,t){e=x(e);var i=this;return i.__filtered__&&(e>0||t<0)?new z(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==s&&(t=x(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},z.prototype.toArray=function(){return this.take(nt)},it(z.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);a&&(d.prototype[t]=function(){var f=this.__wrapped__,p=o?[1]:arguments,y=f instanceof z,E=p[0],v=y||L(f),S=function(q){var W=a.apply(d,Et([q],p));return o&&B?W[0]:W};v&&i&&typeof E=="function"&&E.length!=1&&(y=v=!1);var B=this.__chain__,A=!!this.__actions__.length,F=c&&!B,U=y&&!A;if(!c&&v){f=U?f:new z(this);var V=e.apply(f,p);return V.__actions__.push({func:Ei,args:[S],thisArg:s}),new qe(V,B)}return F&&U?e.apply(this,p):(V=this.thru(S),F?o?V.value()[0]:V.value():V)})}),Re(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var a=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(L(c)?c:[],a)}return this[i](function(f){return t.apply(L(f)?f:[],a)})}}),it(z.prototype,function(e,t){var i=d[t];if(i){var o=i.name+"";X.call(en,o)||(en[o]=[]),en[o].push({name:t,func:i})}}),en[gi(s,H).name]=[{name:"wrapper",func:s}],z.prototype.clone=hp,z.prototype.reverse=mp,z.prototype.value=pp,d.prototype.at=H_,d.prototype.chain=W_,d.prototype.commit=K_,d.prototype.next=Y_,d.prototype.plant=Z_,d.prototype.reverse=J_,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=X_,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=G_),d},Xt=Km();Ot?((Ot.exports=Xt)._=Xt,Ji._=Xt):me._=Xt}).call(an)}($n,$n.exports);var C=$n.exports;const no={methods:{getFieldRowClasses(n){const l=this.fieldErrors(n).length>0,s={[C.get(this.options,"validationErrorClass","error")]:l,[C.get(this.options,"validationSuccessClass","valid")]:!l,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>s[m]=!0):C.isString(n.styleClasses)&&(s[n.styleClasses]=!0),C.isNil(n.type)||(s["field-"+n.type]=!0),s},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},io=(n,l="")=>typeof n.id<"u"?l+n.id:l+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),ro=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",yt="\\d\\d",ya="\\d{3}",ba="\\d{4}",dn="[^\\s]+",so=/\[([^]*?)\]/gm;function lo(n,l){for(var s=[],m=0,h=n.length;m<h;m++)s.push(n[m].substr(0,l));return s}var ao=function(n){return function(l,s){var m=s[n].map(function(u){return u.toLowerCase()}),h=m.indexOf(l.toLowerCase());return h>-1?h:null}};function Nt(n){for(var l=[],s=1;s<arguments.length;s++)l[s-1]=arguments[s];for(var m=0,h=l;m<h.length;m++){var u=h[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],wa=lo(uo,3),Ca=lo(co,3),fo={dayNamesShort:Ca,dayNames:co,monthNamesShort:wa,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},Vn=Nt({},fo),ka=function(n){return Vn=Nt(Vn,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Se=function(n,l){for(l===void 0&&(l=2),n=String(n);n.length<l;)n="0"+n;return n},Ea={D:function(n){return String(n.getDate())},DD:function(n){return Se(n.getDate())},Do:function(n,l){return l.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Se(n.getDay())},ddd:function(n,l){return l.dayNamesShort[n.getDay()]},dddd:function(n,l){return l.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Se(n.getMonth()+1)},MMM:function(n,l){return l.monthNamesShort[n.getMonth()]},MMMM:function(n,l){return l.monthNames[n.getMonth()]},YY:function(n){return Se(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Se(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Se(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Se(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Se(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Se(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Se(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Se(n.getMilliseconds(),3)},a:function(n,l){return n.getHours()<12?l.amPm[0]:l.amPm[1]},A:function(n,l){return n.getHours()<12?l.amPm[0].toUpperCase():l.amPm[1].toUpperCase()},ZZ:function(n){var l=n.getTimezoneOffset();return(l>0?"-":"+")+Se(Math.floor(Math.abs(l)/60)*100+Math.abs(l)%60,4)},Z:function(n){var l=n.getTimezoneOffset();return(l>0?"-":"+")+Se(Math.floor(Math.abs(l)/60),2)+":"+Se(Math.abs(l)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],_o=["isPm",dn,function(n,l){var s=n.toLowerCase();return s===l.amPm[0]?0:s===l.amPm[1]?1:null}],yo=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var l=(n+"").match(/([+-]|\d\d)/gi);if(l){var s=+l[1]*60+parseInt(l[2],10);return l[0]==="+"?s:-s}return 0}],va={D:["day",_t],DD:["day",yt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",yt,mo],YY:["year",yt,function(n){var l=new Date,s=+(""+l.getFullYear()).substr(0,2);return+(""+(+n>68?s-1:s)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",yt,void 0,"isPm"],H:["hour",_t],HH:["hour",yt],m:["minute",_t],mm:["minute",yt],s:["second",_t],ss:["second",yt],YYYY:["year",ba],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",yt,function(n){return+n*10}],SSS:["millisecond",ya],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,ao("monthNamesShort")],MMMM:["month",dn,ao("monthNames")],a:_o,A:_o,ZZ:yo,Z:yo},On={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"},Sa=function(n){return Nt(On,n)},Ta=function(n,l,s){if(l===void 0&&(l=On.default),s===void 0&&(s={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");l=On[l]||l;var m=[];l=l.replace(so,function(u,b){return m.push(b),"@@@"});var h=Nt(Nt({},Vn),s);return l=l.replace(oo,function(u){return Ea[u](n,h)}),l.replace(/@@@/g,function(){return m.shift()})};function Ba(n,l,s){if(s===void 0&&(s={}),typeof l!="string")throw new Error("Invalid format in fecha parse");if(l=On[l]||l,n.length>1e3)return null;var m=new Date,h={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=l.replace(so,function(Te,he){return b.push(ho(he)),"@@@"}),T={},I={};g=ho(g).replace(oo,function(Te){var he=va[Te],tt=he[0],Ye=he[1],wt=he[3];if(T[tt])throw new Error("Invalid format. "+tt+" specified twice in format");return T[tt]=!0,wt&&(I[wt]=!0),u.push(he),"("+Ye+")"}),Object.keys(I).forEach(function(Te){if(!T[Te])throw new Error("Invalid format. "+Te+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var O=n.match(new RegExp(g,"i"));if(!O)return null;for(var j=Nt(Nt({},Vn),s),J=1;J<O.length;J++){var we=u[J-1],et=we[0],st=we[2],fe=st?st(O[J],j):+O[J];if(fe==null)return null;h[et]=fe}h.isPm===1&&h.hour!=null&&+h.hour!=12?h.hour=+h.hour+12:h.isPm===0&&+h.hour==12&&(h.hour=0);var H;if(h.timezoneOffset==null){H=new Date(h.year,h.month,h.day,h.hour,h.minute,h.second,h.millisecond);for(var Y=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=0,ce=Y.length;J<ce;J++)if(T[Y[J][0]]&&h[Y[J][0]]!==H[Y[J][1]]())return null}else if(H=new Date(Date.UTC(h.year,h.month,h.day,h.hour,h.minute-h.timezoneOffset,h.second,h.millisecond)),h.month>11||h.month<0||h.day>31||h.day<1||h.hour>23||h.hour<0||h.minute>59||h.minute<0||h.second>59||h.second<0)return null;return H}var Le={format:Ta,parse:Ba,defaultI18n:fo,setGlobalDateI18n:ka,setGlobalDateMasks:Sa};const ge={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 xe(n,l,s=ge){return C.isNil(n)||n===""?l?[ie(s.fieldIsRequired)]:[]:null}function ie(n,...l){if(n!=null&&l.length>0)for(let s=0;s<l.length;s++)n=n.replace("{"+(s-1)+"}",l[s]);return n}const cn={resources:ge,required(n,l,s,m=ge){return xe(n,l.required,m)},number(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=[];return C.isFinite(n)?(!C.isNil(l.min)&&n<l.min&&u.push(ie(m.numberTooSmall,l.min)),!C.isNil(l.max)&&n>l.max&&u.push(ie(m.numberTooBig,l.max))):u.push(ie(m.invalidNumber)),u},integer(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=cn.number(n,l,s,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=[];return C.isString(n)?(!C.isNil(l.min)&&n.length<l.min&&u.push(ie(m.textTooSmall,n.length,l.min)),!C.isNil(l.max)&&n.length>l.max&&u.push(ie(m.textTooBig,n.length,l.max))):u.push(ie(m.thisNotText)),u},array(n,l,s,m=ge){if(l.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(l.min)&&n.length<l.min)return[ie(m.selectMinItems,l.min)];if(!C.isNil(l.max)&&n.length>l.max)return[ie(m.selectMaxItems,l.max)]}},date(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(l.min)){const g=new Date(l.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,Le.format(u),Le.format(g)))}if(!C.isNil(l.max)){const g=new Date(l.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,Le.format(u),Le.format(g)))}return b},regexp(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!C.isNil(l.pattern)&&!new RegExp(l.pattern).test(n))return[ie(m.invalidFormat)]},email(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;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(n))return[ie(m.invalidEmail)]},url(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=/^(?: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})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,T,I,O;for(let j=b.length-1;j>=0;j--)T=b.substring(j,j+1),I=parseInt(T,10),O?(I*=2,I>=10?g+=I%10+1:g+=I):g+=I,O=!O;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const l=cn[n];C.isFunction(l)&&(l.locale=s=>(m,h,u)=>l(m,h,u,C.defaults(s,ge)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ni(n,l,s){let m=C.get(s.context,"schema.attributes",{});const h=l.value||"input";C.isString(h)&&(m=C.get(m,h)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const K={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ni,updated:Ni,componentUpdated:Ni}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const l=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,l):this.updateModelValue(n,l)}}},methods:{validate(n){this.clearValidationErrors();const l=C.get(this.formOptions,"validateAsync",!1);let s=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const h=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{h.push(bo(u).bind(this))}):h.push(bo(this.schema.validator).bind(this)),C.forEach(h,u=>{if(l)s.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const T=this.errors.length===0;this.$emit("validated",T,this.errors,this)}):b&&(s=s.concat(b))}})}const m=h=>{let u=[];C.forEach(C.uniq(h),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return l?Promise.all(s).then(m):m(s)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,l){let s=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),s=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),s=!0),s&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,l,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,l){let s=n.replace(/\[(\w+)\]/g,".$1");s=s.replace(/^\./,"");let m=this.model;const h=s.split(".");let u=0;const b=h.length;for(;u<b;){const g=h[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=l;return}++u}},getFieldID(n,l=!1){const s=C.get(this.formOptions,"fieldIdPrefix","");return io(n,s)+(l?"-"+C.uniqueId():"")},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Ia=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),Ma={mixins:[K]},Aa=["id","autocomplete","disabled","name","required"];function Na(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:r.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Aa)),[[r.vModelCheckbox,n.value],[b,"input"]])}const eb="",P=(n,l)=>{const s=n.__vccOpts||n;for(const[m,h]of l)s[m]=h;return s},Fa=P(Ma,[["render",Na]]),$a={class:"wrapper"},Va=["disabled"],Oa=["id","checked","disabled","onChange","name"],Da=["disabled"],La={class:"info"},xa=r.createElementVNode("div",{class:"arrow"},null,-1),Ua={class:"dropList"},Ra=["id","checked","disabled","onChange","name"];function Pa(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",$a,[n.schema.listBox?(r.openBlock(),r.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Oa),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Va)):r.createCommentVNode("",!0),n.schema.listBox?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[r.createElementVNode("div",{class:r.normalizeClass(["mainRow",{expanded:h.comboExpanded}]),onClick:l[0]||(l[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[r.createElementVNode("div",La,r.toDisplayString(u.selectedCount)+" selected",1),xa],2),r.createElementVNode("div",Ua,[h.comboExpanded?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Ra),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)])],2))),256)):r.createCommentVNode("",!0)])],8,Da))])),[[b,"wrapper"]])}const tb="",qa=P({mixins:[K],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?ro(this.schema.inputName+"_"+this.getItemValue(n)):ro(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.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 n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,l){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const s=C.clone(this.value);s.push(this.getItemValue(l)),this.value=s}else{const s=C.clone(this.value);s.splice(this.value.indexOf(this.getItemValue(l)),1),this.value=s}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Pa]]),za={class:"wrapper"},Ha=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],Wa={key:0,class:"helper"};function Ka(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",za,[r.withDirectives(r.createElementVNode("input",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:l[0]||(l[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:l[1]||(l[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:l[2]||(l[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,Ha),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(r.openBlock(),r.createElementBlock("span",Wa,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)])),[[b,"wrapper"]])}const ib="",wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[K],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,l)=>{this.formatNumberToModel(n,l)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,l)=>{this.formatDatetimeToModel(n,l)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(l,s)=>{this.debouncedFormatFunc(n,s)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,l){const s=wo[this.schema.inputType.toLowerCase()],m=Le.parse(n,s);m!==!1&&(this.schema.format?n=Le.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,l)},formatDatetimeValueToField(n){if(n==null)return null;const l=wo[this.schema.inputType.toLowerCase()];let s=n;return C.isNumber(n)||(s=Le.parse(n,l)),s!==!1?Le.format(s,l):n},formatNumberToModel(n,l){C.isNumber(n)||(n=NaN),this.updateModelValue(n,l)},onInput(n){let l=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(l=parseFloat(n.target.value));break}this.value=l},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Ka]]),Ya=["id"];function Ga(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("span",{id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[r.createTextVNode(r.toDisplayString(n.value),1)],10,Ya)),[[b,"label"]])}const ob="",Za=P({mixins:[K]},[["render",Ga]]),Ja=["disabled"],Xa=["id","disabled","name","onClick","value","checked","required"];function Qa(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>r.withDirectives((r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(u.getItemCssClasses(g))},[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:T=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:r.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Xa),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Ja)),[[b,"wrapper"]])}const lb="",ja=P({mixins:[K],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.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 n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const l=C.get(n,"disabled",!1);return C.isFunction(l)?l(this.model):l}}},[["render",Qa]]),ed=["disabled","name","id"],td=["disabled"],nd=["label"],id=["value"],rd=["value"];function od(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("select",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},r.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,td)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[g.group?(r.openBlock(),r.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(g.ops,T=>(r.openBlock(),r.createElementBlock("option",{value:u.getItemValue(T)},r.toDisplayString(u.getItemName(T)),9,id))),256)):r.createCommentVNode("",!0)],8,nd)):r.createCommentVNode("",!0),g.group?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("option",{key:1,value:u.getItemValue(g)},r.toDisplayString(u.getItemName(g)),9,rd))],64))),256))],10,ed)),[[r.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[K],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const l=[];let s={};return n.forEach(m=>{s=null,m.group&&C.isObject(m)?(s=C.find(l,h=>h.group===m.group),s?s.ops.push({id:m.id,name:m.name}):(s={group:"",ops:[]},s.group=m.group,s.ops.push({id:m.id,name:m.name}),l.push(s))):l.push(m)}),l},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.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 n}}},[["render",od]]),sd=["id","value","name","disabled"];function ld(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:l[0]||(l[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:r.normalizeClass(n.schema.fieldClasses)},null,10,sd)}const cb="",ad=P({mixins:[K],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const l=C.get(this.formOptions,"validateAsync",!1),s=this.vfg.validate(),m=h=>{l&&!C.isEmpty(h)||!l&&!h?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,h,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};s&&C.isFunction(s.then)?s.then(m):m(s)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",ld]]),dd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function cd(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("textarea",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,dd)),[[r.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[K]},[["render",cd]]),ud={class:"wrapper"},fd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function hd(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",ud,[r.withDirectives(r.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:l[0]||(l[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,fd),[[b,"input"]])])),[[b,"wrapper"]])}const hb="",md=P({mixins:[K],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",hd]]),pd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function gd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,pd)}const _d=P({mixins:[K],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(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",gd]]),vo={formatValueToField(n){if(n!=null){const l=this.schema.format?Le.parse(n,this.schema.format):new Date(n);return Le.format(l,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const l=Le.parse(n,this.getDateFormat());this.schema.format?n=Le.format(l,this.schema.format):n=l.valueOf()}return n}},yd={class:"input-group date"},bd=["autocomplete","disabled","placeholder","readonly","name","id"],wd=r.createElementVNode("span",{class:"input-group-addon"},[r.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function Cd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",yd,[r.withDirectives(r.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,bd),[[r.vModelText,n.value]]),wd])}const So="YYYY-MM-DD HH:mm:ss",kd={mixins:[K],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:So})).on("dp.change",()=>{this.value=n.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:So},...vo}},Ed=P(kd,[["render",Cd]]),vd=["autocomplete","disabled","placeholder","readonly","name","id"];function Sd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:l[1]||(l[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,vd)),[[r.vModelText,n.value]])}const Td=P({mixins:[K],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 n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const l={};if(n.address_components!==void 0)for(let s=0;s<n.address_components.length;s++){const m=n.address_components[s].types[0];this.inputs[m]&&(l[m]=n.address_components[s][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,l,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const l={lat:n.coords.latitude,lng:n.coords.longitude},s=new window.google.maps.Circle({center:l,radius:n.coords.accuracy});this.autocomplete.setBounds(s.getBounds())})}}},[["render",Sd]]),Bd={class:"wrapper"},Id=["autocomplete","disabled","placeholder","readonly"],Md=["disabled","name"];function Ad(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",Bd,[r.withDirectives(r.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Id),[[r.vShow,n.schema.hideInput!==!0],[r.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(r.openBlock(),r.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:l[1]||(l[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Md)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"preview",style:r.normalizeStyle(u.previewStyle)},[r.createElementVNode("div",{class:"remove",title:"Remove image",onClick:l[2]||(l[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const _b="",Nd=P({mixins:[K],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(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const l=new FileReader;l.onload=s=>{this.value=s.target.result},n.target.files&&n.target.files.length>0&&l.readAsDataURL(n.target.files[0])}}},[["render",Ad]]),Fd=["autocomplete","disabled","placeholder","readonly","name","id"];function $d(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Fd)),[[r.vModelText,n.value]])}const Vd=P({mixins:[K],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",$d]]),wb="",Od={mixins:[K],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,C.defaults(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(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},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}}},Dd=["disabled"];function Ld(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,Dd)}const xd=P(Od,[["render",Ld]]),Ud=["autocomplete","disabled","placeholder","readonly","name"];function Rd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ud)),[[r.vModelText,n.value]])}const Pd="YYYY-MM-DD",qd={mixins:[K],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",Pd)},...vo,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{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!")})}}},zd=P(qd,[["render",Rd]]),Hd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function Wd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Hd)}const Cb="",Kd=P({mixins:[K],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,l;C.isArray(this.value)?[n,l]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:l})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,l;C.isArray(this.value)?[n,l]=this.value:n=this.value;const s=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:l,onChange(m){s.slider.options.type==="double"?s.value=[m.from,m.to]:s.value=m.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",Wd]]),Yd=["disabled","multiple","title","name"],Gd=["disabled","selected"],Zd=["value"];function Jd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(r.openBlock(),r.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Gd)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,b=>(r.openBlock(),r.createElementBlock("option",{value:u.getItemValue(b)},r.toDisplayString(u.getItemName(b)),9,Zd))),256))],8,Yd)),[[r.vModelSelect,n.value]])}const Eb="",Xd=P({mixins:[K],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},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(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.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 n}}},[["render",Jd]]),Qd=["autocomplete","disabled","placeholder","readonly","name","id"];function jd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Qd)}const ec=P({mixins:[K],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.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",jd]]),tc=["src"];function nc(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("img",{src:u.mapLink},null,8,tc)}const Tb="",ic=P({mixins:[K],computed:{mapLink(){let n,l,s;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],l=this.value[m.lng],s=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${l}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const h=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of h)typeof m[u]<"u"&&(s+=`&${u}=${m[u]}`)}return s}}},[["render",nc]]),rc=["autocomplete","disabled","name","id"],oc=["data-on","data-off","for"],sc=r.createElementVNode("span",{class:"handle"},null,-1);function lc(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,rc),[[r.vModelCheckbox,n.value]]),r.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,oc),sc])}const Ib="",ac=P({mixins:[K],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",lc]]),dc={mixins:[K],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 n=Object.keys(this.value),l={};for(let s=0;s<n.length;s++){const m=n[s];l[m]=typeof this.value[m]}this.keyTypes=l},methods:{removeElement(n){const l=this.value;delete l[n],this.value=JSON.parse(JSON.stringify(l));const s=this.keyTypes;delete s[n],this.keyTypes=JSON.parse(JSON.stringify(s))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},cc={key:0},uc={key:1},fc=["id"],hc={key:0},mc=["onUpdate:modelValue"],pc={key:1},gc=["onUpdate:modelValue"],_c={key:2},yc=["onUpdate:modelValue"],bc=["onClick"],wc=[r.createElementVNode("option",{value:"string"}," String ",-1),r.createElementVNode("option",{value:"number"}," Number ",-1),r.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function Cc(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator"),g=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[n.schema.schema?(r.openBlock(),r.createElementBlock("div",cc,[r.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(r.openBlock(),r.createElementBlock("div",uc,[r.createElementVNode("table",{id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(T,I)=>(r.openBlock(),r.createElementBlock("tr",{key:I},[r.createElementVNode("td",null,r.toDisplayString(I),1),h.keyTypes[I]==="string"?(r.openBlock(),r.createElementBlock("td",hc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"text"},null,8,mc),[[r.vModelText,n.value[I]]])])):r.createCommentVNode("",!0),h.keyTypes[I]==="boolean"?(r.openBlock(),r.createElementBlock("td",pc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"checkbox"},null,8,gc),[[r.vModelCheckbox,n.value[I]]])])):r.createCommentVNode("",!0),h.keyTypes[I]==="number"?(r.openBlock(),r.createElementBlock("td",_c,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"number"},null,8,yc),[[r.vModelText,n.value[I]]])])):r.createCommentVNode("",!0),r.createElementVNode("td",null,[r.createElementVNode("input",{type:"button",value:"x",onClick:O=>u.removeElement(I)},null,8,bc)])]))),128))],10,fc),r.withDirectives(r.createElementVNode("select",{"onUpdate:modelValue":l[0]||(l[0]=T=>h.newKeyType=T)},wc,512),[[r.vModelSelect,h.newKeyType]]),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[1]||(l[1]=T=>h.newKeyName=T),type:"text"},null,512),[[r.vModelText,h.newKeyName]]),r.createElementVNode("input",{type:"button",value:"Add key",onClick:l[2]||(l[2]=(...T)=>u.addKey&&u.addKey(...T))})]))])),[[g,h.attributes]])}const To=P(dc,[["render",Cc]]),$b="",kc={mixins:[K],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:(n,l)=>({[this.schema.model]:n[l]}),set:(n,l,s)=>n[l]=s[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const l=this.value;delete l[n],this.value={...l}},transformMapModelValuesToObject(n,l,s){const m={};return Object.keys(n).map(h=>{const u=h.indexOf(s+"-");if(u>-1&&Array.isArray(l))if(l.length>0){const g=h.split("-").filter(I=>l.find(O=>O.model===I)),T=h.split(`-${g}`)[0].split(`${s}-`)[1];g.length?m[T]={...m[T],[g]:n[h]}:m[h.substring(u+`${s}-`.length)]=n[h]}else m[h.substring(`${s}-`.length)]=n[h];else{const g=h.split("-").filter(I=>I===this.schema.model),T=h.split(`-${g}`)[0].split(`${s}-`)[1];T&&(m[T]=n[h])}return h}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",l=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=l,this.newKeyName=""},updateModel(n,l){this.$emit("model-updated",this.model[this.schema.model],l)}}},Bo=n=>(r.pushScopeId("data-v-22600a29"),n=n(),r.popScopeId(),n),Ec=["id"],vc=["data-testid"],Sc={class:"item-wrapper"},Tc={class:"index-wrapper"},Bc=Bo(()=>r.createElementVNode("hr",{class:"divider"},null,-1)),Ic={key:0},Mc={key:1},Ac=["onUpdate:modelValue","placeholder","onInput"],Nc={key:0,class:"hint"},Fc=Bo(()=>r.createElementVNode("hr",{class:"wide-divider"},null,-1)),$c={class:"input-item"},Vc=["placeholder"],Oc={key:0,class:"hint"};function Dc(n,l,s,m,h,u){const b=r.resolveComponent("KIcon"),g=r.resolveComponent("KButton"),T=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",{id:n.getFieldID(n.schema),class:r.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(I,O)=>(r.openBlock(),r.createElementBlock("div",{key:O,"data-testid":`field-object-key-${O}`},[r.createElementVNode("div",null,[r.createElementVNode("div",Sc,[r.createElementVNode("div",Tc,[r.createElementVNode("strong",null,r.toDisplayString(O),1),r.createElementVNode("div",null,[r.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:j=>u.removeElement(O)},{default:r.withCtx(()=>[r.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),Bc,u.subSchema?(r.openBlock(),r.createElementBlock("div",Ic,[r.createVNode(T,{model:u.transformedModel[O],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(r.openBlock(),r.createElementBlock("div",Mc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":j=>n.value[O]=j,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:j=>u.updateModel(n.value[O],n.model[n.schema.model])},null,40,Ac),[[r.vModelText,n.value[O]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(r.openBlock(),r.createElementBlock("p",Nc,r.toDisplayString(n.schema.fields[0].schema.hint),1)):r.createCommentVNode("",!0)])),Fc])])],8,vc))),128)),r.createElementVNode("div",{class:r.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[r.createElementVNode("div",$c,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=I=>h.newKeyName=I),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Vc),[[r.vModelText,h.newKeyName]]),r.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!h.newKeyName,onClick:u.addKey},{default:r.withCtx(()=>[r.createTextVNode(" + Add "+r.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(r.openBlock(),r.createElementBlock("p",Oc,r.toDisplayString(n.schema.hintText),1)):r.createCommentVNode("",!0)],2)],10,Ec)}const Io=P(kc,[["render",Dc],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,l)=>{const s=n.__vccOpts||n;for(const[m,h]of l)s[m]=h;return s},Lc=n=>(r.pushScopeId("data-v-81725854"),n=n(),r.popScopeId(),n),xc=["aria-hidden"],Uc={key:0,"data-testid":"kui-icon-svg-title"},Rc=Lc(()=>r.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Pc=Mo(r.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:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const l=String(n).replace(/px/gi,""),s=Number(l);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const l=n,s=r.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const h=String(l.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=r.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:r.normalizeStyle(m.value)},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",{"aria-hidden":n.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"},[n.title?(r.openBlock(),r.createElementBlock("title",Uc,r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),Rc],8,xc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-81725854"]]),qc=n=>(r.pushScopeId("data-v-d8f1522f"),n=n(),r.popScopeId(),n),zc=["aria-hidden"],Hc={key:0,"data-testid":"kui-icon-svg-title"},Wc=qc(()=>r.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)),Ln=Mo(r.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:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const l=String(n).replace(/px/gi,""),s=Number(l);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const l=n,s=r.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const h=String(l.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=r.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:r.normalizeStyle(m.value)},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",{"aria-hidden":n.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"},[n.title?(r.openBlock(),r.createElementBlock("title",Hc,r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),Wc],8,zc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-d8f1522f"]]),Db="",Lb="",Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,l,s,m,h,u){const b=r.resolveComponent("TrashIcon"),g=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Yc,[r.renderSlot(n.$slots,"default",{},void 0,!0),r.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:l[0]||(l[0]=T=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(b)]),_:1})])}const Ao=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),xb="",Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(r.pushScopeId("data-v-47ff1f9a"),n=n(),r.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>r.createElementVNode("hr",null,null,-1));function jc(n,l,s,m,h,u){const b=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Xc,[r.renderSlot(n.$slots,"default",{},void 0,!0),r.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:l[0]||(l[0]=g=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const No=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),Ub="",eu={name:"FieldMetric",components:{AddIcon:Pc,TrashIcon:Ln},mixins:[K],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,l,s,m,h,u){const b=r.resolveComponent("AddIcon"),g=r.resolveComponent("TrashIcon"),T=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["field-dropdown",{active:h.contentVisible}])},[r.createElementVNode("div",{class:"title",onClick:l[0]||(l[0]=I=>h.contentVisible=!h.contentVisible)},[r.createTextVNode(r.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),r.createVNode(b,{class:"metric-add-icon"})]),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[h.contentVisible?(r.openBlock(),r.createElementBlock("div",tu,[r.renderSlot(n.$slots,"default"),r.createVNode(T,{appearance:"tertiary",class:"metric-remove-button",onClick:l[1]||(l[1]=I=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(g)]),_:1})])):r.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),bt="kong-ui-forms-api",iu="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function ru(n){return n?n.length===36&&new RegExp(`^${iu}$`).test(n):!1}const Rb="",Pb="",Fi=50,Ft={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 ou(n,l,s){return s?Ft.SET_REFERRAL_VALUE:n&&!l||!n&&l?Ft.UPDATE_ENTITY:n&&l?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const su={mixins:[K],inject:[bt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(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 n,l;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[bt]){console.warn("[@kong-ui-public/forms] No API service provided");break}l=(await this[bt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?l[this.schema.entityDataKey]:l),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(s){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",s)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const l=[],s=[],m=this.getInputFields(),h=new Set;ru(n)&&m.includes("id")?s.push((async()=>{const u=await this.fetchExact(n);l.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):s.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{h.has(g.id)||(h.add(g.id),l.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(s),this.items=l,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const l=[];let s=null;if(!this[bt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;l.length<Fi;){const m=await this[bt].getAll(this.entity,{size:Fi,offset:s,...n});if(l.push(...m.data.data),s=m.data.offset,!s)break}return l.slice(0,Fi)},async fetchSuggestions(n,l){return this.fetchUntilLimit({[l]:n})},async fetchExact(n){return this[bt]?(await this[bt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,l;return((l=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:l.fields)||[]},getSuggestionLabel(n){const l=this.getInputFields();return l.length&&n?l.map(s=>n[s]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var s;const l=(s=this.schema)==null?void 0:s.returnKey;return l?n[l]:n.id}}},lu={class:"field-wrap autosuggest"},au=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,l,s,m,h,u){const b=r.resolveComponent("KSelect");return r.openBlock(),r.createElementBlock("div",lu,[r.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:h.idValue,"onUpdate:modelValue":l[0]||(l[0]=g=>h.idValue=g),appearance:"select",autosuggest:"",clearable:"","enable-filtering":"",items:h.items,loading:h.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":r.withCtx(({item:g})=>[r.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},r.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,au),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(T,I)=>(r.openBlock(),r.createElementBlock("span",{key:I,class:"field-span","data-testid":g.id&&`${g.id}-${I+1}`||I+1},r.toDisplayString(T),9,du))),128))]),empty:r.withCtx(()=>[r.createElementVNode("div",cu,[r.createElementVNode("span",null,r.toDisplayString(h.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const $o=P(su,[["render",uu],["__scopeId","data-v-27d6a440"]]),qb="",zb="",fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,l,s,m,h,u){const b=r.resolveComponent("KCard"),g=r.resolveComponent("TrashIcon"),T=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",hu,[r.createVNode(b,{class:"card"},{body:r.withCtx(()=>[r.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),r.createVNode(T,{appearance:"tertiary",class:"array-card-remove-button",onClick:l[0]||(l[0]=I=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(g)]),_:1})])}const Vo=P(fu,[["render",mu],["__scopeId","data-v-d409fd75"]]),Hb="",pu={mixins:[K],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let l=n.target.value.split(",");this.schema.array||(l=l.toString()),this.updateModel(l)}}},gu={class:"selection-group"},_u={class:"form-group"},yu=["id","checked","name","value"];function bu(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",gu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.schema.values,(b,g)=>(r.openBlock(),r.createElementBlock("div",{key:g,class:"option-group"},[r.createElementVNode("div",_u,[r.createElementVNode("label",{class:r.normalizeClass(["k-label",b.name])},[r.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:l[0]||(l[0]=(...T)=>u.onChange&&u.onChange(...T))},null,40,yu),r.createTextVNode(" "+r.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),Wb="",wu={name:"FieldArray",components:{FieldArrayItem:Ao,FieldArrayMultiItem:No,FieldSelect:ko,FieldMetric:Fo,FieldObject:To,FieldObjectAdvanced:Io,FieldAutoSuggest:$o,FieldRadio:Oo,FieldArrayCardContainer:Vo,FieldTextArea:Eo,FieldInput:Co},mixins:[K],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,l,s){var h,u,b;let m;return l&&(m=JSON.parse(JSON.stringify(l)),(b=(u=(h=m.schema)==null?void 0:h.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${s}`,g))),{...m,set(g,T){n[s]=T},get(){return n[s]}}},newElement(){let n=this.value,l;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?l=this.schema.items.default():l=this.schema.items.default),n.push(l),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","type"],vu=["value","onClick"],Su=["onUpdate:modelValue"],Tu=["value","onClick"];function Bu(n,l,s,m,h,u){const b=r.resolveComponent("FieldTextArea"),g=r.resolveComponent("KButton");return n.schema?(r.openBlock(),r.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(T,I)=>(r.openBlock(),r.createElementBlock("div",{key:I,class:r.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onRemoveItem:O=>u.removeElement(I)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(r.openBlock(),r.createElementBlock("span",ku,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${I}`,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onRemoveItem:O=>u.removeElement(I)},{default:r.withCtx(()=>{var O,j;return[((O=n.schema.inputAttributes)==null?void 0:O.type)==="textarea"?(r.openBlock(),r.createBlock(b,{key:0,class:"k-input","form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,8,["form-options","model","schema","onModelUpdated"])):r.withDirectives((r.openBlock(),r.createElementBlock("input",r.mergeProps({key:1,"onUpdate:modelValue":J=>n.value[I]=J},n.schema.inputAttributes,{type:((j=n.schema.inputAttributes)==null?void 0:j.type)||"text"}),null,16,Eu)),[[r.vModelDynamic,n.value[I]]]),n.schema.showRemoveButton?(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:J=>u.removeElement(I)}),null,16,vu)):r.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):r.withDirectives((r.openBlock(),r.createElementBlock("input",r.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":O=>n.value[I]=O,type:"text"}),null,16,Su)),[[r.vModelText,n.value[I]]]),n.schema.showRemoveButton?(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:O=>u.removeElement(I)}),null,16,Tu)):r.createCommentVNode("",!0)],2))),128)),r.createVNode(g,{appearance:"tertiary",class:r.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.schema.newElementButtonLabel||s.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):r.createCommentVNode("",!0)}const Iu=P(wu,[["render",Bu],["__scopeId","data-v-1731cb2f"]]),Kb="",Mu={mixins:[K],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(n,l){this.$emit("model-updated",n,l)}}},Au={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Nu={class:"material-icons"};function Fu(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",Au,[r.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:l[0]||(l[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[r.createElementVNode("i",Nu,r.toDisplayString(h.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),r.createElementVNode("span",null,r.toDisplayString(u.titleText),1)]),r.createElementVNode("div",{class:r.normalizeClass(["advanced-field-dropdown",u.openClass])},[r.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const $u=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),Yb="",Gb="",Vu={mixins:[K],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,l){if(l===null){this.fieldModel={...this.model};return}const s=this.schema.fields[n].fields,m=this.schema.fields[l].fields;m&&m.forEach(h=>this.updateModel("",h.model)),s&&s.forEach(h=>this.updateModel(this.fieldModel[h.model],h.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,l)=>{n.fields&&n.fields.forEach(s=>{this.model[s.model]&&(this.checkedGroup=l,this.fieldSchema.push(s.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,l){this.$emit("model-updated",n,l)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],xu={class:"control-help"},Uu={class:"option-field"},Ru={class:"option-field-container"};function Pu(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",Ou,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.schema.fields,(g,T)=>(r.openBlock(),r.createElementBlock("div",{key:T,class:"option-group"},[r.createElementVNode("div",Du,[r.createElementVNode("label",{class:r.normalizeClass(["k-label",`${g.label}-check`])},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=I=>h.checkedGroup=I),class:"k-input",type:"radio",value:T},null,8,Lu),[[r.vModelRadio,h.checkedGroup]]),r.createTextVNode(" "+r.toDisplayString(g.label)+" ",1),r.createElementVNode("div",xu,r.toDisplayString(g.description),1)],2)]),r.withDirectives(r.createElementVNode("div",Uu,[r.createElementVNode("div",Ru,[r.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[r.vShow,g.fields&&h.checkedGroup===T]])]))),128))])}const qu=P(Vu,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[K],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,l,s,m,h,u){const b=r.resolveComponent("KMultiselect");return r.openBlock(),r.createBlock(b,{"collapsed-context":"","data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Zb="",Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[K],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var l,s;this.value||(this.value={});const n=((s=this.model)==null?void 0:s[(l=this.schema)==null?void 0:l.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,l,s){this.pairs[l][s]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:l,value:s})=>({...n,...l&&s?{[l]:s}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,l,s,m,h,u){const b=r.resolveComponent("TrashIcon"),g=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Yu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.pairs,(T,I)=>(r.openBlock(),r.createElementBlock("div",{key:I,class:"pair-item"},[r.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${I}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:T.key,onInput:O=>{u.onInput(O,I,"key")}},null,40,Gu),r.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${I}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:T.value,onInput:O=>{u.onInput(O,I,"value")}},null,40,Zu),r.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${I}`,onClick:()=>{u.removePair(I)}},{default:r.withCtx(()=>[r.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),r.createVNode(g,{appearance:"tertiary",class:r.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu=Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:$u,FieldArray:Iu,FieldArrayCardContainer:Vo,FieldArrayItem:Ao,FieldArrayMultiItem:No,FieldAutoSuggest:$o,FieldCheckbox:Fa,FieldChecklist:qa,FieldCleave:_d,FieldDateTimePicker:Ed,FieldGoogleAddress:Td,FieldImage:Nd,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Za,FieldMasked:Vd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:xd,FieldObject:To,FieldObjectAdvanced:Io,FieldPikaday:zd,FieldRadio:Oo,FieldRadios:ja,FieldRangeSlider:Kd,FieldSelect:ko,FieldSelectEx:Xd,FieldSelectionGroup:qu,FieldSpectrum:ec,FieldStaticMap:ic,FieldSubmit:ad,FieldTextArea:Eo,FieldUpload:md,fieldSwitch:ac},Symbol.toStringTag,{value:"Module"})),Xb="",Qb="",Qu={name:"FormGroup",components:Xu,mixins:[no],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:r.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let l="";switch(n.type==="input"?l=n.inputType:l=n.type,l){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const l=C.get(this.options,"fieldIdPrefix","");return io(n,l)},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,l,s){this.$emit("validated",n,l,s)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,l,s){return n.onclick.call(this,this.model,l,s,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(l=>l.field.fieldName===n.fieldName).map(l=>l.error)},onModelUpdated(n,l){this.$emit("modelUpdated",n,l)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(r.pushScopeId("data-v-bee61052"),n=n(),r.popScopeId(),n),ju=["for"],ef={class:"icon-wrapper"},tf=["innerHTML"],nf=Do(()=>r.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[r.createElementVNode("i",{class:"icon"})],-1)),rf=["innerHTML"],of={key:0,class:"link-wrapper"},sf=Do(()=>r.createElementVNode("span",{class:"section-header"},"More info",-1)),lf={class:"field-wrap"},af={key:0,class:"buttons"},df=["type","onClick","textContent"],cf=["innerHTML"],uf={key:2,class:"errors help-block"},ff=["innerHTML"];function hf(n,l,s,m,h,u){const b=r.resolveComponent("KTooltip"),g=r.resolveComponent("KExternalLink");return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["form-group",n.getFieldRowClasses(s.field)])},[u.fieldTypeHasLabel(s.field)?(r.openBlock(),r.createElementBlock("label",{key:0,class:r.normalizeClass(["form-group-label",s.field.labelClasses]),for:u.getFieldID(s.field)},[r.createElementVNode("div",ef,[r.createElementVNode("span",{innerHTML:u.formattedLabel(s.field.label)},null,8,tf),s.field.help?(r.openBlock(),r.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0},{content:r.withCtx(()=>[s.options.helpAsHtml?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:s.field.help},null,8,rf)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(s.field.help),1)],64))]),default:r.withCtx(()=>[nf]),_:1})):r.createCommentVNode("",!0)]),s.field.link?(r.openBlock(),r.createElementBlock("div",of,[r.createVNode(g,{href:s.field.link},{default:r.withCtx(()=>[sf]),_:1},8,["href"])])):r.createCommentVNode("",!0)],10,ju)):r.createCommentVNode("",!0),r.createElementVNode("div",lf,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(s.field)),r.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(s.field)||null,"form-options":s.options,model:s.model,schema:s.field,vfg:s.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(s.field)?(r.openBlock(),r.createElementBlock("div",af,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.field.buttons,(T,I)=>(r.openBlock(),r.createElementBlock("button",{key:I,class:r.normalizeClass(T.classes),type:u.getButtonType(T),onClick:O=>u.buttonClickHandler(T,s.field,O),textContent:r.toDisplayString(T.label)},null,10,df))),128))])):r.createCommentVNode("",!0)]),s.field.hint?(r.openBlock(),r.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(s.field)},null,8,cf)):r.createCommentVNode("",!0),u.fieldErrors(s.field).length>0?(r.openBlock(),r.createElementBlock("div",uf,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.fieldErrors(s.field),(T,I)=>(r.openBlock(),r.createElementBlock("span",{key:I,innerHTML:T},null,8,ff))),128))])):r.createCommentVNode("",!0)],2)}const mf=P(Qu,[["render",hf],["__scopeId","data-v-bee61052"]]),pf={key:0,class:"vue-form-generator"},gf=["is"],_f=["is"],yf={key:0};function bf(n,l,s,m,h,u){const b=r.resolveComponent("form-group");return s.schema!=null?(r.openBlock(),r.createElementBlock("div",pf,[s.schema.fields?(r.openBlock(),r.createElementBlock("fieldset",{key:0,is:s.tag},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.fields,g=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[u.fieldVisible(g)?(r.openBlock(),r.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:g,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):r.createCommentVNode("",!0)],64))),256))],8,gf)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.groups,g=>(r.openBlock(),r.createElementBlock("fieldset",{is:s.tag,class:r.normalizeClass(n.getFieldRowClasses(g))},[g.legend?(r.openBlock(),r.createElementBlock("legend",yf,r.toDisplayString(g.legend),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.fields,T=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[u.fieldVisible(T)?(r.openBlock(),r.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:T,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):r.createCommentVNode("",!0)],64))),256))],10,_f))),256))])):r.createCommentVNode("",!0)}const jb="",be=P({name:"FormGenerator",components:{formGroup:mf},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:r.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(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:r.ref([])}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,l=>{(!this.multiple||l.multi===!0)&&n.push(l)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),l=>{n.push(l)}),n}},watch:{model:{deep:!0,handler(n,l){l!==n&&n!=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(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,l,s){this.errors=this.errors.filter(h=>h.field.fieldName!==s.schema.fieldName),!n&&l&&l.length>0&&C.forEach(l,h=>{this.errors.push({field:s.schema,error:h})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,l){this.$emit("modelUpdated",n,l)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const l=[],s=[];C.forEach(this.$refs.children,h=>{C.isFunction(h.validate)&&(l.push(h.$refs.child),s.push(h.$refs.child.validate(!0)))});const m=h=>{const u=[];C.forEach(h,(g,T)=>{C.isArray(g)&&g.length>0&&C.forEach(g,I=>{u.push({field:l[T].schema,error:I})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(s).then(m):m(s)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},[["render",bf]]),wf={fields:[{help:"The client id(s) that the plugin uses when it calls authenticated endpoints on the identity provider.",inputType:"password",label:"Config.Client Id",model:"config-client_id",type:"input"},{help:"The client secret.",inputType:"password",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{help:"The discovery endpoint (or just the issuer identifier).",inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{help:"Types of credentials/grants to enable.",inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},Cf={fields:[{help:"The claim that contains the scopes.",inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{help:"The scopes required to be in the access token.",inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{help:"The claim that contains the audience.",inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{help:"The audience required to be in the access token.",inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{help:"The claim that contains the roles.",inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{help:"The roles required to be in the access token.",inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{help:"The claim that contains the groups.",inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"},{help:"The groups required to be in the access token.",inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"},{help:"The claim that contains authenticated groups.",inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"}]},kf={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"}]},tw="",nw="",Ef={name:"OIDCForm",components:{VueFormGenerator:be},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(){this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(n=>!n.model.startsWith("config")&&n.model!=="tags")},this.commonFieldsSchema={...wf},this.authFieldsSchema={...Cf},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(n=>n.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(l=>l.model===n.model).length&&!this.authFieldsSchema.fields.filter(l=>l.model===n.model).length||n.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(n=>{const l=kf.fields.find(s=>s.model===n.model);return l||n}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(n=>n.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}])},getAuthMethodsValue(n,l){const s=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&s.push(this.authMethods[m].value);return this.sessionManagement&&n&&s.push("session"),l&&(n?s.push(n):s.push("session")),s},handleUpdate(n,l){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(l,n),this.onModelUpdated()}}},Ht=n=>(r.pushScopeId("data-v-b4cf6533"),n=n(),r.popScopeId(),n),vf={class:"general-settings"},Sf={class:"link-wrapper"},Tf=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Bf=Ht(()=>r.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),If={class:"auth-method-container"},Mf={class:"general-settings"},Af={class:"link-wrapper"},Nf=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Ff=Ht(()=>r.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),$f={class:"general-settings"},Vf={class:"link-wrapper"},Of=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Df=Ht(()=>r.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function Lf(n,l,s,m,h,u){const b=r.resolveComponent("VueFormGenerator"),g=r.resolveComponent("KExternalLink"),T=r.resolveComponent("KLabel"),I=r.resolveComponent("KCheckbox"),O=r.resolveComponent("KInputSwitch"),j=r.resolveComponent("KTabs");return r.openBlock(),r.createElementBlock("div",null,[s.formModel.id&&s.isEditing||!s.isEditing?(r.openBlock(),r.createBlock(b,{key:0,class:"global-fields",model:s.formModel,options:s.formOptions,schema:h.globalFields,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(j,{tabs:h.tabs},{common:r.withCtx(()=>[r.createElementVNode("div",vf,[r.createElementVNode("div",Sf,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:r.withCtx(()=>[Tf]),_:1})]),Bf,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.commonFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(T,null,{default:r.withCtx(()=>[r.createTextVNode("Auth Methods")]),_:1}),r.createElementVNode("div",If,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.authMethods,J=>(r.openBlock(),r.createElementBlock("div",{key:J.value,class:"auth-method"},[r.createVNode(I,{modelValue:J.prop,"onUpdate:modelValue":we=>J.prop=we,onChange:we=>u.handleUpdate(we,J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),r.createVNode(O,{modelValue:h.sessionManagement,"onUpdate:modelValue":l[0]||(l[0]=J=>h.sessionManagement=J),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:r.withCtx(()=>[r.createElementVNode("div",Mf,[r.createElementVNode("div",Af,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:r.withCtx(()=>[Nf]),_:1})]),Ff,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.authFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),advanced:r.withCtx(()=>[r.createElementVNode("div",$f,[r.createElementVNode("div",Vf,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:r.withCtx(()=>[Of]),_:1})]),Df,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.advancedFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const xf=P(Ef,[["render",Lf],["__scopeId","data-v-b4cf6533"]]),Lo={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"}}},Uf=r.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(n){const l=n,{t:s,te:m}=to.createI18n("en-us",Lo),h=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),u=r.computed(()=>{const b=l.formSchema;return b.fields.map(g=>{const T=`post-function.${g.model}`;return g.hint=m(`${T}.hint`)&&s(`${T}.hint`)||g.hint,g.help=m(`${T}.help`)&&s(`${T}.help`)||g.help,g.newElementButtonLabel=m(`${T}.newElementButtonLabel`)&&s(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="w-100",g.fieldItemsClasses="w-100 mt-2 mb-2",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)}}),Rf=r.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(n){const l=n,{t:s,te:m}=to.createI18n("en-us",Lo),h=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),u=r.computed(()=>{const b=l.formSchema;return b.fields.map(g=>{const T=`exit-transformer.${g.model}`;return g.hint=m(`${T}.hint`)&&s(`${T}.hint`)||g.hint,g.help=m(`${T}.help`)&&s(`${T}.help`)||g.help,g.newElementButtonLabel=m(`${T}.newElementButtonLabel`)&&s(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="w-100",g.fieldItemsClasses="w-100 mt-2 mb-2",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)}}),Pf={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}]},xo={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}]},Uo={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}]},$t=n=>(r.pushScopeId("data-v-bc6f1e04"),n=n(),r.popScopeId(),n),qf={class:"general-settings"},zf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),Hf=$t(()=>r.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Wf=$t(()=>r.createElementVNode("hr",null,null,-1)),Kf={class:"sub-form"},Yf={class:"general-settings"},Gf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Zf=$t(()=>r.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Jf={class:"sub-form"},Xf={class:"general-settings"},Qf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),jf=$t(()=>r.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),eh=r.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(n){const l=n,s=r.ref("zeroSsl"),m=r.ref("shm"),h=r.computed(()=>({fields:l.formSchema.fields.filter(H=>!H.model.startsWith("config")&&H.model!=="tags")})),u=r.computed(()=>({fields:Pf.fields.filter(Y=>!xo.fields.some(ce=>ce.model===Y.model)&&!Uo.fields.some(ce=>ce.model===Y.model))})),b=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage")&&!Y.model.startsWith("config-storage_config-consul")&&!Y.model.startsWith("config-storage_config-redis")&&!Y.model.startsWith("config-storage_config-shm")&&!Y.model.startsWith("config-storage_config-vault"))})),g=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-consul"))})),T=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-redis"))})),I=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-shm"))})),O=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-vault"))})),j=r.computed(()=>({fields:l.formSchema.fields.filter(H=>H.model.startsWith("config")&&!u.value.fields.filter(Y=>Y.model===H.model).length&&!b.value.fields.filter(Y=>Y.model===H.model).length||H.model==="tags")})),J=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),we=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],et=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];r.onMounted(()=>{s.value==="zeroSsl"&&(l.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const st=H=>{s.value=H.value,(H.value==="zeroSsl"||H.value==="other")&&(H.value==="zeroSsl"?l.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":l.formModel["config-api_uri"]="https://acme.example.com/",l.formModel["config-tos_accepted"]=!1),H.value==="letsEncrypt"&&(l.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",l.formModel["config-eab_hmac_key"]="",l.formModel["config-eab_kid"]=""),l.onModelUpdated()},fe=(H,Y)=>{Y==="config-storage"&&(m.value=H),l.onModelUpdated()};return(H,Y)=>{const ce=r.resolveComponent("KSelect"),Te=r.resolveComponent("KTabs");return r.openBlock(),r.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(r.openBlock(),r.createBlock(be,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:h.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(Te,{tabs:we},{general:r.withCtx(()=>[r.createElementVNode("div",qf,[zf,Hf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),Wf,r.createVNode(ce,{appearance:"select",class:"issuer-select",items:et,label:"Issuer",onChange:st}),r.createElementVNode("div",Kf,[s.value==="letsEncrypt"?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:r.unref(xo),onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),s.value==="zeroSsl"||s.value==="other"?(r.openBlock(),r.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:r.unref(Uo),onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])])]),storage:r.withCtx(()=>[r.createElementVNode("div",Yf,[Gf,Zf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:fe},null,8,["model","options","schema"])):r.createCommentVNode("",!0),r.createElementVNode("div",Jf,[m.value==="consul"?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="redis"?(r.openBlock(),r.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="shm"?(r.openBlock(),r.createBlock(be,{key:2,model:n.formModel,options:n.formOptions,schema:I.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="vault"?(r.openBlock(),r.createBlock(be,{key:3,model:n.formModel,options:n.formOptions,schema:O.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])])]),advanced:r.withCtx(()=>[r.createElementVNode("div",Xf,[Qf,jf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:j.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),_:1})])}}}),rw="",th=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(eh,[["__scopeId","data-v-bc6f1e04"]]),ExitTransformer:Rf,OIDCForm:xf,PostFunction:Uf},Symbol.toStringTag,{value:"Module"})),nh=["array","metric","advanced","selectionGroup","object-advanced"],ih={install:n=>{n.component("VueFormGenerator",be)}},rh=(n,l=!1)=>({...l&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=bt,ve.VueFormGenerator=be,ve.abstractField=Ia,ve.customFields=nh,ve.default=ih,ve.getSharedFormName=rh,ve.sharedForms=th,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
|
+
}`;var U=pa(function(){return G(c,A+"return "+S).apply(s,f)});if(U.source=S,Hr(U))throw U;return U}function l1(e){return Z(e).toLowerCase()}function a1(e){return Z(e).toUpperCase()}function d1(e,t,i){if(e=Z(e),e&&(i||t===s))return vs(e);if(!e||!(t=$e(t)))return e;var o=Je(e),a=Je(t),c=Ss(o,a),f=Ts(o,a)+1;return Mt(o,c,f).join("")}function c1(e,t,i){if(e=Z(e),e&&(i||t===s))return e.slice(0,Is(e)+1);if(!e||!(t=$e(t)))return e;var o=Je(e),a=Ts(o,Je(t))+1;return Mt(o,0,a).join("")}function u1(e,t,i){if(e=Z(e),e&&(i||t===s))return e.replace(Hi,"");if(!e||!(t=$e(t)))return e;var o=Je(e),a=Ss(o,Je(t));return Mt(o,a).join("")}function f1(e,t){var i=oh,o=sh;if(re(t)){var a="separator"in t?t.separator:a;i="length"in t?x(t.length):i,o="omission"in t?$e(t.omission):o}e=Z(e);var c=e.length;if(Zt(e)){var f=Je(e);c=f.length}if(i>=c)return e;var p=i-Jt(o);if(p<1)return o;var y=f?Mt(f,0,p).join(""):e.slice(0,p);if(a===s)return y+o;if(f&&(p+=y.length-p),Wr(a)){if(e.slice(p).search(a)){var E,v=y;for(a.global||(a=lr(a.source,Z(Ko.exec(a))+"g")),a.lastIndex=0;E=a.exec(v);)var S=E.index;y=y.slice(0,S===s?p:S)}}else if(e.indexOf($e(a),p)!=p){var B=y.lastIndexOf(a);B>-1&&(y=y.slice(0,B))}return y+o}function h1(e){return e=Z(e),e&&vh.test(e)?e.replace(zo,qm):e}var m1=rn(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),Gr=gl("toUpperCase");function ma(e,t,i){return e=Z(e),t=i?s:t,t===s?Lm(e)?Wm(e):Im(e):e.match(t)||[]}var pa=R(function(e,t){try{return Ne(e,s,t)}catch(i){return Hr(i)?i:new D(i)}}),p1=ft(function(e,t){return Re(t,function(i){i=ot(i),ct(e,i,qr(e[i],e))}),e});function g1(e){var t=e==null?0:e.length,i=N();return e=t?ne(e,function(o){if(typeof o[1]!="function")throw new Pe(b);return[i(o[0]),o[1]]}):[],R(function(o){for(var a=-1;++a<t;){var c=e[a];if(Ne(c[0],this,o))return Ne(c[1],this,o)}})}function _1(e){return qp(ze(e,j))}function Zr(e){return function(){return e}}function y1(e,t){return e==null||e!==e?t:e}var b1=yl(),w1=yl(!0);function Ae(e){return e}function Jr(e){return Gs(typeof e=="function"?e:ze(e,j))}function C1(e){return Js(ze(e,j))}function k1(e,t){return Xs(e,ze(t,j))}var E1=R(function(e,t){return function(i){return Tn(i,e,t)}}),v1=R(function(e,t){return function(i){return Tn(e,i,t)}});function Xr(e,t,i){var o=ue(t),a=ui(t,o);i==null&&!(re(t)&&(a.length||!o.length))&&(i=t,t=e,e=this,a=ui(t,ue(t)));var c=!(re(i)&&"chain"in i)||!!i.chain,f=mt(e);return Re(a,function(p){var y=t[p];e[p]=y,f&&(e.prototype[p]=function(){var E=this.__chain__;if(c||E){var v=e(this.__wrapped__),S=v.__actions__=Be(this.__actions__);return S.push({func:y,args:arguments,thisArg:e}),v.__chain__=E,v}return y.apply(e,Et([this.value()],arguments))})}),e}function S1(){return me._===this&&(me._=Xm),this}function Qr(){}function T1(e){return e=x(e),R(function(t){return Qs(t,e)})}var B1=Mr(ne),I1=Mr(bs),M1=Mr(er);function ga(e){return Dr(e)?tr(ot(e)):og(e)}function A1(e){return function(t){return e==null?s:Rt(e,t)}}var N1=wl(),F1=wl(!0);function jr(){return[]}function eo(){return!1}function $1(){return{}}function V1(){return""}function O1(){return!0}function D1(e,t){if(e=x(e),e<1||e>Ct)return[];var i=nt,o=_e(e,nt);t=N(t),e-=nt;for(var a=rr(o,t);++i<e;)t(i);return a}function L1(e){return L(e)?ne(e,ot):Ve(e)?[e]:Be(Dl(Z(e)))}function x1(e){var t=++Zm;return Z(e)+t}var U1=_i(function(e,t){return e+t},0),R1=Ar("ceil"),P1=_i(function(e,t){return e/t},1),q1=Ar("floor");function z1(e){return e&&e.length?ci(e,Ae,pr):s}function H1(e,t){return e&&e.length?ci(e,N(t,2),pr):s}function W1(e){return ks(e,Ae)}function K1(e,t){return ks(e,N(t,2))}function Y1(e){return e&&e.length?ci(e,Ae,br):s}function G1(e,t){return e&&e.length?ci(e,N(t,2),br):s}var Z1=_i(function(e,t){return e*t},1),J1=Ar("round"),X1=_i(function(e,t){return e-t},0);function Q1(e){return e&&e.length?ir(e,Ae):0}function j1(e,t){return e&&e.length?ir(e,N(t,2)):0}return d.after=Cy,d.ary=Yl,d.assign=a0,d.assignIn=la,d.assignInWith=Ai,d.assignWith=d0,d.at=c0,d.before=Gl,d.bind=qr,d.bindAll=p1,d.bindKey=Zl,d.castArray=$y,d.chain=Hl,d.chunk=qg,d.compact=zg,d.concat=Hg,d.cond=g1,d.conforms=_1,d.constant=Zr,d.countBy=Q_,d.create=u0,d.curry=Jl,d.curryRight=Xl,d.debounce=Ql,d.defaults=f0,d.defaultsDeep=h0,d.defer=ky,d.delay=Ey,d.difference=Wg,d.differenceBy=Kg,d.differenceWith=Yg,d.drop=Gg,d.dropRight=Zg,d.dropRightWhile=Jg,d.dropWhile=Xg,d.fill=Qg,d.filter=ey,d.flatMap=iy,d.flatMapDeep=ry,d.flatMapDepth=oy,d.flatten=Rl,d.flattenDeep=jg,d.flattenDepth=e_,d.flip=vy,d.flow=b1,d.flowRight=w1,d.fromPairs=t_,d.functions=w0,d.functionsIn=C0,d.groupBy=sy,d.initial=i_,d.intersection=r_,d.intersectionBy=o_,d.intersectionWith=s_,d.invert=E0,d.invertBy=v0,d.invokeMap=ay,d.iteratee=Jr,d.keyBy=dy,d.keys=ue,d.keysIn=Me,d.map=vi,d.mapKeys=T0,d.mapValues=B0,d.matches=C1,d.matchesProperty=k1,d.memoize=Ti,d.merge=I0,d.mergeWith=aa,d.method=E1,d.methodOf=v1,d.mixin=Xr,d.negate=Bi,d.nthArg=T1,d.omit=M0,d.omitBy=A0,d.once=Sy,d.orderBy=cy,d.over=B1,d.overArgs=Ty,d.overEvery=I1,d.overSome=M1,d.partial=zr,d.partialRight=jl,d.partition=uy,d.pick=N0,d.pickBy=da,d.property=ga,d.propertyOf=A1,d.pull=c_,d.pullAll=ql,d.pullAllBy=u_,d.pullAllWith=f_,d.pullAt=h_,d.range=N1,d.rangeRight=F1,d.rearg=By,d.reject=my,d.remove=m_,d.rest=Iy,d.reverse=Rr,d.sampleSize=gy,d.set=$0,d.setWith=V0,d.shuffle=_y,d.slice=p_,d.sortBy=wy,d.sortedUniq=k_,d.sortedUniqBy=E_,d.split=i1,d.spread=My,d.tail=v_,d.take=S_,d.takeRight=T_,d.takeRightWhile=B_,d.takeWhile=I_,d.tap=z_,d.throttle=Ay,d.thru=Ei,d.toArray=ra,d.toPairs=ca,d.toPairsIn=ua,d.toPath=L1,d.toPlainObject=sa,d.transform=O0,d.unary=Ny,d.union=M_,d.unionBy=A_,d.unionWith=N_,d.uniq=F_,d.uniqBy=$_,d.uniqWith=V_,d.unset=D0,d.unzip=Pr,d.unzipWith=zl,d.update=L0,d.updateWith=x0,d.values=ln,d.valuesIn=U0,d.without=O_,d.words=ma,d.wrap=Fy,d.xor=D_,d.xorBy=L_,d.xorWith=x_,d.zip=U_,d.zipObject=R_,d.zipObjectDeep=P_,d.zipWith=q_,d.entries=ca,d.entriesIn=ua,d.extend=la,d.extendWith=Ai,Xr(d,d),d.add=U1,d.attempt=pa,d.camelCase=z0,d.capitalize=fa,d.ceil=R1,d.clamp=R0,d.clone=Vy,d.cloneDeep=Dy,d.cloneDeepWith=Ly,d.cloneWith=Oy,d.conformsTo=xy,d.deburr=ha,d.defaultTo=y1,d.divide=P1,d.endsWith=H0,d.eq=Qe,d.escape=W0,d.escapeRegExp=K0,d.every=j_,d.find=ty,d.findIndex=xl,d.findKey=m0,d.findLast=ny,d.findLastIndex=Ul,d.findLastKey=p0,d.floor=q1,d.forEach=Wl,d.forEachRight=Kl,d.forIn=g0,d.forInRight=_0,d.forOwn=y0,d.forOwnRight=b0,d.get=Kr,d.gt=Uy,d.gte=Ry,d.has=k0,d.hasIn=Yr,d.head=Pl,d.identity=Ae,d.includes=ly,d.indexOf=n_,d.inRange=P0,d.invoke=S0,d.isArguments=zt,d.isArray=L,d.isArrayBuffer=Py,d.isArrayLike=Ie,d.isArrayLikeObject=se,d.isBoolean=qy,d.isBuffer=At,d.isDate=zy,d.isElement=Hy,d.isEmpty=Wy,d.isEqual=Ky,d.isEqualWith=Yy,d.isError=Hr,d.isFinite=Gy,d.isFunction=mt,d.isInteger=ea,d.isLength=Ii,d.isMap=ta,d.isMatch=Zy,d.isMatchWith=Jy,d.isNaN=Xy,d.isNative=Qy,d.isNil=e0,d.isNull=jy,d.isNumber=na,d.isObject=re,d.isObjectLike=oe,d.isPlainObject=Fn,d.isRegExp=Wr,d.isSafeInteger=t0,d.isSet=ia,d.isString=Mi,d.isSymbol=Ve,d.isTypedArray=sn,d.isUndefined=n0,d.isWeakMap=i0,d.isWeakSet=r0,d.join=l_,d.kebabCase=Y0,d.last=We,d.lastIndexOf=a_,d.lowerCase=G0,d.lowerFirst=Z0,d.lt=o0,d.lte=s0,d.max=z1,d.maxBy=H1,d.mean=W1,d.meanBy=K1,d.min=Y1,d.minBy=G1,d.stubArray=jr,d.stubFalse=eo,d.stubObject=$1,d.stubString=V1,d.stubTrue=O1,d.multiply=Z1,d.nth=d_,d.noConflict=S1,d.noop=Qr,d.now=Si,d.pad=J0,d.padEnd=X0,d.padStart=Q0,d.parseInt=j0,d.random=q0,d.reduce=fy,d.reduceRight=hy,d.repeat=e1,d.replace=t1,d.result=F0,d.round=J1,d.runInContext=_,d.sample=py,d.size=yy,d.snakeCase=n1,d.some=by,d.sortedIndex=g_,d.sortedIndexBy=__,d.sortedIndexOf=y_,d.sortedLastIndex=b_,d.sortedLastIndexBy=w_,d.sortedLastIndexOf=C_,d.startCase=r1,d.startsWith=o1,d.subtract=X1,d.sum=Q1,d.sumBy=j1,d.template=s1,d.times=D1,d.toFinite=pt,d.toInteger=x,d.toLength=oa,d.toLower=l1,d.toNumber=Ke,d.toSafeInteger=l0,d.toString=Z,d.toUpper=a1,d.trim=d1,d.trimEnd=c1,d.trimStart=u1,d.truncate=f1,d.unescape=h1,d.uniqueId=x1,d.upperCase=m1,d.upperFirst=Gr,d.each=Wl,d.eachRight=Kl,d.first=Pl,Xr(d,function(){var e={};return it(d,function(t,i){X.call(d.prototype,i)||(e[i]=t)}),e}(),{chain:!1}),d.VERSION=m,Re(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),Re(["drop","take"],function(e,t){z.prototype[e]=function(i){i=i===s?1:de(x(i),0);var o=this.__filtered__&&!t?new z(this):this.clone();return o.__filtered__?o.__takeCount__=_e(i,o.__takeCount__):o.__views__.push({size:_e(i,nt),type:e+(o.__dir__<0?"Right":"")}),o},z.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),Re(["filter","map","takeWhile"],function(e,t){var i=t+1,o=i==Ro||i==ch;z.prototype[e]=function(a){var c=this.clone();return c.__iteratees__.push({iteratee:N(a,3),type:i}),c.__filtered__=c.__filtered__||o,c}}),Re(["head","last"],function(e,t){var i="take"+(t?"Right":"");z.prototype[e]=function(){return this[i](1).value()[0]}}),Re(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");z.prototype[e]=function(){return this.__filtered__?new z(this):this[i](1)}}),z.prototype.compact=function(){return this.filter(Ae)},z.prototype.find=function(e){return this.filter(e).head()},z.prototype.findLast=function(e){return this.reverse().find(e)},z.prototype.invokeMap=R(function(e,t){return typeof e=="function"?new z(this):this.map(function(i){return Tn(i,e,t)})}),z.prototype.reject=function(e){return this.filter(Bi(N(e)))},z.prototype.slice=function(e,t){e=x(e);var i=this;return i.__filtered__&&(e>0||t<0)?new z(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==s&&(t=x(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},z.prototype.toArray=function(){return this.take(nt)},it(z.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);a&&(d.prototype[t]=function(){var f=this.__wrapped__,p=o?[1]:arguments,y=f instanceof z,E=p[0],v=y||L(f),S=function(q){var W=a.apply(d,Et([q],p));return o&&B?W[0]:W};v&&i&&typeof E=="function"&&E.length!=1&&(y=v=!1);var B=this.__chain__,A=!!this.__actions__.length,F=c&&!B,U=y&&!A;if(!c&&v){f=U?f:new z(this);var V=e.apply(f,p);return V.__actions__.push({func:Ei,args:[S],thisArg:s}),new qe(V,B)}return F&&U?e.apply(this,p):(V=this.thru(S),F?o?V.value()[0]:V.value():V)})}),Re(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var a=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(L(c)?c:[],a)}return this[i](function(f){return t.apply(L(f)?f:[],a)})}}),it(z.prototype,function(e,t){var i=d[t];if(i){var o=i.name+"";X.call(en,o)||(en[o]=[]),en[o].push({name:t,func:i})}}),en[gi(s,H).name]=[{name:"wrapper",func:s}],z.prototype.clone=hp,z.prototype.reverse=mp,z.prototype.value=pp,d.prototype.at=H_,d.prototype.chain=W_,d.prototype.commit=K_,d.prototype.next=Y_,d.prototype.plant=Z_,d.prototype.reverse=J_,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=X_,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=G_),d},Xt=Km();Ot?((Ot.exports=Xt)._=Xt,Ji._=Xt):me._=Xt}).call(an)}($n,$n.exports);var C=$n.exports;const no={methods:{getFieldRowClasses(n){const l=this.fieldErrors(n).length>0,s={[C.get(this.options,"validationErrorClass","error")]:l,[C.get(this.options,"validationSuccessClass","valid")]:!l,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>s[m]=!0):C.isString(n.styleClasses)&&(s[n.styleClasses]=!0),C.isNil(n.type)||(s["field-"+n.type]=!0),s},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},io=(n,l="")=>typeof n.id<"u"?l+n.id:l+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),ro=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",yt="\\d\\d",ya="\\d{3}",ba="\\d{4}",dn="[^\\s]+",so=/\[([^]*?)\]/gm;function lo(n,l){for(var s=[],m=0,h=n.length;m<h;m++)s.push(n[m].substr(0,l));return s}var ao=function(n){return function(l,s){var m=s[n].map(function(u){return u.toLowerCase()}),h=m.indexOf(l.toLowerCase());return h>-1?h:null}};function Nt(n){for(var l=[],s=1;s<arguments.length;s++)l[s-1]=arguments[s];for(var m=0,h=l;m<h.length;m++){var u=h[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],wa=lo(uo,3),Ca=lo(co,3),fo={dayNamesShort:Ca,dayNames:co,monthNamesShort:wa,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},Vn=Nt({},fo),ka=function(n){return Vn=Nt(Vn,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Se=function(n,l){for(l===void 0&&(l=2),n=String(n);n.length<l;)n="0"+n;return n},Ea={D:function(n){return String(n.getDate())},DD:function(n){return Se(n.getDate())},Do:function(n,l){return l.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Se(n.getDay())},ddd:function(n,l){return l.dayNamesShort[n.getDay()]},dddd:function(n,l){return l.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Se(n.getMonth()+1)},MMM:function(n,l){return l.monthNamesShort[n.getMonth()]},MMMM:function(n,l){return l.monthNames[n.getMonth()]},YY:function(n){return Se(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Se(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Se(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Se(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Se(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Se(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Se(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Se(n.getMilliseconds(),3)},a:function(n,l){return n.getHours()<12?l.amPm[0]:l.amPm[1]},A:function(n,l){return n.getHours()<12?l.amPm[0].toUpperCase():l.amPm[1].toUpperCase()},ZZ:function(n){var l=n.getTimezoneOffset();return(l>0?"-":"+")+Se(Math.floor(Math.abs(l)/60)*100+Math.abs(l)%60,4)},Z:function(n){var l=n.getTimezoneOffset();return(l>0?"-":"+")+Se(Math.floor(Math.abs(l)/60),2)+":"+Se(Math.abs(l)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],_o=["isPm",dn,function(n,l){var s=n.toLowerCase();return s===l.amPm[0]?0:s===l.amPm[1]?1:null}],yo=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var l=(n+"").match(/([+-]|\d\d)/gi);if(l){var s=+l[1]*60+parseInt(l[2],10);return l[0]==="+"?s:-s}return 0}],va={D:["day",_t],DD:["day",yt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",yt,mo],YY:["year",yt,function(n){var l=new Date,s=+(""+l.getFullYear()).substr(0,2);return+(""+(+n>68?s-1:s)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",yt,void 0,"isPm"],H:["hour",_t],HH:["hour",yt],m:["minute",_t],mm:["minute",yt],s:["second",_t],ss:["second",yt],YYYY:["year",ba],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",yt,function(n){return+n*10}],SSS:["millisecond",ya],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,ao("monthNamesShort")],MMMM:["month",dn,ao("monthNames")],a:_o,A:_o,ZZ:yo,Z:yo},On={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"},Sa=function(n){return Nt(On,n)},Ta=function(n,l,s){if(l===void 0&&(l=On.default),s===void 0&&(s={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");l=On[l]||l;var m=[];l=l.replace(so,function(u,b){return m.push(b),"@@@"});var h=Nt(Nt({},Vn),s);return l=l.replace(oo,function(u){return Ea[u](n,h)}),l.replace(/@@@/g,function(){return m.shift()})};function Ba(n,l,s){if(s===void 0&&(s={}),typeof l!="string")throw new Error("Invalid format in fecha parse");if(l=On[l]||l,n.length>1e3)return null;var m=new Date,h={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=l.replace(so,function(Te,he){return b.push(ho(he)),"@@@"}),T={},I={};g=ho(g).replace(oo,function(Te){var he=va[Te],tt=he[0],Ye=he[1],wt=he[3];if(T[tt])throw new Error("Invalid format. "+tt+" specified twice in format");return T[tt]=!0,wt&&(I[wt]=!0),u.push(he),"("+Ye+")"}),Object.keys(I).forEach(function(Te){if(!T[Te])throw new Error("Invalid format. "+Te+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var O=n.match(new RegExp(g,"i"));if(!O)return null;for(var j=Nt(Nt({},Vn),s),J=1;J<O.length;J++){var we=u[J-1],et=we[0],st=we[2],fe=st?st(O[J],j):+O[J];if(fe==null)return null;h[et]=fe}h.isPm===1&&h.hour!=null&&+h.hour!=12?h.hour=+h.hour+12:h.isPm===0&&+h.hour==12&&(h.hour=0);var H;if(h.timezoneOffset==null){H=new Date(h.year,h.month,h.day,h.hour,h.minute,h.second,h.millisecond);for(var Y=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=0,ce=Y.length;J<ce;J++)if(T[Y[J][0]]&&h[Y[J][0]]!==H[Y[J][1]]())return null}else if(H=new Date(Date.UTC(h.year,h.month,h.day,h.hour,h.minute-h.timezoneOffset,h.second,h.millisecond)),h.month>11||h.month<0||h.day>31||h.day<1||h.hour>23||h.hour<0||h.minute>59||h.minute<0||h.second>59||h.second<0)return null;return H}var Le={format:Ta,parse:Ba,defaultI18n:fo,setGlobalDateI18n:ka,setGlobalDateMasks:Sa};const ge={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 xe(n,l,s=ge){return C.isNil(n)||n===""?l?[ie(s.fieldIsRequired)]:[]:null}function ie(n,...l){if(n!=null&&l.length>0)for(let s=0;s<l.length;s++)n=n.replace("{"+(s-1)+"}",l[s]);return n}const cn={resources:ge,required(n,l,s,m=ge){return xe(n,l.required,m)},number(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=[];return C.isFinite(n)?(!C.isNil(l.min)&&n<l.min&&u.push(ie(m.numberTooSmall,l.min)),!C.isNil(l.max)&&n>l.max&&u.push(ie(m.numberTooBig,l.max))):u.push(ie(m.invalidNumber)),u},integer(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=cn.number(n,l,s,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=[];return C.isString(n)?(!C.isNil(l.min)&&n.length<l.min&&u.push(ie(m.textTooSmall,n.length,l.min)),!C.isNil(l.max)&&n.length>l.max&&u.push(ie(m.textTooBig,n.length,l.max))):u.push(ie(m.thisNotText)),u},array(n,l,s,m=ge){if(l.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(l.min)&&n.length<l.min)return[ie(m.selectMinItems,l.min)];if(!C.isNil(l.max)&&n.length>l.max)return[ie(m.selectMaxItems,l.max)]}},date(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(l.min)){const g=new Date(l.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,Le.format(u),Le.format(g)))}if(!C.isNil(l.max)){const g=new Date(l.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,Le.format(u),Le.format(g)))}return b},regexp(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!C.isNil(l.pattern)&&!new RegExp(l.pattern).test(n))return[ie(m.invalidFormat)]},email(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;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(n))return[ie(m.invalidEmail)]},url(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;const u=/^(?: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})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,T,I,O;for(let j=b.length-1;j>=0;j--)T=b.substring(j,j+1),I=parseInt(T,10),O?(I*=2,I>=10?g+=I%10+1:g+=I):g+=I,O=!O;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,l,s,m=ge){const h=xe(n,l.required,m);if(h!=null)return h;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const l=cn[n];C.isFunction(l)&&(l.locale=s=>(m,h,u)=>l(m,h,u,C.defaults(s,ge)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ni(n,l,s){let m=C.get(s.context,"schema.attributes",{});const h=l.value||"input";C.isString(h)&&(m=C.get(m,h)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const K={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ni,updated:Ni,componentUpdated:Ni}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const l=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,l):this.updateModelValue(n,l)}}},methods:{validate(n){this.clearValidationErrors();const l=C.get(this.formOptions,"validateAsync",!1);let s=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const h=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{h.push(bo(u).bind(this))}):h.push(bo(this.schema.validator).bind(this)),C.forEach(h,u=>{if(l)s.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const T=this.errors.length===0;this.$emit("validated",T,this.errors,this)}):b&&(s=s.concat(b))}})}const m=h=>{let u=[];C.forEach(C.uniq(h),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return l?Promise.all(s).then(m):m(s)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,l){let s=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),s=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),s=!0),s&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,l,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,l){let s=n.replace(/\[(\w+)\]/g,".$1");s=s.replace(/^\./,"");let m=this.model;const h=s.split(".");let u=0;const b=h.length;for(;u<b;){const g=h[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=l;return}++u}},getFieldID(n,l=!1){const s=C.get(this.formOptions,"fieldIdPrefix","");return io(n,s)+(l?"-"+C.uniqueId():"")},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Ia=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),Ma={mixins:[K]},Aa=["id","autocomplete","disabled","name","required"];function Na(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:r.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Aa)),[[r.vModelCheckbox,n.value],[b,"input"]])}const eb="",P=(n,l)=>{const s=n.__vccOpts||n;for(const[m,h]of l)s[m]=h;return s},Fa=P(Ma,[["render",Na]]),$a={class:"wrapper"},Va=["disabled"],Oa=["id","checked","disabled","onChange","name"],Da=["disabled"],La={class:"info"},xa=r.createElementVNode("div",{class:"arrow"},null,-1),Ua={class:"dropList"},Ra=["id","checked","disabled","onChange","name"];function Pa(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",$a,[n.schema.listBox?(r.openBlock(),r.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Oa),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Va)):r.createCommentVNode("",!0),n.schema.listBox?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[r.createElementVNode("div",{class:r.normalizeClass(["mainRow",{expanded:h.comboExpanded}]),onClick:l[0]||(l[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[r.createElementVNode("div",La,r.toDisplayString(u.selectedCount)+" selected",1),xa],2),r.createElementVNode("div",Ua,[h.comboExpanded?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Ra),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)])],2))),256)):r.createCommentVNode("",!0)])],8,Da))])),[[b,"wrapper"]])}const tb="",qa=P({mixins:[K],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?ro(this.schema.inputName+"_"+this.getItemValue(n)):ro(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.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 n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,l){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const s=C.clone(this.value);s.push(this.getItemValue(l)),this.value=s}else{const s=C.clone(this.value);s.splice(this.value.indexOf(this.getItemValue(l)),1),this.value=s}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Pa]]),za={class:"wrapper"},Ha=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],Wa={key:0,class:"helper"};function Ka(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",za,[r.withDirectives(r.createElementVNode("input",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:l[0]||(l[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:l[1]||(l[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:l[2]||(l[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,Ha),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(r.openBlock(),r.createElementBlock("span",Wa,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)])),[[b,"wrapper"]])}const ib="",wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[K],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,l)=>{this.formatNumberToModel(n,l)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,l)=>{this.formatDatetimeToModel(n,l)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(l,s)=>{this.debouncedFormatFunc(n,s)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,l){const s=wo[this.schema.inputType.toLowerCase()],m=Le.parse(n,s);m!==!1&&(this.schema.format?n=Le.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,l)},formatDatetimeValueToField(n){if(n==null)return null;const l=wo[this.schema.inputType.toLowerCase()];let s=n;return C.isNumber(n)||(s=Le.parse(n,l)),s!==!1?Le.format(s,l):n},formatNumberToModel(n,l){C.isNumber(n)||(n=NaN),this.updateModelValue(n,l)},onInput(n){let l=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(l=parseFloat(n.target.value));break}this.value=l},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Ka]]),Ya=["id"];function Ga(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("span",{id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[r.createTextVNode(r.toDisplayString(n.value),1)],10,Ya)),[[b,"label"]])}const ob="",Za=P({mixins:[K]},[["render",Ga]]),Ja=["disabled"],Xa=["id","disabled","name","onClick","value","checked","required"];function Qa(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>r.withDirectives((r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(u.getItemCssClasses(g))},[r.withDirectives(r.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:T=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:r.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Xa),[[b,"input"]]),r.createTextVNode(r.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Ja)),[[b,"wrapper"]])}const lb="",ja=P({mixins:[K],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.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 n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const l=C.get(n,"disabled",!1);return C.isFunction(l)?l(this.model):l}}},[["render",Qa]]),ed=["disabled","name","id"],td=["disabled"],nd=["label"],id=["value"],rd=["value"];function od(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("select",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},r.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,td)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,g=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[g.group?(r.openBlock(),r.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(g.ops,T=>(r.openBlock(),r.createElementBlock("option",{value:u.getItemValue(T)},r.toDisplayString(u.getItemName(T)),9,id))),256)):r.createCommentVNode("",!0)],8,nd)):r.createCommentVNode("",!0),g.group?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("option",{key:1,value:u.getItemValue(g)},r.toDisplayString(u.getItemName(g)),9,rd))],64))),256))],10,ed)),[[r.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[K],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const l=[];let s={};return n.forEach(m=>{s=null,m.group&&C.isObject(m)?(s=C.find(l,h=>h.group===m.group),s?s.ops.push({id:m.id,name:m.name}):(s={group:"",ops:[]},s.group=m.group,s.ops.push({id:m.id,name:m.name}),l.push(s))):l.push(m)}),l},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.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 n}}},[["render",od]]),sd=["id","value","name","disabled"];function ld(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:l[0]||(l[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:r.normalizeClass(n.schema.fieldClasses)},null,10,sd)}const cb="",ad=P({mixins:[K],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const l=C.get(this.formOptions,"validateAsync",!1),s=this.vfg.validate(),m=h=>{l&&!C.isEmpty(h)||!l&&!h?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,h,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};s&&C.isFunction(s.then)?s.then(m):m(s)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",ld]]),dd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function cd(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("textarea",{class:r.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":l[0]||(l[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,dd)),[[r.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[K]},[["render",cd]]),ud={class:"wrapper"},fd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function hd(n,l,s,m,h,u){const b=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",ud,[r.withDirectives(r.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:l[0]||(l[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,fd),[[b,"input"]])])),[[b,"wrapper"]])}const hb="",md=P({mixins:[K],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",hd]]),pd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function gd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,pd)}const _d=P({mixins:[K],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(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",gd]]),vo={formatValueToField(n){if(n!=null){const l=this.schema.format?Le.parse(n,this.schema.format):new Date(n);return Le.format(l,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const l=Le.parse(n,this.getDateFormat());this.schema.format?n=Le.format(l,this.schema.format):n=l.valueOf()}return n}},yd={class:"input-group date"},bd=["autocomplete","disabled","placeholder","readonly","name","id"],wd=r.createElementVNode("span",{class:"input-group-addon"},[r.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function Cd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",yd,[r.withDirectives(r.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,bd),[[r.vModelText,n.value]]),wd])}const So="YYYY-MM-DD HH:mm:ss",kd={mixins:[K],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:So})).on("dp.change",()=>{this.value=n.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:So},...vo}},Ed=P(kd,[["render",Cd]]),vd=["autocomplete","disabled","placeholder","readonly","name","id"];function Sd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:l[1]||(l[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,vd)),[[r.vModelText,n.value]])}const Td=P({mixins:[K],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 n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const l={};if(n.address_components!==void 0)for(let s=0;s<n.address_components.length;s++){const m=n.address_components[s].types[0];this.inputs[m]&&(l[m]=n.address_components[s][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,l,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const l={lat:n.coords.latitude,lng:n.coords.longitude},s=new window.google.maps.Circle({center:l,radius:n.coords.accuracy});this.autocomplete.setBounds(s.getBounds())})}}},[["render",Sd]]),Bd={class:"wrapper"},Id=["autocomplete","disabled","placeholder","readonly"],Md=["disabled","name"];function Ad(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",Bd,[r.withDirectives(r.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Id),[[r.vShow,n.schema.hideInput!==!0],[r.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(r.openBlock(),r.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:l[1]||(l[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Md)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"preview",style:r.normalizeStyle(u.previewStyle)},[r.createElementVNode("div",{class:"remove",title:"Remove image",onClick:l[2]||(l[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const _b="",Nd=P({mixins:[K],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(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const l=new FileReader;l.onload=s=>{this.value=s.target.result},n.target.files&&n.target.files.length>0&&l.readAsDataURL(n.target.files[0])}}},[["render",Ad]]),Fd=["autocomplete","disabled","placeholder","readonly","name","id"];function $d(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Fd)),[[r.vModelText,n.value]])}const Vd=P({mixins:[K],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",$d]]),wb="",Od={mixins:[K],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,C.defaults(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(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},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}}},Dd=["disabled"];function Ld(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,Dd)}const xd=P(Od,[["render",Ld]]),Ud=["autocomplete","disabled","placeholder","readonly","name"];function Rd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ud)),[[r.vModelText,n.value]])}const Pd="YYYY-MM-DD",qd={mixins:[K],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",Pd)},...vo,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{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!")})}}},zd=P(qd,[["render",Rd]]),Hd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function Wd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Hd)}const Cb="",Kd=P({mixins:[K],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,l;C.isArray(this.value)?[n,l]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:l})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,l;C.isArray(this.value)?[n,l]=this.value:n=this.value;const s=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:l,onChange(m){s.slider.options.type==="double"?s.value=[m.from,m.to]:s.value=m.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",Wd]]),Yd=["disabled","multiple","title","name"],Gd=["disabled","selected"],Zd=["value"];function Jd(n,l,s,m,h,u){return r.withDirectives((r.openBlock(),r.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(r.openBlock(),r.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Gd)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.items,b=>(r.openBlock(),r.createElementBlock("option",{value:u.getItemValue(b)},r.toDisplayString(u.getItemName(b)),9,Zd))),256))],8,Yd)),[[r.vModelSelect,n.value]])}const Eb="",Xd=P({mixins:[K],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},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(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.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 n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.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 n}}},[["render",Jd]]),Qd=["autocomplete","disabled","placeholder","readonly","name","id"];function jd(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Qd)}const ec=P({mixins:[K],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.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",jd]]),tc=["src"];function nc(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("img",{src:u.mapLink},null,8,tc)}const Tb="",ic=P({mixins:[K],computed:{mapLink(){let n,l,s;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],l=this.value[m.lng],s=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${l}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const h=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of h)typeof m[u]<"u"&&(s+=`&${u}=${m[u]}`)}return s}}},[["render",nc]]),rc=["autocomplete","disabled","name","id"],oc=["data-on","data-off","for"],sc=r.createElementVNode("span",{class:"handle"},null,-1);function lc(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,rc),[[r.vModelCheckbox,n.value]]),r.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,oc),sc])}const Ib="",ac=P({mixins:[K],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",lc]]),dc={mixins:[K],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 n=Object.keys(this.value),l={};for(let s=0;s<n.length;s++){const m=n[s];l[m]=typeof this.value[m]}this.keyTypes=l},methods:{removeElement(n){const l=this.value;delete l[n],this.value=JSON.parse(JSON.stringify(l));const s=this.keyTypes;delete s[n],this.keyTypes=JSON.parse(JSON.stringify(s))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},cc={key:0},uc={key:1},fc=["id"],hc={key:0},mc=["onUpdate:modelValue"],pc={key:1},gc=["onUpdate:modelValue"],_c={key:2},yc=["onUpdate:modelValue"],bc=["onClick"],wc=[r.createElementVNode("option",{value:"string"}," String ",-1),r.createElementVNode("option",{value:"number"}," Number ",-1),r.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function Cc(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator"),g=r.resolveDirective("attributes");return r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[n.schema.schema?(r.openBlock(),r.createElementBlock("div",cc,[r.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(r.openBlock(),r.createElementBlock("div",uc,[r.createElementVNode("table",{id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(T,I)=>(r.openBlock(),r.createElementBlock("tr",{key:I},[r.createElementVNode("td",null,r.toDisplayString(I),1),h.keyTypes[I]==="string"?(r.openBlock(),r.createElementBlock("td",hc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"text"},null,8,mc),[[r.vModelText,n.value[I]]])])):r.createCommentVNode("",!0),h.keyTypes[I]==="boolean"?(r.openBlock(),r.createElementBlock("td",pc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"checkbox"},null,8,gc),[[r.vModelCheckbox,n.value[I]]])])):r.createCommentVNode("",!0),h.keyTypes[I]==="number"?(r.openBlock(),r.createElementBlock("td",_c,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":O=>n.value[I]=O,type:"number"},null,8,yc),[[r.vModelText,n.value[I]]])])):r.createCommentVNode("",!0),r.createElementVNode("td",null,[r.createElementVNode("input",{type:"button",value:"x",onClick:O=>u.removeElement(I)},null,8,bc)])]))),128))],10,fc),r.withDirectives(r.createElementVNode("select",{"onUpdate:modelValue":l[0]||(l[0]=T=>h.newKeyType=T)},wc,512),[[r.vModelSelect,h.newKeyType]]),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[1]||(l[1]=T=>h.newKeyName=T),type:"text"},null,512),[[r.vModelText,h.newKeyName]]),r.createElementVNode("input",{type:"button",value:"Add key",onClick:l[2]||(l[2]=(...T)=>u.addKey&&u.addKey(...T))})]))])),[[g,h.attributes]])}const To=P(dc,[["render",Cc]]),$b="",kc={mixins:[K],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:(n,l)=>({[this.schema.model]:n[l]}),set:(n,l,s)=>n[l]=s[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const l=this.value;delete l[n],this.value={...l}},transformMapModelValuesToObject(n,l,s){const m={};return Object.keys(n).map(h=>{const u=h.indexOf(s+"-");if(u>-1&&Array.isArray(l))if(l.length>0){const g=h.split("-").filter(I=>l.find(O=>O.model===I)),T=h.split(`-${g}`)[0].split(`${s}-`)[1];g.length?m[T]={...m[T],[g]:n[h]}:m[h.substring(u+`${s}-`.length)]=n[h]}else m[h.substring(`${s}-`.length)]=n[h];else{const g=h.split("-").filter(I=>I===this.schema.model),T=h.split(`-${g}`)[0].split(`${s}-`)[1];T&&(m[T]=n[h])}return h}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",l=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=l,this.newKeyName=""},updateModel(n,l){this.$emit("model-updated",this.model[this.schema.model],l)}}},Bo=n=>(r.pushScopeId("data-v-22600a29"),n=n(),r.popScopeId(),n),Ec=["id"],vc=["data-testid"],Sc={class:"item-wrapper"},Tc={class:"index-wrapper"},Bc=Bo(()=>r.createElementVNode("hr",{class:"divider"},null,-1)),Ic={key:0},Mc={key:1},Ac=["onUpdate:modelValue","placeholder","onInput"],Nc={key:0,class:"hint"},Fc=Bo(()=>r.createElementVNode("hr",{class:"wide-divider"},null,-1)),$c={class:"input-item"},Vc=["placeholder"],Oc={key:0,class:"hint"};function Dc(n,l,s,m,h,u){const b=r.resolveComponent("KIcon"),g=r.resolveComponent("KButton"),T=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",{id:n.getFieldID(n.schema),class:r.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(I,O)=>(r.openBlock(),r.createElementBlock("div",{key:O,"data-testid":`field-object-key-${O}`},[r.createElementVNode("div",null,[r.createElementVNode("div",Sc,[r.createElementVNode("div",Tc,[r.createElementVNode("strong",null,r.toDisplayString(O),1),r.createElementVNode("div",null,[r.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:j=>u.removeElement(O)},{default:r.withCtx(()=>[r.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),Bc,u.subSchema?(r.openBlock(),r.createElementBlock("div",Ic,[r.createVNode(T,{model:u.transformedModel[O],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(r.openBlock(),r.createElementBlock("div",Mc,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":j=>n.value[O]=j,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:j=>u.updateModel(n.value[O],n.model[n.schema.model])},null,40,Ac),[[r.vModelText,n.value[O]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(r.openBlock(),r.createElementBlock("p",Nc,r.toDisplayString(n.schema.fields[0].schema.hint),1)):r.createCommentVNode("",!0)])),Fc])])],8,vc))),128)),r.createElementVNode("div",{class:r.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[r.createElementVNode("div",$c,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=I=>h.newKeyName=I),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Vc),[[r.vModelText,h.newKeyName]]),r.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!h.newKeyName,onClick:u.addKey},{default:r.withCtx(()=>[r.createTextVNode(" + Add "+r.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(r.openBlock(),r.createElementBlock("p",Oc,r.toDisplayString(n.schema.hintText),1)):r.createCommentVNode("",!0)],2)],10,Ec)}const Io=P(kc,[["render",Dc],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,l)=>{const s=n.__vccOpts||n;for(const[m,h]of l)s[m]=h;return s},Lc=n=>(r.pushScopeId("data-v-2cc22034"),n=n(),r.popScopeId(),n),xc=["aria-hidden"],Uc={key:0,"data-testid":"kui-icon-svg-title"},Rc=Lc(()=>r.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Pc=Mo(r.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:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const l=String(n).replace(/px/gi,""),s=Number(l);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const l=n,s=r.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const h=String(l.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=r.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:r.normalizeStyle(m.value)},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",{"aria-hidden":n.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"},[n.title?(r.openBlock(),r.createElementBlock("title",Uc,r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),Rc],8,xc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-2cc22034"]]),qc=n=>(r.pushScopeId("data-v-103127a9"),n=n(),r.popScopeId(),n),zc=["aria-hidden"],Hc={key:0,"data-testid":"kui-icon-svg-title"},Wc=qc(()=>r.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)),Ln=Mo(r.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:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const l=String(n).replace(/px/gi,""),s=Number(l);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const l=n,s=r.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const h=String(l.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=r.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:r.normalizeStyle(m.value)},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",{"aria-hidden":n.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"},[n.title?(r.openBlock(),r.createElementBlock("title",Hc,r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),Wc],8,zc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-103127a9"]]),Db="",Lb="",Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,l,s,m,h,u){const b=r.resolveComponent("TrashIcon"),g=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Yc,[r.renderSlot(n.$slots,"default",{},void 0,!0),r.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:l[0]||(l[0]=T=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(b)]),_:1})])}const Ao=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),xb="",Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(r.pushScopeId("data-v-47ff1f9a"),n=n(),r.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>r.createElementVNode("hr",null,null,-1));function jc(n,l,s,m,h,u){const b=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Xc,[r.renderSlot(n.$slots,"default",{},void 0,!0),r.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:l[0]||(l[0]=g=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const No=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),Ub="",eu={name:"FieldMetric",components:{AddIcon:Pc,TrashIcon:Ln},mixins:[K],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,l,s,m,h,u){const b=r.resolveComponent("AddIcon"),g=r.resolveComponent("TrashIcon"),T=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["field-dropdown",{active:h.contentVisible}])},[r.createElementVNode("div",{class:"title",onClick:l[0]||(l[0]=I=>h.contentVisible=!h.contentVisible)},[r.createTextVNode(r.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),r.createVNode(b,{class:"metric-add-icon"})]),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[h.contentVisible?(r.openBlock(),r.createElementBlock("div",tu,[r.renderSlot(n.$slots,"default"),r.createVNode(T,{appearance:"tertiary",class:"metric-remove-button",onClick:l[1]||(l[1]=I=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(g)]),_:1})])):r.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),bt="kong-ui-forms-api",iu="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function ru(n){return n?n.length===36&&new RegExp(`^${iu}$`).test(n):!1}const Rb="",Pb="",Fi=50,Ft={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 ou(n,l,s){return s?Ft.SET_REFERRAL_VALUE:n&&!l||!n&&l?Ft.UPDATE_ENTITY:n&&l?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const su={mixins:[K],inject:[bt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(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 n,l;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[bt]){console.warn("[@kong-ui-public/forms] No API service provided");break}l=(await this[bt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?l[this.schema.entityDataKey]:l),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(s){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",s)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const l=[],s=[],m=this.getInputFields(),h=new Set;ru(n)&&m.includes("id")?s.push((async()=>{const u=await this.fetchExact(n);l.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):s.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{h.has(g.id)||(h.add(g.id),l.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(s),this.items=l,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const l=[];let s=null;if(!this[bt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;l.length<Fi;){const m=await this[bt].getAll(this.entity,{size:Fi,offset:s,...n});if(l.push(...m.data.data),s=m.data.offset,!s)break}return l.slice(0,Fi)},async fetchSuggestions(n,l){return this.fetchUntilLimit({[l]:n})},async fetchExact(n){return this[bt]?(await this[bt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,l;return((l=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:l.fields)||[]},getSuggestionLabel(n){const l=this.getInputFields();return l.length&&n?l.map(s=>n[s]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var s;const l=(s=this.schema)==null?void 0:s.returnKey;return l?n[l]:n.id}}},lu={class:"field-wrap autosuggest"},au=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,l,s,m,h,u){const b=r.resolveComponent("KSelect");return r.openBlock(),r.createElementBlock("div",lu,[r.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:h.idValue,"onUpdate:modelValue":l[0]||(l[0]=g=>h.idValue=g),appearance:"select",autosuggest:"",clearable:"","enable-filtering":"",items:h.items,loading:h.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":r.withCtx(({item:g})=>[r.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},r.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,au),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(T,I)=>(r.openBlock(),r.createElementBlock("span",{key:I,class:"field-span","data-testid":g.id&&`${g.id}-${I+1}`||I+1},r.toDisplayString(T),9,du))),128))]),empty:r.withCtx(()=>[r.createElementVNode("div",cu,[r.createElementVNode("span",null,r.toDisplayString(h.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const $o=P(su,[["render",uu],["__scopeId","data-v-27d6a440"]]),qb="",zb="",fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,l,s,m,h,u){const b=r.resolveComponent("KCard"),g=r.resolveComponent("TrashIcon"),T=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",hu,[r.createVNode(b,{class:"card"},{body:r.withCtx(()=>[r.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),r.createVNode(T,{appearance:"tertiary",class:"array-card-remove-button",onClick:l[0]||(l[0]=I=>n.$emit("remove-item"))},{default:r.withCtx(()=>[r.createVNode(g)]),_:1})])}const Vo=P(fu,[["render",mu],["__scopeId","data-v-d409fd75"]]),Hb="",pu={mixins:[K],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let l=n.target.value.split(",");this.schema.array||(l=l.toString()),this.updateModel(l)}}},gu={class:"selection-group"},_u={class:"form-group"},yu=["id","checked","name","value"];function bu(n,l,s,m,h,u){return r.openBlock(),r.createElementBlock("div",gu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.schema.values,(b,g)=>(r.openBlock(),r.createElementBlock("div",{key:g,class:"option-group"},[r.createElementVNode("div",_u,[r.createElementVNode("label",{class:r.normalizeClass(["k-label",b.name])},[r.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:l[0]||(l[0]=(...T)=>u.onChange&&u.onChange(...T))},null,40,yu),r.createTextVNode(" "+r.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),Wb="",wu={name:"FieldArray",components:{FieldArrayItem:Ao,FieldArrayMultiItem:No,FieldSelect:ko,FieldMetric:Fo,FieldObject:To,FieldObjectAdvanced:Io,FieldAutoSuggest:$o,FieldRadio:Oo,FieldArrayCardContainer:Vo,FieldTextArea:Eo,FieldInput:Co},mixins:[K],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,l,s){var h,u,b;let m;return l&&(m=JSON.parse(JSON.stringify(l)),(b=(u=(h=m.schema)==null?void 0:h.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${s}`,g))),{...m,set(g,T){n[s]=T},get(){return n[s]}}},newElement(){let n=this.value,l;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?l=this.schema.items.default():l=this.schema.items.default),n.push(l),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","type"],vu=["value","onClick"],Su=["onUpdate:modelValue"],Tu=["value","onClick"];function Bu(n,l,s,m,h,u){const b=r.resolveComponent("FieldTextArea"),g=r.resolveComponent("KButton");return n.schema?(r.openBlock(),r.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:r.normalizeClass(n.schema.fieldClasses)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(T,I)=>(r.openBlock(),r.createElementBlock("div",{key:I,class:r.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onRemoveItem:O=>u.removeElement(I)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(r.openBlock(),r.createElementBlock("span",ku,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${I}`,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onRemoveItem:O=>u.removeElement(I)},{default:r.withCtx(()=>{var O,j;return[((O=n.schema.inputAttributes)==null?void 0:O.type)==="textarea"?(r.openBlock(),r.createBlock(b,{key:0,class:"k-input","form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,I),onModelUpdated:u.modelUpdated},null,8,["form-options","model","schema","onModelUpdated"])):r.withDirectives((r.openBlock(),r.createElementBlock("input",r.mergeProps({key:1,"onUpdate:modelValue":J=>n.value[I]=J},n.schema.inputAttributes,{type:((j=n.schema.inputAttributes)==null?void 0:j.type)||"text"}),null,16,Eu)),[[r.vModelDynamic,n.value[I]]]),n.schema.showRemoveButton?(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:J=>u.removeElement(I)}),null,16,vu)):r.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):r.withDirectives((r.openBlock(),r.createElementBlock("input",r.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":O=>n.value[I]=O,type:"text"}),null,16,Su)),[[r.vModelText,n.value[I]]]),n.schema.showRemoveButton?(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:O=>u.removeElement(I)}),null,16,Tu)):r.createCommentVNode("",!0)],2))),128)),r.createVNode(g,{appearance:"tertiary",class:r.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.schema.newElementButtonLabel||s.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):r.createCommentVNode("",!0)}const Iu=P(wu,[["render",Bu],["__scopeId","data-v-1731cb2f"]]),Kb="",Mu={mixins:[K],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(n,l){this.$emit("model-updated",n,l)}}},Au={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Nu={class:"material-icons"};function Fu(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",Au,[r.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:l[0]||(l[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[r.createElementVNode("i",Nu,r.toDisplayString(h.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),r.createElementVNode("span",null,r.toDisplayString(u.titleText),1)]),r.createElementVNode("div",{class:r.normalizeClass(["advanced-field-dropdown",u.openClass])},[r.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const $u=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),Yb="",Gb="",Vu={mixins:[K],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,l){if(l===null){this.fieldModel={...this.model};return}const s=this.schema.fields[n].fields,m=this.schema.fields[l].fields;m&&m.forEach(h=>this.updateModel("",h.model)),s&&s.forEach(h=>this.updateModel(this.fieldModel[h.model],h.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,l)=>{n.fields&&n.fields.forEach(s=>{this.model[s.model]&&(this.checkedGroup=l,this.fieldSchema.push(s.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,l){this.$emit("model-updated",n,l)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],xu={class:"control-help"},Uu={class:"option-field"},Ru={class:"option-field-container"};function Pu(n,l,s,m,h,u){const b=r.resolveComponent("vue-form-generator");return r.openBlock(),r.createElementBlock("div",Ou,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.schema.fields,(g,T)=>(r.openBlock(),r.createElementBlock("div",{key:T,class:"option-group"},[r.createElementVNode("div",Du,[r.createElementVNode("label",{class:r.normalizeClass(["k-label",`${g.label}-check`])},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=I=>h.checkedGroup=I),class:"k-input",type:"radio",value:T},null,8,Lu),[[r.vModelRadio,h.checkedGroup]]),r.createTextVNode(" "+r.toDisplayString(g.label)+" ",1),r.createElementVNode("div",xu,r.toDisplayString(g.description),1)],2)]),r.withDirectives(r.createElementVNode("div",Uu,[r.createElementVNode("div",Ru,[r.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[r.vShow,g.fields&&h.checkedGroup===T]])]))),128))])}const qu=P(Vu,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[K],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,l,s,m,h,u){const b=r.resolveComponent("KMultiselect");return r.openBlock(),r.createBlock(b,{"collapsed-context":"","data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Zb="",Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[K],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var l,s;this.value||(this.value={});const n=((s=this.model)==null?void 0:s[(l=this.schema)==null?void 0:l.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,l,s){this.pairs[l][s]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:l,value:s})=>({...n,...l&&s?{[l]:s}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,l,s,m,h,u){const b=r.resolveComponent("TrashIcon"),g=r.resolveComponent("KButton");return r.openBlock(),r.createElementBlock("div",Yu,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.pairs,(T,I)=>(r.openBlock(),r.createElementBlock("div",{key:I,class:"pair-item"},[r.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${I}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:T.key,onInput:O=>{u.onInput(O,I,"key")}},null,40,Gu),r.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${I}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:T.value,onInput:O=>{u.onInput(O,I,"value")}},null,40,Zu),r.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${I}`,onClick:()=>{u.removePair(I)}},{default:r.withCtx(()=>[r.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),r.createVNode(g,{appearance:"tertiary",class:r.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu=Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:$u,FieldArray:Iu,FieldArrayCardContainer:Vo,FieldArrayItem:Ao,FieldArrayMultiItem:No,FieldAutoSuggest:$o,FieldCheckbox:Fa,FieldChecklist:qa,FieldCleave:_d,FieldDateTimePicker:Ed,FieldGoogleAddress:Td,FieldImage:Nd,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Za,FieldMasked:Vd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:xd,FieldObject:To,FieldObjectAdvanced:Io,FieldPikaday:zd,FieldRadio:Oo,FieldRadios:ja,FieldRangeSlider:Kd,FieldSelect:ko,FieldSelectEx:Xd,FieldSelectionGroup:qu,FieldSpectrum:ec,FieldStaticMap:ic,FieldSubmit:ad,FieldTextArea:Eo,FieldUpload:md,fieldSwitch:ac},Symbol.toStringTag,{value:"Module"})),Xb="",Qb="",Qu={name:"FormGroup",components:Xu,mixins:[no],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:r.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let l="";switch(n.type==="input"?l=n.inputType:l=n.type,l){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const l=C.get(this.options,"fieldIdPrefix","");return io(n,l)},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,l,s){this.$emit("validated",n,l,s)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,l,s){return n.onclick.call(this,this.model,l,s,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(l=>l.field.fieldName===n.fieldName).map(l=>l.error)},onModelUpdated(n,l){this.$emit("modelUpdated",n,l)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(r.pushScopeId("data-v-bee61052"),n=n(),r.popScopeId(),n),ju=["for"],ef={class:"icon-wrapper"},tf=["innerHTML"],nf=Do(()=>r.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[r.createElementVNode("i",{class:"icon"})],-1)),rf=["innerHTML"],of={key:0,class:"link-wrapper"},sf=Do(()=>r.createElementVNode("span",{class:"section-header"},"More info",-1)),lf={class:"field-wrap"},af={key:0,class:"buttons"},df=["type","onClick","textContent"],cf=["innerHTML"],uf={key:2,class:"errors help-block"},ff=["innerHTML"];function hf(n,l,s,m,h,u){const b=r.resolveComponent("KTooltip"),g=r.resolveComponent("KExternalLink");return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["form-group",n.getFieldRowClasses(s.field)])},[u.fieldTypeHasLabel(s.field)?(r.openBlock(),r.createElementBlock("label",{key:0,class:r.normalizeClass(["form-group-label",s.field.labelClasses]),for:u.getFieldID(s.field)},[r.createElementVNode("div",ef,[r.createElementVNode("span",{innerHTML:u.formattedLabel(s.field.label)},null,8,tf),s.field.help?(r.openBlock(),r.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0},{content:r.withCtx(()=>[s.options.helpAsHtml?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:s.field.help},null,8,rf)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(s.field.help),1)],64))]),default:r.withCtx(()=>[nf]),_:1})):r.createCommentVNode("",!0)]),s.field.link?(r.openBlock(),r.createElementBlock("div",of,[r.createVNode(g,{href:s.field.link},{default:r.withCtx(()=>[sf]),_:1},8,["href"])])):r.createCommentVNode("",!0)],10,ju)):r.createCommentVNode("",!0),r.createElementVNode("div",lf,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.getFieldType(s.field)),r.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(s.field)||null,"form-options":s.options,model:s.model,schema:s.field,vfg:s.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(s.field)?(r.openBlock(),r.createElementBlock("div",af,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.field.buttons,(T,I)=>(r.openBlock(),r.createElementBlock("button",{key:I,class:r.normalizeClass(T.classes),type:u.getButtonType(T),onClick:O=>u.buttonClickHandler(T,s.field,O),textContent:r.toDisplayString(T.label)},null,10,df))),128))])):r.createCommentVNode("",!0)]),s.field.hint?(r.openBlock(),r.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(s.field)},null,8,cf)):r.createCommentVNode("",!0),u.fieldErrors(s.field).length>0?(r.openBlock(),r.createElementBlock("div",uf,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.fieldErrors(s.field),(T,I)=>(r.openBlock(),r.createElementBlock("span",{key:I,innerHTML:T},null,8,ff))),128))])):r.createCommentVNode("",!0)],2)}const mf=P(Qu,[["render",hf],["__scopeId","data-v-bee61052"]]),pf={key:0,class:"vue-form-generator"},gf=["is"],_f=["is"],yf={key:0};function bf(n,l,s,m,h,u){const b=r.resolveComponent("form-group");return s.schema!=null?(r.openBlock(),r.createElementBlock("div",pf,[s.schema.fields?(r.openBlock(),r.createElementBlock("fieldset",{key:0,is:s.tag},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.fields,g=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[u.fieldVisible(g)?(r.openBlock(),r.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:g,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):r.createCommentVNode("",!0)],64))),256))],8,gf)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.groups,g=>(r.openBlock(),r.createElementBlock("fieldset",{is:s.tag,class:r.normalizeClass(n.getFieldRowClasses(g))},[g.legend?(r.openBlock(),r.createElementBlock("legend",yf,r.toDisplayString(g.legend),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.fields,T=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[u.fieldVisible(T)?(r.openBlock(),r.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:T,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):r.createCommentVNode("",!0)],64))),256))],10,_f))),256))])):r.createCommentVNode("",!0)}const jb="",be=P({name:"FormGenerator",components:{formGroup:mf},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:r.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(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:r.ref([])}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,l=>{(!this.multiple||l.multi===!0)&&n.push(l)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),l=>{n.push(l)}),n}},watch:{model:{deep:!0,handler(n,l){l!==n&&n!=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(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,l,s){this.errors=this.errors.filter(h=>h.field.fieldName!==s.schema.fieldName),!n&&l&&l.length>0&&C.forEach(l,h=>{this.errors.push({field:s.schema,error:h})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,l){this.$emit("modelUpdated",n,l)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const l=[],s=[];C.forEach(this.$refs.children,h=>{C.isFunction(h.validate)&&(l.push(h.$refs.child),s.push(h.$refs.child.validate(!0)))});const m=h=>{const u=[];C.forEach(h,(g,T)=>{C.isArray(g)&&g.length>0&&C.forEach(g,I=>{u.push({field:l[T].schema,error:I})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(s).then(m):m(s)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},[["render",bf]]),wf={fields:[{help:"The client id(s) that the plugin uses when it calls authenticated endpoints on the identity provider.",inputType:"password",label:"Config.Client Id",model:"config-client_id",type:"input"},{help:"The client secret.",inputType:"password",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{help:"The discovery endpoint (or just the issuer identifier).",inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{help:"Types of credentials/grants to enable.",inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},Cf={fields:[{help:"The claim that contains the scopes.",inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{help:"The scopes required to be in the access token.",inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{help:"The claim that contains the audience.",inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{help:"The audience required to be in the access token.",inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{help:"The claim that contains the roles.",inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{help:"The roles required to be in the access token.",inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{help:"The claim that contains the groups.",inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"},{help:"The groups required to be in the access token.",inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"},{help:"The claim that contains authenticated groups.",inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"w-100",fieldItemsClasses:"d-flex mt-2 w-90",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",styleClasses:"w-100",newElementButtonLabel:"+ Add"}]},kf={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"}]},tw="",nw="",Ef={name:"OIDCForm",components:{VueFormGenerator:be},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(){this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(n=>!n.model.startsWith("config")&&n.model!=="tags")},this.commonFieldsSchema={...wf},this.authFieldsSchema={...Cf},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(n=>n.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(l=>l.model===n.model).length&&!this.authFieldsSchema.fields.filter(l=>l.model===n.model).length||n.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(n=>{const l=kf.fields.find(s=>s.model===n.model);return l||n}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(n=>n.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}])},getAuthMethodsValue(n,l){const s=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&s.push(this.authMethods[m].value);return this.sessionManagement&&n&&s.push("session"),l&&(n?s.push(n):s.push("session")),s},handleUpdate(n,l){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(l,n),this.onModelUpdated()}}},Ht=n=>(r.pushScopeId("data-v-b4cf6533"),n=n(),r.popScopeId(),n),vf={class:"general-settings"},Sf={class:"link-wrapper"},Tf=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Bf=Ht(()=>r.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),If={class:"auth-method-container"},Mf={class:"general-settings"},Af={class:"link-wrapper"},Nf=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Ff=Ht(()=>r.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),$f={class:"general-settings"},Vf={class:"link-wrapper"},Of=Ht(()=>r.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Df=Ht(()=>r.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function Lf(n,l,s,m,h,u){const b=r.resolveComponent("VueFormGenerator"),g=r.resolveComponent("KExternalLink"),T=r.resolveComponent("KLabel"),I=r.resolveComponent("KCheckbox"),O=r.resolveComponent("KInputSwitch"),j=r.resolveComponent("KTabs");return r.openBlock(),r.createElementBlock("div",null,[s.formModel.id&&s.isEditing||!s.isEditing?(r.openBlock(),r.createBlock(b,{key:0,class:"global-fields",model:s.formModel,options:s.formOptions,schema:h.globalFields,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(j,{tabs:h.tabs},{common:r.withCtx(()=>[r.createElementVNode("div",vf,[r.createElementVNode("div",Sf,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:r.withCtx(()=>[Tf]),_:1})]),Bf,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.commonFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(T,null,{default:r.withCtx(()=>[r.createTextVNode("Auth Methods")]),_:1}),r.createElementVNode("div",If,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.authMethods,J=>(r.openBlock(),r.createElementBlock("div",{key:J.value,class:"auth-method"},[r.createVNode(I,{modelValue:J.prop,"onUpdate:modelValue":we=>J.prop=we,onChange:we=>u.handleUpdate(we,J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),r.createVNode(O,{modelValue:h.sessionManagement,"onUpdate:modelValue":l[0]||(l[0]=J=>h.sessionManagement=J),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:r.withCtx(()=>[r.createElementVNode("div",Mf,[r.createElementVNode("div",Af,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:r.withCtx(()=>[Nf]),_:1})]),Ff,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.authFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),advanced:r.withCtx(()=>[r.createElementVNode("div",$f,[r.createElementVNode("div",Vf,[r.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:r.withCtx(()=>[Of]),_:1})]),Df,u.displayForm?(r.openBlock(),r.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.advancedFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const xf=P(Ef,[["render",Lf],["__scopeId","data-v-b4cf6533"]]),Lo={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"}}},Uf=r.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(n){const l=n,{t:s,te:m}=to.createI18n("en-us",Lo),h=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),u=r.computed(()=>{const b=l.formSchema;return b.fields.map(g=>{const T=`post-function.${g.model}`;return g.hint=m(`${T}.hint`)&&s(`${T}.hint`)||g.hint,g.help=m(`${T}.help`)&&s(`${T}.help`)||g.help,g.newElementButtonLabel=m(`${T}.newElementButtonLabel`)&&s(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="w-100",g.fieldItemsClasses="w-100 mt-2 mb-2",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)}}),Rf=r.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(n){const l=n,{t:s,te:m}=to.createI18n("en-us",Lo),h=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),u=r.computed(()=>{const b=l.formSchema;return b.fields.map(g=>{const T=`exit-transformer.${g.model}`;return g.hint=m(`${T}.hint`)&&s(`${T}.hint`)||g.hint,g.help=m(`${T}.help`)&&s(`${T}.help`)||g.help,g.newElementButtonLabel=m(`${T}.newElementButtonLabel`)&&s(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="w-100",g.fieldItemsClasses="w-100 mt-2 mb-2",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)}}),Pf={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}]},xo={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}]},Uo={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}]},$t=n=>(r.pushScopeId("data-v-bc6f1e04"),n=n(),r.popScopeId(),n),qf={class:"general-settings"},zf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),Hf=$t(()=>r.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Wf=$t(()=>r.createElementVNode("hr",null,null,-1)),Kf={class:"sub-form"},Yf={class:"general-settings"},Gf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Zf=$t(()=>r.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Jf={class:"sub-form"},Xf={class:"general-settings"},Qf=$t(()=>r.createElementVNode("div",{class:"header-wrapper"},[r.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),jf=$t(()=>r.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),eh=r.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(n){const l=n,s=r.ref("zeroSsl"),m=r.ref("shm"),h=r.computed(()=>({fields:l.formSchema.fields.filter(H=>!H.model.startsWith("config")&&H.model!=="tags")})),u=r.computed(()=>({fields:Pf.fields.filter(Y=>!xo.fields.some(ce=>ce.model===Y.model)&&!Uo.fields.some(ce=>ce.model===Y.model))})),b=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage")&&!Y.model.startsWith("config-storage_config-consul")&&!Y.model.startsWith("config-storage_config-redis")&&!Y.model.startsWith("config-storage_config-shm")&&!Y.model.startsWith("config-storage_config-vault"))})),g=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-consul"))})),T=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-redis"))})),I=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-shm"))})),O=r.computed(()=>({fields:l.formSchema.fields.filter(Y=>Y.model.startsWith("config-storage_config-vault"))})),j=r.computed(()=>({fields:l.formSchema.fields.filter(H=>H.model.startsWith("config")&&!u.value.fields.filter(Y=>Y.model===H.model).length&&!b.value.fields.filter(Y=>Y.model===H.model).length||H.model==="tags")})),J=r.computed(()=>l.formModel.id&&l.isEditing||!l.isEditing),we=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],et=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];r.onMounted(()=>{s.value==="zeroSsl"&&(l.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const st=H=>{s.value=H.value,(H.value==="zeroSsl"||H.value==="other")&&(H.value==="zeroSsl"?l.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":l.formModel["config-api_uri"]="https://acme.example.com/",l.formModel["config-tos_accepted"]=!1),H.value==="letsEncrypt"&&(l.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",l.formModel["config-eab_hmac_key"]="",l.formModel["config-eab_kid"]=""),l.onModelUpdated()},fe=(H,Y)=>{Y==="config-storage"&&(m.value=H),l.onModelUpdated()};return(H,Y)=>{const ce=r.resolveComponent("KSelect"),Te=r.resolveComponent("KTabs");return r.openBlock(),r.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(r.openBlock(),r.createBlock(be,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:h.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),r.createVNode(Te,{tabs:we},{general:r.withCtx(()=>[r.createElementVNode("div",qf,[zf,Hf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),Wf,r.createVNode(ce,{appearance:"select",class:"issuer-select",items:et,label:"Issuer",onChange:st}),r.createElementVNode("div",Kf,[s.value==="letsEncrypt"?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:r.unref(xo),onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),s.value==="zeroSsl"||s.value==="other"?(r.openBlock(),r.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:r.unref(Uo),onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])])]),storage:r.withCtx(()=>[r.createElementVNode("div",Yf,[Gf,Zf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:fe},null,8,["model","options","schema"])):r.createCommentVNode("",!0),r.createElementVNode("div",Jf,[m.value==="consul"?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="redis"?(r.openBlock(),r.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="shm"?(r.openBlock(),r.createBlock(be,{key:2,model:n.formModel,options:n.formOptions,schema:I.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0),m.value==="vault"?(r.openBlock(),r.createBlock(be,{key:3,model:n.formModel,options:n.formOptions,schema:O.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])])]),advanced:r.withCtx(()=>[r.createElementVNode("div",Xf,[Qf,jf,J.value?(r.openBlock(),r.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:j.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):r.createCommentVNode("",!0)])]),_:1})])}}}),rw="",th=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(eh,[["__scopeId","data-v-bc6f1e04"]]),ExitTransformer:Rf,OIDCForm:xf,PostFunction:Uf},Symbol.toStringTag,{value:"Module"})),nh=["array","metric","advanced","selectionGroup","object-advanced"],ih={install:n=>{n.component("VueFormGenerator",be)}},rh=(n,l=!1)=>({...l&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=bt,ve.VueFormGenerator=be,ve.abstractField=Ia,ve.customFields=nh,ve.default=ih,ve.getSharedFormName=rh,ve.sharedForms=th,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/forms",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/forms.umd.js",
|
|
6
6
|
"module": "./dist/forms.es.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"extends": "../../../package.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@kong/icons": "^1.8.
|
|
34
|
+
"@kong/icons": "^1.8.2",
|
|
35
35
|
"fecha": "^4.2.3",
|
|
36
36
|
"lodash": "^4.17.21"
|
|
37
37
|
},
|