@5minds/node-red-dashboard-2-processcube-dynamic-form 2.2.1-file-preview-2-7f33a3-mfferizd → 2.2.1-file-preview-2-892712-mffeuvkr

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form",
3
- "version": "2.2.1-file-preview-2-7f33a3-mfferizd",
3
+ "version": "2.2.1-file-preview-2-892712-mffeuvkr",
4
4
  "description": "The ui component for the ProcessCube dynamic-form",
5
5
  "keywords": [
6
6
  "processcube",
@@ -55,4 +55,4 @@ ${e}</tr>
55
55
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${we(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),i=cs(e);if(i===null)return n;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+we(t)+'"'),s+=">"+n+"</a>",s}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=cs(e);if(i===null)return we(r);e=i;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${we(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:we(e.text)}},rn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Oe=class Cn{constructor(t){W(this,"options");W(this,"renderer");W(this,"textRenderer");this.options=t||We,this.options.renderer=this.options.renderer||new ir,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rn}static parse(t,r){return new Cn(r).parse(t)}static parseInline(t,r){return new Cn(r).parseInline(t)}parse(t,r=!0){var i,s;let n="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=l,p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){n+=p||"";continue}}let c=l;switch(c.type){case"space":{n+=this.renderer.space(c);continue}case"hr":{n+=this.renderer.hr(c);continue}case"heading":{n+=this.renderer.heading(c);continue}case"code":{n+=this.renderer.code(c);continue}case"table":{n+=this.renderer.table(c);continue}case"blockquote":{n+=this.renderer.blockquote(c);continue}case"list":{n+=this.renderer.list(c);continue}case"html":{n+=this.renderer.html(c);continue}case"paragraph":{n+=this.renderer.paragraph(c);continue}case"text":{let u=c,p=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],p+=`
56
56
  `+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):n+=p;continue}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,r=this.renderer){var i,s;let n="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=u||"";continue}}let c=l;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},sr=(pn=class{constructor(e){W(this,"options");W(this,"block");this.options=e||We}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Re.lex:Re.lexInline}provideParser(){return this.block?Oe.parse:Oe.parseInline}},W(pn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),pn),$f=class{constructor(...e){W(this,"defaults",Kr());W(this,"options",this.setOptions);W(this,"parse",this.parseMarkdown(!0));W(this,"parseInline",this.parseMarkdown(!1));W(this,"Parser",Oe);W(this,"Renderer",ir);W(this,"TextRenderer",rn);W(this,"Lexer",Re);W(this,"Tokenizer",nr);W(this,"Hooks",sr);this.use(...e)}walkTokens(e,t){var n,i;let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)r=r.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,t));break}default:{let a=s;(i=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),n.extensions=t),r.renderer){let i=this.defaults.renderer||new ir(this.defaults);for(let s in r.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=r.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new nr(this.defaults);for(let s in r.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=r.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new sr;for(let s in r.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,l=r.hooks[a],c=i[a];sr.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(i,u)).then(y=>c.call(i,y));let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,s=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Re.lex(e,t??this.defaults)}parser(e,t){return Oe.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},i={...this.defaults,...n},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let a=i.hooks?i.hooks.provideLexer():e?Re.lex:Re.lexInline,l=i.hooks?i.hooks.provideParser():e?Oe.parse:Oe.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(c=>a(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let c=a(t,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(e,t){return r=>{if(r.message+=`
57
57
  Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+we(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Ke=new $f;function z(e,t){return Ke.parse(e,t)}z.options=z.setOptions=function(e){return Ke.setOptions(e),z.defaults=Ke.defaults,Yi(z.defaults),z},z.getDefaults=Kr,z.defaults=We,z.use=function(...e){return Ke.use(...e),z.defaults=Ke.defaults,Yi(z.defaults),z},z.walkTokens=function(e,t){return Ke.walkTokens(e,t)},z.parseInline=Ke.parseInline,z.Parser=Oe,z.parser=Oe.parse,z.Renderer=ir,z.TextRenderer=rn,z.Lexer=Re,z.lexer=Re.lex,z.Tokenizer=nr,z.Hooks=sr,z.parse=z,z.options,z.setOptions,z.use,z.walkTokens,z.parseInline,Oe.parse,Re.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:ps,setPrototypeOf:ms,isFrozen:xf,getPrototypeOf:Cf,getOwnPropertyDescriptor:Af}=Object;let{freeze:se,seal:he,create:hs}=Object,{apply:nn,construct:sn}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),he||(he=function(t){return t}),nn||(nn=function(t,r,n){return t.apply(r,n)}),sn||(sn=function(t,r){return new t(...r)});const ar=le(Array.prototype.forEach),Sf=le(Array.prototype.lastIndexOf),ds=le(Array.prototype.pop),Ct=le(Array.prototype.push),Tf=le(Array.prototype.splice),lr=le(String.prototype.toLowerCase),an=le(String.prototype.toString),gs=le(String.prototype.match),At=le(String.prototype.replace),Ef=le(String.prototype.indexOf),Ff=le(String.prototype.trim),ke=le(Object.prototype.hasOwnProperty),ae=le(RegExp.prototype.test),St=Rf(TypeError);function le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return nn(e,t,n)}}function Rf(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return sn(e,r)}}function M(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lr;ms&&ms(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(xf(t)||(t[n]=s),i=s)}e[i]=!0}return e}function Of(e){for(let t=0;t<e.length;t++)ke(e,t)||(e[t]=null);return e}function Ne(e){const t=hs(null);for(const[r,n]of ps(e))ke(e,r)&&(Array.isArray(n)?t[r]=Of(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Ne(n):t[r]=n);return t}function Tt(e,t){for(;e!==null;){const n=Af(e,t);if(n){if(n.get)return le(n.get);if(typeof n.value=="function")return le(n.value)}e=Cf(e)}function r(){return null}return r}const ys=se(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ln=se(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),on=se(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Nf=se(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cn=se(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),If=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bs=se(["#text"]),_s=se(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),un=se(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ks=se(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),or=se(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pf=he(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Df=he(/<%[\w\W]*|[\w\W]*%>/gm),Mf=he(/\$\{[\w\W]*/gm),Lf=he(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vf=he(/^aria-[\-\w]+$/),vs=he(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zf=he(/^(?:\w+script|data):/i),Bf=he(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ws=he(/^html$/i),Uf=he(/^[a-z][.\w]*(-[.\w]+)+$/i);var $s=Object.freeze({__proto__:null,ARIA_ATTR:Vf,ATTR_WHITESPACE:Bf,CUSTOM_ELEMENT:Uf,DATA_ATTR:Lf,DOCTYPE_NAME:ws,ERB_EXPR:Df,IS_ALLOWED_URI:vs,IS_SCRIPT_OR_DATA:zf,MUSTACHE_EXPR:Pf,TMPLIT_EXPR:Mf});const Et={element:1,text:3,progressingInstruction:7,comment:8,document:9},jf=function(){return typeof window>"u"?null:window},qf=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},xs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jf();const t=R=>Cs(R);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==Et.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:y,DOMParser:$,trustedTypes:w}=e,b=c.prototype,h=Tt(b,"cloneNode"),v=Tt(b,"remove"),k=Tt(b,"nextSibling"),C=Tt(b,"childNodes"),A=Tt(b,"parentNode");if(typeof a=="function"){const R=r.createElement("template");R.content&&R.content.ownerDocument&&(r=R.content.ownerDocument)}let d,T="";const{implementation:m,createNodeIterator:_,createDocumentFragment:D,getElementsByTagName:V}=r,{importNode:B}=n;let O=xs();t.isSupported=typeof ps=="function"&&typeof A=="function"&&m&&m.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:g,ERB_EXPR:F,TMPLIT_EXPR:N,DATA_ATTR:q,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:$e,CUSTOM_ELEMENT:de}=$s;let{IS_ALLOWED_URI:Ie}=$s,K=null;const As=M({},[...ys,...ln,...on,...cn,...bs]);let Q=null;const Ss=M({},[..._s,...un,...ks,...or]);let Z=Object.seal(hs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ft=null,mn=null,Ts=!0,hn=!0,Es=!1,Fs=!0,lt=!1,cr=!0,Ge=!1,dn=!1,gn=!1,ot=!1,ur=!1,fr=!1,Rs=!0,Os=!1;const Op="user-content-";let yn=!0,Rt=!1,ct={},ut=null;const Ns=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Is=null;const Ps=M({},["audio","video","img","source","image","track"]);let bn=null;const Ds=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pr="http://www.w3.org/1998/Math/MathML",mr="http://www.w3.org/2000/svg",Pe="http://www.w3.org/1999/xhtml";let ft=Pe,_n=!1,kn=null;const Np=M({},[pr,mr,Pe],an);let hr=M({},["mi","mo","mn","ms","mtext"]),dr=M({},["annotation-xml"]);const Ip=M({},["title","style","font","a","script"]);let Ot=null;const Pp=["application/xhtml+xml","text/html"],Dp="text/html";let X=null,pt=null;const Mp=r.createElement("form"),Ms=function(f){return f instanceof RegExp||f instanceof Function},vn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pt&&pt===f)){if((!f||typeof f!="object")&&(f={}),f=Ne(f),Ot=Pp.indexOf(f.PARSER_MEDIA_TYPE)===-1?Dp:f.PARSER_MEDIA_TYPE,X=Ot==="application/xhtml+xml"?an:lr,K=ke(f,"ALLOWED_TAGS")?M({},f.ALLOWED_TAGS,X):As,Q=ke(f,"ALLOWED_ATTR")?M({},f.ALLOWED_ATTR,X):Ss,kn=ke(f,"ALLOWED_NAMESPACES")?M({},f.ALLOWED_NAMESPACES,an):Np,bn=ke(f,"ADD_URI_SAFE_ATTR")?M(Ne(Ds),f.ADD_URI_SAFE_ATTR,X):Ds,Is=ke(f,"ADD_DATA_URI_TAGS")?M(Ne(Ps),f.ADD_DATA_URI_TAGS,X):Ps,ut=ke(f,"FORBID_CONTENTS")?M({},f.FORBID_CONTENTS,X):Ns,Ft=ke(f,"FORBID_TAGS")?M({},f.FORBID_TAGS,X):Ne({}),mn=ke(f,"FORBID_ATTR")?M({},f.FORBID_ATTR,X):Ne({}),ct=ke(f,"USE_PROFILES")?f.USE_PROFILES:!1,Ts=f.ALLOW_ARIA_ATTR!==!1,hn=f.ALLOW_DATA_ATTR!==!1,Es=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Fs=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=f.SAFE_FOR_TEMPLATES||!1,cr=f.SAFE_FOR_XML!==!1,Ge=f.WHOLE_DOCUMENT||!1,ot=f.RETURN_DOM||!1,ur=f.RETURN_DOM_FRAGMENT||!1,fr=f.RETURN_TRUSTED_TYPE||!1,gn=f.FORCE_BODY||!1,Rs=f.SANITIZE_DOM!==!1,Os=f.SANITIZE_NAMED_PROPS||!1,yn=f.KEEP_CONTENT!==!1,Rt=f.IN_PLACE||!1,Ie=f.ALLOWED_URI_REGEXP||vs,ft=f.NAMESPACE||Pe,hr=f.MATHML_TEXT_INTEGRATION_POINTS||hr,dr=f.HTML_INTEGRATION_POINTS||dr,Z=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Ms(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Ms(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),lt&&(hn=!1),ur&&(ot=!0),ct&&(K=M({},bs),Q=[],ct.html===!0&&(M(K,ys),M(Q,_s)),ct.svg===!0&&(M(K,ln),M(Q,un),M(Q,or)),ct.svgFilters===!0&&(M(K,on),M(Q,un),M(Q,or)),ct.mathMl===!0&&(M(K,cn),M(Q,ks),M(Q,or))),f.ADD_TAGS&&(K===As&&(K=Ne(K)),M(K,f.ADD_TAGS,X)),f.ADD_ATTR&&(Q===Ss&&(Q=Ne(Q)),M(Q,f.ADD_ATTR,X)),f.ADD_URI_SAFE_ATTR&&M(bn,f.ADD_URI_SAFE_ATTR,X),f.FORBID_CONTENTS&&(ut===Ns&&(ut=Ne(ut)),M(ut,f.FORBID_CONTENTS,X)),yn&&(K["#text"]=!0),Ge&&M(K,["html","head","body"]),K.table&&(M(K,["tbody"]),delete Ft.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');d=f.TRUSTED_TYPES_POLICY,T=d.createHTML("")}else d===void 0&&(d=qf(w,i)),d!==null&&typeof T=="string"&&(T=d.createHTML(""));se&&se(f),pt=f}},Ls=M({},[...ln,...on,...Nf]),Vs=M({},[...cn,...If]),Lp=function(f){let x=A(f);(!x||!x.tagName)&&(x={namespaceURI:ft,tagName:"template"});const E=lr(f.tagName),G=lr(x.tagName);return kn[f.namespaceURI]?f.namespaceURI===mr?x.namespaceURI===Pe?E==="svg":x.namespaceURI===pr?E==="svg"&&(G==="annotation-xml"||hr[G]):!!Ls[E]:f.namespaceURI===pr?x.namespaceURI===Pe?E==="math":x.namespaceURI===mr?E==="math"&&dr[G]:!!Vs[E]:f.namespaceURI===Pe?x.namespaceURI===mr&&!dr[G]||x.namespaceURI===pr&&!hr[G]?!1:!Vs[E]&&(Ip[E]||!Ls[E]):!!(Ot==="application/xhtml+xml"&&kn[f.namespaceURI]):!1},xe=function(f){Ct(t.removed,{element:f});try{A(f).removeChild(f)}catch{v(f)}},mt=function(f,x){try{Ct(t.removed,{attribute:x.getAttributeNode(f),from:x})}catch{Ct(t.removed,{attribute:null,from:x})}if(x.removeAttribute(f),f==="is")if(ot||ur)try{xe(x)}catch{}else try{x.setAttribute(f,"")}catch{}},zs=function(f){let x=null,E=null;if(gn)f="<remove></remove>"+f;else{const Y=gs(f,/^[\r\n\t ]+/);E=Y&&Y[0]}Ot==="application/xhtml+xml"&&ft===Pe&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const G=d?d.createHTML(f):f;if(ft===Pe)try{x=new $().parseFromString(G,Ot)}catch{}if(!x||!x.documentElement){x=m.createDocument(ft,"template",null);try{x.documentElement.innerHTML=_n?T:G}catch{}}const ee=x.body||x.documentElement;return f&&E&&ee.insertBefore(r.createTextNode(E),ee.childNodes[0]||null),ft===Pe?V.call(x,Ge?"html":"body")[0]:Ge?x.documentElement:ee},Bs=function(f){return _.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},wn=function(f){return f instanceof y&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof p)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Us=function(f){return typeof l=="function"&&f instanceof l};function De(R,f,x){ar(R,E=>{E.call(t,f,x,pt)})}const js=function(f){let x=null;if(De(O.beforeSanitizeElements,f,null),wn(f))return xe(f),!0;const E=X(f.nodeName);if(De(O.uponSanitizeElement,f,{tagName:E,allowedTags:K}),cr&&f.hasChildNodes()&&!Us(f.firstElementChild)&&ae(/<[/\w!]/g,f.innerHTML)&&ae(/<[/\w!]/g,f.textContent)||f.nodeType===Et.progressingInstruction||cr&&f.nodeType===Et.comment&&ae(/<[/\w]/g,f.data))return xe(f),!0;if(!K[E]||Ft[E]){if(!Ft[E]&&Hs(E)&&(Z.tagNameCheck instanceof RegExp&&ae(Z.tagNameCheck,E)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(E)))return!1;if(yn&&!ut[E]){const G=A(f)||f.parentNode,ee=C(f)||f.childNodes;if(ee&&G){const Y=ee.length;for(let ce=Y-1;ce>=0;--ce){const Me=h(ee[ce],!0);Me.__removalCount=(f.__removalCount||0)+1,G.insertBefore(Me,k(f))}}}return xe(f),!0}return f instanceof c&&!Lp(f)||(E==="noscript"||E==="noembed"||E==="noframes")&&ae(/<\/no(script|embed|frames)/i,f.innerHTML)?(xe(f),!0):(lt&&f.nodeType===Et.text&&(x=f.textContent,ar([g,F,N],G=>{x=At(x,G," ")}),f.textContent!==x&&(Ct(t.removed,{element:f.cloneNode()}),f.textContent=x)),De(O.afterSanitizeElements,f,null),!1)},qs=function(f,x,E){if(Rs&&(x==="id"||x==="name")&&(E in r||E in Mp))return!1;if(!(hn&&!mn[x]&&ae(q,x))){if(!(Ts&&ae(j,x))){if(!Q[x]||mn[x]){if(!(Hs(f)&&(Z.tagNameCheck instanceof RegExp&&ae(Z.tagNameCheck,f)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(f))&&(Z.attributeNameCheck instanceof RegExp&&ae(Z.attributeNameCheck,x)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(x))||x==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&ae(Z.tagNameCheck,E)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(E))))return!1}else if(!bn[x]){if(!ae(Ie,At(E,$e,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&f!=="script"&&Ef(E,"data:")===0&&Is[f])){if(!(Es&&!ae(H,At(E,$e,"")))){if(E)return!1}}}}}}return!0},Hs=function(f){return f!=="annotation-xml"&&gs(f,de)},Ws=function(f){De(O.beforeSanitizeAttributes,f,null);const{attributes:x}=f;if(!x||wn(f))return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let G=x.length;for(;G--;){const ee=x[G],{name:Y,namespaceURI:ce,value:Me}=ee,Nt=X(Y),$n=Me;let te=Y==="value"?$n:Ff($n);if(E.attrName=Nt,E.attrValue=te,E.keepAttr=!0,E.forceKeepAttr=void 0,De(O.uponSanitizeAttribute,f,E),te=E.attrValue,Os&&(Nt==="id"||Nt==="name")&&(mt(Y,f),te=Op+te),cr&&ae(/((--!?|])>)|<\/(style|title)/i,te)){mt(Y,f);continue}if(E.forceKeepAttr)continue;if(!E.keepAttr){mt(Y,f);continue}if(!Fs&&ae(/\/>/i,te)){mt(Y,f);continue}lt&&ar([g,F,N],Gs=>{te=At(te,Gs," ")});const Ks=X(f.nodeName);if(!qs(Ks,Nt,te)){mt(Y,f);continue}if(d&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!ce)switch(w.getAttributeType(Ks,Nt)){case"TrustedHTML":{te=d.createHTML(te);break}case"TrustedScriptURL":{te=d.createScriptURL(te);break}}if(te!==$n)try{ce?f.setAttributeNS(ce,Y,te):f.setAttribute(Y,te),wn(f)?xe(f):ds(t.removed)}catch{mt(Y,f)}}De(O.afterSanitizeAttributes,f,null)},Vp=function R(f){let x=null;const E=Bs(f);for(De(O.beforeSanitizeShadowDOM,f,null);x=E.nextNode();)De(O.uponSanitizeShadowNode,x,null),js(x),Ws(x),x.content instanceof s&&R(x.content);De(O.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(R){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,E=null,G=null,ee=null;if(_n=!R,_n&&(R="<!-->"),typeof R!="string"&&!Us(R))if(typeof R.toString=="function"){if(R=R.toString(),typeof R!="string")throw St("dirty is not a string, aborting")}else throw St("toString is not a function");if(!t.isSupported)return R;if(dn||vn(f),t.removed=[],typeof R=="string"&&(Rt=!1),Rt){if(R.nodeName){const Me=X(R.nodeName);if(!K[Me]||Ft[Me])throw St("root node is forbidden and cannot be sanitized in-place")}}else if(R instanceof l)x=zs("<!---->"),E=x.ownerDocument.importNode(R,!0),E.nodeType===Et.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?x=E:x.appendChild(E);else{if(!ot&&!lt&&!Ge&&R.indexOf("<")===-1)return d&&fr?d.createHTML(R):R;if(x=zs(R),!x)return ot?null:fr?T:""}x&&gn&&xe(x.firstChild);const Y=Bs(Rt?R:x);for(;G=Y.nextNode();)js(G),Ws(G),G.content instanceof s&&Vp(G.content);if(Rt)return R;if(ot){if(ur)for(ee=D.call(x.ownerDocument);x.firstChild;)ee.appendChild(x.firstChild);else ee=x;return(Q.shadowroot||Q.shadowrootmode)&&(ee=B.call(n,ee,!0)),ee}let ce=Ge?x.outerHTML:x.innerHTML;return Ge&&K["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&ae(ws,x.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
58
- `+ce),lt&&ar([g,F,N],Me=>{ce=At(ce,Me," ")}),d&&fr?d.createHTML(ce):ce},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vn(R),dn=!0},t.clearConfig=function(){pt=null,dn=!1},t.isValidAttribute=function(R,f,x){pt||vn({});const E=X(R),G=X(f);return qs(E,G,x)},t.addHook=function(R,f){typeof f=="function"&&Ct(O[R],f)},t.removeHook=function(R,f){if(f!==void 0){const x=Sf(O[R],f);return x===-1?void 0:Tf(O[R],x,1)[0]}return ds(O[R])},t.removeHooks=function(R){O[R]=[]},t.removeAllHooks=function(){O=xs()},t}var Hf=Cs();const fn=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Wf={name:"UIDynamicFormFooterAction",props:{actions:{type:Array,default(){return[]}},actionCallback:{type:Function,default(e){}},formIsFinished:{type:Boolean,default(){return!1}}},computed:{leftSideActions(){const e=this.actions.filter(r=>r.alignment==="left"||!r.alignment),t=(r,n)=>{const i=r.primary==="primary",s=n.primary==="primary";return i&&!s?-1:!i&&s?1:0};return e.sort(t)},rightSideActions(){const e=this.actions.filter(r=>r.alignment==="right"),t=(r,n)=>{const i=r.primary==="primary",s=n.primary==="primary";return!i&&s?-1:i&&!s?1:0};return e.sort(t)}},methods:{getActionButtonClass(e){switch(e.primary){case"primary":return"ui-dynamic-form-footer-action-primary";case"destructive":return"ui-dynamic-form-footer-action-terminate";case"secondary":default:return"ui-dynamic-form-footer-action-secondary"}}}},Kf={class:"ui-dynamic-form-footer-actions-container"},Gf={class:"ui-dynamic-form-footer-actions-left"},Zf={class:"ui-dynamic-form-footer-actions-right"};function Yf(e,t,r,n,i,s){const a=o.resolveComponent("v-btn");return o.openBlock(),o.createElementBlock("div",Kf,[o.createElementVNode("div",Gf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.leftSideActions,(l,c)=>(o.openBlock(),o.createElementBlock("div",{key:`left-${c}`},[o.createVNode(a,{class:o.normalizeClass(["ui-dynamic-form-footer-action-button",s.getActionButtonClass(l)]),disabled:r.formIsFinished,onClick:u=>r.actionCallback(l)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]),_:2},1032,["class","disabled","onClick"])]))),128))]),o.createElementVNode("div",Zf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rightSideActions,(l,c)=>(o.openBlock(),o.createElementBlock("div",{key:`right-${c}`},[o.createVNode(a,{class:o.normalizeClass(["ui-dynamic-form-footer-action-button",s.getActionButtonClass(l)]),disabled:r.formIsFinished,onClick:u=>r.actionCallback(l)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]),_:2},1032,["class","disabled","onClick"])]))),128))])])}const Jf=fn(Wf,[["render",Yf]]),Xf={name:"UIDynamicFormTitleText",props:{style:{type:String,default(){return"default"}},title:{type:String,default(){return""}},customStyles:{type:String,default(){return""}},collapsible:{type:Boolean,default(){return!1}},collapsed:{type:Boolean,default(){return!1}},titleIcon:{type:String,default(){return""}},toggleCollapse:{type:Function,default(){}}},computed:{typeSpecificStyling(){return`ui-dynamic-form-title-${this.style}`}}},Qf={key:0},ep=["fill"],tp=["fill"],rp=["src"],np={key:1};function ip(e,t,r,n,i,s){return r.title.length>0?(o.openBlock(),o.createElementBlock("div",Qf,[o.createElementVNode("h3",{class:o.normalizeClass([s.typeSpecificStyling,"ui-dynamic-form-title-responsive"]),style:{display:"flex",gap:"25px","align-items":"center"}},[r.collapsible&&!r.collapsed?(o.openBlock(),o.createElementBlock("svg",{key:0,style:{width:"25px",height:"25px",cursor:"pointer"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:t[0]||(t[0]=(...a)=>r.toggleCollapse&&r.toggleCollapse(...a))},[o.createElementVNode("path",{fill:r.style==="default"?"white":"black",d:"M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"},null,8,ep)])):o.createCommentVNode("",!0),r.collapsible&&r.collapsed?(o.openBlock(),o.createElementBlock("svg",{key:1,style:{width:"25px",height:"25px",cursor:"pointer"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",onClick:t[1]||(t[1]=(...a)=>r.toggleCollapse&&r.toggleCollapse(...a))},[o.createElementVNode("path",{fill:r.style==="default"?"white":"black",d:"M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"},null,8,tp)])):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle({width:"fit-content",display:r.style==="default"?"":"flex"})},[r.titleIcon.length>0?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.titleIcon,style:{"padding-right":"16px"}},null,8,rp)):o.createCommentVNode("",!0),o.createElementVNode("span",{style:o.normalizeStyle(r.customStyles)},o.toDisplayString(r.title),5),r.style==="default"?(o.openBlock(),o.createElementBlock("hr",np)):o.createCommentVNode("",!0)],4)],2)])):o.createCommentVNode("",!0)}const sp=fn(Xf,[["render",ip]]);function ap({value:e},[t,r],n){var a,l;return console.debug(arguments),!(((l=(a=n==null?void 0:n.root)==null?void 0:a.value)==null?void 0:l[t])===r&&(e===""||e===null||e===void 0))}class lp extends z.Renderer{link(t){return super.link(t).replace("<a","<a target='_blank'")}html(t){const r=super.html(t);return r.startsWith("<a ")&&!r.includes("target=")?r.replace("<a ",'<a target="_blank" '):r}}class op extends z.Hooks{postprocess(t){return Hf.sanitize(t,{ADD_ATTR:["target"]})}}function cp(e){return e?z.parse(e.toString(),{renderer:new lp,hooks:new op}):""}const up={name:"UIDynamicForm",components:{FormKit:Hr,UIDynamicFormFooterAction:Jf,UIDynamicFormTitleText:sp},inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!1,visible:!1})}},setup(e){console.info("UIDynamicForm setup with:",e),console.debug("Vue function loaded correctly",o.markRaw);const r=o.getCurrentInstance().appContext.app,n=Ur({theme:"genesis",locales:{de:Ll},locale:"de",rules:{requiredIf:ap}});r.use(Tu,n)},data(){return{actions:[],formData:{},originalFileData:{},userTask:null,theme:"",errorMsg:"",formIsFinished:!1,msg:null,collapsed:!1,firstFormFieldRef:null,imageModalOpen:!1,modalImage:null,objectUrlsByField:{},previewCache:{}}},computed:{dynamicClass(){return`ui-dynamic-form-${this.theme} ui-dynamic-form-common`},dynamicFooterClass(){return`ui-dynamic-form-footer-${this.theme} ui-dynamic-form-footer-common`},hasUserTask(){return!!this.userTask},totalOutputs(){const e=this.props.handle_confirmation_dialogs?this.props.confirm_actions?this.props.confirm_actions.length:2:0;return this.props.options.length+e+(this.props.trigger_on_change?1:0)},isConfirmDialog(){return this.userTask.userTaskConfig.formFields.some(e=>e.type==="confirm")},effectiveTitle(){return this.props.title_text_type==="str"?this.props.title_text:this.props.title_text_type==="msg"?this.msg.dynamicTitle:""}},watch:{formData:{handler(e,t){if(t&&(this.userTask&&this.userTask.userTaskConfig&&this.userTask.userTaskConfig.formFields&&this.userTask.userTaskConfig.formFields.filter(n=>n.type==="file").forEach(n=>{const i=n.id,s=e[i],a=t[i];s!==a&&this.originalFileData[i]&&this.hasActualFileObjects(s)&&(delete this.originalFileData[i],Object.keys(this.previewCache).forEach(c=>{c.startsWith(i+"_")&&delete this.previewCache[c]}),this.cleanupObjectUrls(i))}),this.props.trigger_on_change)){const r={payload:{formData:e,userTask:this.userTask}};this.send(r,this.totalOutputs-1)}},deep:!0},collapsed(e){!e&&this.hasUserTask&&o.nextTick(()=>{this.focusFirstFormField()})},userTask(e){e&&!this.collapsed&&o.nextTick(()=>{this.focusFirstFormField()})}},created(){const e=window.location.pathname,t=e.substring(e.lastIndexOf("/")),r=this.$store.state;for(const n in r.ui.pages)if(r.ui.pages[n].path===t){const i=r.ui.pages[n].theme;r.ui.themes[i].name==="ProcessCube Lightmode"?this.theme="light":r.ui.themes[i].name==="ProcessCube Darkmode"?this.theme="dark":this.theme="default";break}},mounted(){document.querySelectorAll(".formkit-input").forEach(t=>{t.classList.add("test")}),this.$socket.on("msg-input:"+this.id,t=>{this.init(t)}),this.$socket.emit("widget-load",this.id)},unmounted(){var e;(e=this.$socket)==null||e.off("msg-input:"+this.id),this.cleanupObjectUrls()},methods:{createComponent(e){const t=e.customForm?JSON.parse(JSON.stringify(e.customForm)):{},r=t.hint,n=t.placeholder,i=t.validation,s=e.id,a=t.customProperties??[],l=this.props.readonly||this.formIsFinished||a.find(c=>["readOnly","readonly"].includes(c.name)&&c.value==="true")?"true":void 0;switch(e.type){case"long":return{type:"FormKit",props:{type:"number",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],number:"integer",min:0,validation:i?`${i}|number`:"number",help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validationVisibility:"live"}};case"number":const c=e.customForm?JSON.parse(JSON.stringify(e.customForm)).step:void 0;return{type:"FormKit",props:{type:"number",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],step:c,number:"float",validation:i?`${i}|number`:"number",help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validationVisibility:"live"}};case"date":return{type:"FormKit",props:{type:"date",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"enum":const u=e.enumValues.map(A=>({value:A.id,label:A.name}));return{type:"FormKit",props:{type:"select",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:u,help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"select":const p=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"select",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:p,placeholder:n,help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"string":return{type:"FormKit",props:{type:"text",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"confirm":return{type:"h3",innerText:e.label};case"boolean":return{type:"FormKit",props:{type:"checkbox",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"file":const y=e.customForm?JSON.parse(JSON.stringify(e.customForm)).multiple==="true":!1;return{type:"div",props:{class:"ui-dynamic-form-file-wrapper"},isFileField:!0,field:e,multiple:y,isReadOnly:l,hint:r,validation:i,name:s};case"checkbox":const $=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"checkbox",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:$,help:r,fieldsetClass:"custom-fieldset",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"color":return{type:"FormKit",props:{type:"color",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"datetime-local":return{type:"FormKit",props:{type:"datetime-local",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"email":return{type:"FormKit",props:{type:"email",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"header":let w="h1";return e.customForm&&JSON.parse(JSON.stringify(e.customForm)).style==="heading_2"&&(w="h2"),e.customForm&&JSON.parse(JSON.stringify(e.customForm)).style==="heading_3"&&(w="h3"),{type:w,innerText:this.formData[e.id]};case"hidden":return{type:"input",props:{type:"hidden",value:this.formData[e.id]}};case"month":return{type:"FormKit",props:{type:"month",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"paragraph":const b=this.formData[e.id]||e.defaultValue||e.label||"";return{type:"div",innerHTML:cp(b),class:"ui-dynamic-form-paragraph"};case"password":return{type:"FormKit",props:{type:"password",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"radio":const v=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"radio",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:v,help:r,fieldsetClass:"custom-fieldset",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"range":const k=JSON.parse(JSON.stringify(e.customForm));return{type:"v-slider",props:{id:e.id,name:s,required:e.required,min:k.min,max:k.max,step:k.step,thumbLabel:!0,labelClass:"ui-dynamic-form-input-label",readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"tel":return{type:"FormKit",props:{type:"tel",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"textarea":const C=e.customForm?JSON.parse(JSON.stringify(e.customForm)).rows:void 0;return{type:"FormKit",props:{type:"textarea",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],rows:C,help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"time":return{type:"FormKit",props:{type:"time",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"url":return{type:"FormKit",props:{type:"url",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"week":return{type:"FormKit",props:{type:"week",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};default:return{type:"FormKit",props:{type:e.type,id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}}}},toggleCollapse(){this.collapsed=!this.collapsed},getRowWidthStyling(e,t){let r="";return t===0&&(r+="margin-top: 12px;"),e.type,r+="flex-basis: 100%;",r},fields(){var r;return(((r=this.userTask.userTaskConfig)==null?void 0:r.formFields)??[]).map(n=>({...n,items:fp(n.type,n)}))},send(e,t){const r=[];r[t]=e,this.$socket.emit("widget-action",this.id,r)},init(e){if(this.msg=e,!e)return;if(this.originalFileData={},this.previewCache={},this.cleanupObjectUrls(),this.actions=this.props.options,e.payload&&e.payload.userTask)this.userTask=e.payload.userTask;else{this.userTask=null,this.formData={},this.originalFileData={},this.cleanupObjectUrls();return}const r=this.userTask.userTaskConfig.formFields,n=r.map(l=>l.id),i=this.userTask.startToken;console.log("Initial Values:",i),console.log("Form Fields:",r);const s=e.payload.formData;this.formIsFinished=!!e.payload.formData,this.formIsFinished&&(this.collapsed=this.props.collapse_when_finished);const a=r.some(l=>l.type==="confirm");r&&r.forEach(l=>{var c,u,p,y;if(this.formData[l.id]=l.defaultValue,l.type==="confirm"){const $=l.customForm?JSON.parse(JSON.stringify(l.customForm)):{},w=$.confirmButtonText??"Confirm",b=$.declineButtonText??"Decline",h=[{alignment:((c=this.props.confirm_actions[1])==null?void 0:c.alignment)||"left",primary:((u=this.props.confirm_actions[1])==null?void 0:u.primary)||"destructive",label:b,condition:"",isConfirmAction:!0,confirmFieldId:l.id,confirmValue:!1},{alignment:((p=this.props.confirm_actions[0])==null?void 0:p.alignment)||"right",primary:((y=this.props.confirm_actions[0])==null?void 0:y.primary)||"primary",label:w,condition:"",isConfirmAction:!0,confirmFieldId:l.id,confirmValue:!0}],v=this.props.options.filter(k=>{if(!k.condition)return!0;try{const C={...this.userTask,isConfirmDialog:!0};return!!Function("fields","usertask","msg",'"use strict"; return ('+k.condition+")")(this.formData,C,this.msg)}catch(C){return console.error("Error while evaluating condition: "+C),!1}});this.actions=[...v,...h]}}),!a&&this.props.handle_confirmation_dialogs&&(this.actions=this.props.options.filter(l=>{if(!l.condition)return!0;try{const c={...this.userTask,isConfirmDialog:!1};return!!Function("fields","usertask","msg",'"use strict"; return ('+l.condition+")")(this.formData,c,this.msg)}catch(c){return console.error("Error while evaluating condition: "+c),!1}})),i&&Object.keys(i).filter(l=>n.includes(l)).forEach(l=>{const c=r.find(u=>u.id===l);c&&c.type==="file"?this.formData[l]=this.transformBase64ToFormKitFormat(i[l],c):this.formData[l]=i[l]}),this.formIsFinished&&Object.keys(s).filter(l=>n.includes(l)).forEach(l=>{const c=r.find(u=>u.id===l);c&&c.type==="file"?this.formData[l]=this.transformBase64ToFormKitFormat(s[l],c):this.formData[l]=s[l]}),o.nextTick(()=>{this.focusFirstFormField()})},async actionFn(e){if(e.isConfirmAction&&e.confirmFieldId&&(this.formData[e.confirmFieldId]=e.confirmValue),this.checkCondition(e.condition,{isConfirmDialog:this.isConfirmDialog})){this.showError("");let t={...this.formData};const r=this.userTask.userTaskConfig.formFields;try{console.log("Processing file fields:",r.filter(s=>s.type==="file")),t=await this.processFileFields(t,r),console.log("File processing completed successfully")}catch(s){console.error("Error processing file fields:",s),this.showError("Fehler beim Verarbeiten der Dateien");return}r.forEach(s=>{const a=t[s.id];if((s.type==="number"||s.type==="long")&&a!=null&&a!=="")if(s.type==="long"){const l=Number.parseInt(a,10);isNaN(l)||(t[s.id]=l)}else{const l=Number.parseFloat(a);isNaN(l)||(t[s.id]=l)}});const n=this.msg??{};n.payload={formData:t,userTask:this.userTask};let i;if(e.isConfirmAction){const s=e.confirmValue?1:0;i=this.props.options.length+s}else i=this.props.options.findIndex(s=>s.label===e.label);this.send(n,i)}else this.showError(e.errorMessage)},checkCondition(e,t={}){if(e==="")return!0;try{const r={...this.userTask,isConfirmDialog:t.isConfirmDialog||!1};return!!Function("fields","usertask","msg",'"use strict"; return ('+e+")")(this.formData,r,this.msg)}catch(r){return console.error("Error while evaluating condition: "+r),!1}},showError(e){this.errorMsg=e},focusFirstFormField(){if(!(this.collapsed||!this.hasUserTask)&&this.firstFormFieldRef){let e=null;this.firstFormFieldRef.node&&this.firstFormFieldRef.node.input instanceof HTMLElement?e=this.firstFormFieldRef.node.input:this.firstFormFieldRef.$el instanceof HTMLElement&&(["INPUT","TEXTAREA","SELECT"].includes(this.firstFormFieldRef.$el.tagName)?e=this.firstFormFieldRef.$el:e=this.firstFormFieldRef.$el.querySelector('input:not([type="hidden"]), textarea, select')),e?e.focus():console.warn("Could not find a focusable input element for the first form field.")}},transformBase64ToFormKitFormat(e,t){if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0].name&&!e[0].data)return e;const r=t.id,n=t.customForm?JSON.parse(JSON.stringify(t.customForm)).multiple==="true":!1;if(e&&typeof e=="object"&&e.name&&e.data){this.originalFileData[r]=e;const i={name:e.name};return n?[i]:[i]}return Array.isArray(e)?(this.originalFileData[r]=e,e.filter(s=>s&&typeof s=="object"&&s.name).map(s=>({name:s.name}))):[]},hasActualFileObjects(e){return e?Array.isArray(e)?e.some(t=>t instanceof File||t&&t.file instanceof File||t&&t.file instanceof FileList&&t.file.length>0):e instanceof File||e instanceof FileList&&e.length>0||e&&e.file instanceof File||e&&e.file instanceof FileList&&e.file.length>0:!1},async convertFileToBase64(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const i=n.result.split(",")[1];t({name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,data:i})},n.onerror=r,n.readAsDataURL(e)})},async processFileFields(e,t){const r={...e};for(const n of t)if(n.type==="file"){const i=r[n.id],s=n.id;if(this.originalFileData[s]){r[s]=this.originalFileData[s],console.log(`Using original file data for field ${s}:`,this.originalFileData[s]);continue}if(i){const a=n.customForm?JSON.parse(JSON.stringify(n.customForm)).multiple==="true":!1;if(a&&Array.isArray(i)){const l=[];for(const c of i){const u=await this.processIndividualFile(c);u&&l.push(u)}r[n.id]=l}else if(Array.isArray(i)){const l=[];for(const c of i){const u=await this.processIndividualFile(c);u&&l.push(u)}r[n.id]=a?l:l[0]||null}else if(i){const l=await this.processIndividualFile(i);l&&(r[n.id]=l)}}}return r},async processIndividualFile(e){let t=null;if(e instanceof File)t=e;else if(e instanceof FileList&&e.length>0)t=e[0];else if(e&&e.file instanceof File)t=e.file;else if(e&&e.file instanceof FileList&&e.file.length>0)t=e.file[0];else if(Array.isArray(e)&&e.length>0)e[0]instanceof File?t=e[0]:e[0]&&e[0].file instanceof File?t=e[0].file:e[0]&&e[0].file instanceof FileList&&e[0].file.length>0&&(t=e[0].file[0]);else if(typeof e=="object"&&e.data&&e.name)return e;return t instanceof File?await this.convertFileToBase64(t):(e&&typeof e=="object"&&!e.data&&console.warn("Could not process file data:",e),e)},isImageFile(e){if(!e||typeof e!="object")return!1;const t=e.type;return t?t.startsWith("image/"):!1},generateImagePreviewUrl(e){return!e||!e.data||!e.type?null:`data:${e.type};base64,${e.data}`},getFilePreviewsForField(e){const t=this.formData[e]||null,r=this.originalFileData[e]||null,n=`${e}_${JSON.stringify(t)}_${JSON.stringify(r)}`;if(this.previewCache[n])return this.previewCache[n];const i=this.formData[e],s=this.originalFileData[e];if(!i&&!s)return this.previewCache[n]=[],[];let a=[];return i&&Array.isArray(i)&&i.length>0&&this.hasActualFileObjects(i)?a=this.generatePreviewsFromCurrentFiles(i,e):s&&(a=(Array.isArray(s)?s:[s]).filter(u=>this.isImageFile(u)).map(u=>({name:u.name,url:this.generateImagePreviewUrl(u),size:u.size,type:u.type}))),this.previewCache[n]=a,a},generatePreviewsFromCurrentFiles(e,t=null){return t&&this.objectUrlsByField[t]?(this.objectUrlsByField[t].forEach(n=>URL.revokeObjectURL(n)),this.objectUrlsByField[t]=[]):t&&(this.objectUrlsByField[t]=[]),e.filter(n=>{let i=null;return n instanceof File?i=n:n&&n.file instanceof File?i=n.file:Array.isArray(n)&&n[0]instanceof File&&(i=n[0]),i&&i.type&&i.type.startsWith("image/")}).map(n=>{let i=null;n instanceof File?i=n:n&&n.file instanceof File?i=n.file:Array.isArray(n)&&n[0]instanceof File&&(i=n[0]);const s=i?URL.createObjectURL(i):null;return s&&t&&(this.objectUrlsByField[t]||(this.objectUrlsByField[t]=[]),this.objectUrlsByField[t].push(s)),{name:i.name,url:s,size:i.size,type:i.type,isObjectUrl:!0}}).filter(n=>n.url!==null)},formatFileSize(e){if(!e)return"0 B";const t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]},openImageModal(e){this.modalImage=e,this.imageModalOpen=!0},closeImageModal(){this.imageModalOpen=!1,this.modalImage=null},cleanupObjectUrls(e=null){e?(this.objectUrlsByField[e]&&(this.objectUrlsByField[e].forEach(t=>{URL.revokeObjectURL(t)}),this.objectUrlsByField[e]=[]),Object.keys(this.previewCache).forEach(t=>{t.startsWith(e+"_")&&delete this.previewCache[t]})):(Object.keys(this.objectUrlsByField).forEach(t=>{this.objectUrlsByField[t].forEach(r=>{URL.revokeObjectURL(r)})}),this.objectUrlsByField={},this.previewCache={})}}};function fp(e,t){return e==="enum"?t.enumValues.map(r=>({title:r.name,value:r.id})):null}const pp={className:"ui-dynamic-form-wrapper"},mp={key:0,style:{"margin-bottom":"0px"}},hp={key:0},dp=["data-columns"],gp={key:2},yp={class:"formkit-label"},bp={class:"formkit-help"},_p={key:3,class:"ui-dynamic-form-file-wrapper"},kp={key:0,class:"ui-dynamic-form-image-previews"},vp={class:"ui-dynamic-form-preview-grid"},wp=["src","alt","onClick"],$p={class:"ui-dynamic-form-preview-info"},xp={class:"ui-dynamic-form-preview-name"},Cp={class:"ui-dynamic-form-preview-size"},Ap={key:1},Sp={key:1,style:{"padding-top":"32px"}},Tp=["src","alt"],Ep={style:{"margin-top":"16px"}};function Fp(e,t,r,n,i,s){const a=o.resolveComponent("UIDynamicFormTitleText"),l=o.resolveComponent("FormKit"),c=o.resolveComponent("v-col"),u=o.resolveComponent("v-row"),p=o.resolveComponent("v-alert"),y=o.resolveComponent("UIDynamicFormFooterAction"),$=o.resolveComponent("v-form"),w=o.resolveComponent("v-card-title"),b=o.resolveComponent("v-card-text"),h=o.resolveComponent("v-spacer"),v=o.resolveComponent("v-btn"),k=o.resolveComponent("v-card-actions"),C=o.resolveComponent("v-card"),A=o.resolveComponent("v-dialog");return o.openBlock(),o.createElementBlock("div",{className:"ui-dynamic-form-external-sizing-wrapper",style:o.normalizeStyle(r.props.card_size_styling)},[r.props.title_style==="outside"&&s.hasUserTask?(o.openBlock(),o.createBlock(a,{key:0,style:o.normalizeStyle(r.props.title_style),title:s.effectiveTitle,customStyles:r.props.title_custom_text_styling,titleIcon:r.props.title_icon,collapsible:r.props.collapsible||r.props.collapse_when_finished&&i.formIsFinished,collapsed:i.collapsed,toggleCollapse:s.toggleCollapse},null,8,["style","title","customStyles","titleIcon","collapsible","collapsed","toggleCollapse"])):o.createCommentVNode("",!0),o.createElementVNode("div",pp,[s.hasUserTask?(o.openBlock(),o.createElementBlock("p",mp,[o.createVNode($,{ref:"form",modelValue:e.form,"onUpdate:modelValue":t[0]||(t[0]=d=>e.form=d),class:o.normalizeClass(s.dynamicClass)},{default:o.withCtx(()=>[r.props.title_style!="outside"?(o.openBlock(),o.createBlock(a,{key:0,style:o.normalizeStyle(r.props.title_style),title:s.effectiveTitle,customStyles:r.props.title_custom_text_styling,titleIcon:r.props.title_icon,collapsible:r.props.collapsible||r.props.collapse_when_finished&&i.formIsFinished,collapsed:i.collapsed,toggleCollapse:s.toggleCollapse},null,8,["style","title","customStyles","titleIcon","collapsible","collapsed","toggleCollapse"])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{name:"cardCollapse"},{default:o.withCtx(()=>[i.collapsed?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",hp,[o.createElementVNode("div",{className:"ui-dynamic-form-formfield-positioner",style:o.normalizeStyle(r.props.inner_card_styling),"data-columns":r.props.form_columns||1},[o.createVNode(l,{id:"form",type:"group"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.fields(),(d,T)=>(o.openBlock(),o.createBlock(u,{key:d,class:o.normalizeClass(d.type==="header"?"ui-dynamic-form-header-row":""),style:o.normalizeStyle(s.getRowWidthStyling(d,T))},{default:o.withCtx(()=>[o.createVNode(c,{cols:"12"},{default:o.withCtx(()=>[s.createComponent(d).innerHTML?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:0,ref_for:!0},s.createComponent(d).props,{class:s.createComponent(d).class,innerHTML:s.createComponent(d).innerHTML,ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)}}),null,16,["class","innerHTML"])):s.createComponent(d).innerText?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:1,ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m}),{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.createComponent(d).innerText),1)]),_:2},1040,["modelValue","onUpdate:modelValue"])):s.createComponent(d).type=="v-slider"?(o.openBlock(),o.createElementBlock("div",gp,[o.createElementVNode("p",yp,o.toDisplayString(d.label),1),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:d.defaultValue,"onUpdate:modelValue":m=>d.defaultValue=m}),null,16,["modelValue","onUpdate:modelValue"])),o.createElementVNode("p",bp,o.toDisplayString(d.customForm?d.customForm.hint:void 0),1)])):s.createComponent(d).isFileField?(o.openBlock(),o.createElementBlock("div",_p,[s.getFilePreviewsForField(d.id).length>0?(o.openBlock(),o.createElementBlock("div",kp,[t[2]||(t[2]=o.createElementVNode("h4",null,"Current files:",-1)),o.createElementVNode("div",vp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.getFilePreviewsForField(d.id),m=>(o.openBlock(),o.createElementBlock("div",{key:m.name,class:"ui-dynamic-form-preview-item"},[o.createElementVNode("img",{src:m.url,alt:m.name,class:"ui-dynamic-form-preview-image",onClick:_=>s.openImageModal(m)},null,8,wp),o.createElementVNode("div",$p,[o.createElementVNode("span",xp,o.toDisplayString(m.name),1),o.createElementVNode("span",Cp,o.toDisplayString(s.formatFileSize(m.size)),1)])]))),128))])])):o.createCommentVNode("",!0),o.createVNode(l,{type:"file",id:d.id,name:s.createComponent(d).name,label:d.label,required:d.required,modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m,help:s.createComponent(d).hint,innerClass:"reset-background",wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${i.theme}`,readonly:s.createComponent(d).isReadOnly,disabled:s.createComponent(d).isReadOnly,multiple:s.createComponent(d).multiple,validation:s.createComponent(d).validation,validationVisibility:"live",ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)}},null,8,["id","name","label","required","modelValue","onUpdate:modelValue","help","inputClass","readonly","disabled","multiple","validation"])])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:4,ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m}),null,16,["modelValue","onUpdate:modelValue"]))]),_:2},1024)]),_:2},1032,["class","style"]))),128))]),_:1})],12,dp),o.createVNode(u,{class:o.normalizeClass(s.dynamicFooterClass)},{default:o.withCtx(()=>[i.errorMsg.length>0?(o.openBlock(),o.createBlock(u,{key:0,style:{padding:"12px"}},{default:o.withCtx(()=>[o.createVNode(p,{type:"error"},{default:o.withCtx(()=>[o.createTextVNode("Error: "+o.toDisplayString(i.errorMsg),1)]),_:1})]),_:1})):o.createCommentVNode("",!0),r.props.actions_inside_card&&s.hasUserTask&&i.actions.length>0?(o.openBlock(),o.createBlock(y,{key:1,actions:i.actions,actionCallback:s.actionFn,formIsFinished:i.formIsFinished,style:{padding:"16px","padding-top":"0px"}},null,8,["actions","actionCallback","formIsFinished"])):o.createCommentVNode("",!0)]),_:1},8,["class"])]))]),_:1})]),_:1},8,["modelValue","class"])])):(o.openBlock(),o.createElementBlock("p",Ap,[r.props.waiting_info.length>0||r.props.waiting_title.length>0?(o.openBlock(),o.createBlock(p,{key:0,text:r.props.waiting_info,title:r.props.waiting_title},null,8,["text","title"])):o.createCommentVNode("",!0)]))]),!r.props.actions_inside_card&&s.hasUserTask&&i.actions.length>0?(o.openBlock(),o.createElementBlock("div",Sp,[o.createVNode(y,{actions:i.actions,actionCallback:s.actionFn},null,8,["actions","actionCallback"])])):o.createCommentVNode("",!0),o.createVNode(A,{modelValue:i.imageModalOpen,"onUpdate:modelValue":t[1]||(t[1]=d=>i.imageModalOpen=d),"max-width":"800px"},{default:o.withCtx(()=>[i.modalImage?(o.openBlock(),o.createBlock(C,{key:0},{default:o.withCtx(()=>[o.createVNode(w,{class:"headline"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.modalImage.name),1)]),_:1}),o.createVNode(b,null,{default:o.withCtx(()=>[o.createElementVNode("img",{src:i.modalImage.url,alt:i.modalImage.name,style:{width:"100%","max-height":"70vh","object-fit":"contain"}},null,8,Tp),o.createElementVNode("div",Ep,[t[3]||(t[3]=o.createElementVNode("strong",null,"Size:",-1)),o.createTextVNode(" "+o.toDisplayString(s.formatFileSize(i.modalImage.size)),1),t[4]||(t[4]=o.createElementVNode("br",null,null,-1)),t[5]||(t[5]=o.createElementVNode("strong",null,"Type:",-1)),o.createTextVNode(" "+o.toDisplayString(i.modalImage.type),1)])]),_:1}),o.createVNode(k,null,{default:o.withCtx(()=>[o.createVNode(h),o.createVNode(v,{color:"primary",text:"",onClick:s.closeImageModal},{default:o.withCtx(()=>t[6]||(t[6]=[o.createTextVNode("Close")])),_:1},8,["onClick"])]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["modelValue"])],4)}const Rp=fn(up,[["render",Fp]]);ue.UIDynamicForm=Rp,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
58
+ `+ce),lt&&ar([g,F,N],Me=>{ce=At(ce,Me," ")}),d&&fr?d.createHTML(ce):ce},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vn(R),dn=!0},t.clearConfig=function(){pt=null,dn=!1},t.isValidAttribute=function(R,f,x){pt||vn({});const E=X(R),G=X(f);return qs(E,G,x)},t.addHook=function(R,f){typeof f=="function"&&Ct(O[R],f)},t.removeHook=function(R,f){if(f!==void 0){const x=Sf(O[R],f);return x===-1?void 0:Tf(O[R],x,1)[0]}return ds(O[R])},t.removeHooks=function(R){O[R]=[]},t.removeAllHooks=function(){O=xs()},t}var Hf=Cs();const fn=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Wf={name:"UIDynamicFormFooterAction",props:{actions:{type:Array,default(){return[]}},actionCallback:{type:Function,default(e){}},formIsFinished:{type:Boolean,default(){return!1}}},computed:{leftSideActions(){const e=this.actions.filter(r=>r.alignment==="left"||!r.alignment),t=(r,n)=>{const i=r.primary==="primary",s=n.primary==="primary";return i&&!s?-1:!i&&s?1:0};return e.sort(t)},rightSideActions(){const e=this.actions.filter(r=>r.alignment==="right"),t=(r,n)=>{const i=r.primary==="primary",s=n.primary==="primary";return!i&&s?-1:i&&!s?1:0};return e.sort(t)}},methods:{getActionButtonClass(e){switch(e.primary){case"primary":return"ui-dynamic-form-footer-action-primary";case"destructive":return"ui-dynamic-form-footer-action-terminate";case"secondary":default:return"ui-dynamic-form-footer-action-secondary"}}}},Kf={class:"ui-dynamic-form-footer-actions-container"},Gf={class:"ui-dynamic-form-footer-actions-left"},Zf={class:"ui-dynamic-form-footer-actions-right"};function Yf(e,t,r,n,i,s){const a=o.resolveComponent("v-btn");return o.openBlock(),o.createElementBlock("div",Kf,[o.createElementVNode("div",Gf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.leftSideActions,(l,c)=>(o.openBlock(),o.createElementBlock("div",{key:`left-${c}`},[o.createVNode(a,{class:o.normalizeClass(["ui-dynamic-form-footer-action-button",s.getActionButtonClass(l)]),disabled:r.formIsFinished,onClick:u=>r.actionCallback(l)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]),_:2},1032,["class","disabled","onClick"])]))),128))]),o.createElementVNode("div",Zf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rightSideActions,(l,c)=>(o.openBlock(),o.createElementBlock("div",{key:`right-${c}`},[o.createVNode(a,{class:o.normalizeClass(["ui-dynamic-form-footer-action-button",s.getActionButtonClass(l)]),disabled:r.formIsFinished,onClick:u=>r.actionCallback(l)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]),_:2},1032,["class","disabled","onClick"])]))),128))])])}const Jf=fn(Wf,[["render",Yf]]),Xf={name:"UIDynamicFormTitleText",props:{style:{type:String,default(){return"default"}},title:{type:String,default(){return""}},customStyles:{type:String,default(){return""}},collapsible:{type:Boolean,default(){return!1}},collapsed:{type:Boolean,default(){return!1}},titleIcon:{type:String,default(){return""}},toggleCollapse:{type:Function,default(){}}},computed:{typeSpecificStyling(){return`ui-dynamic-form-title-${this.style}`}}},Qf={key:0},ep=["fill"],tp=["fill"],rp=["src"],np={key:1};function ip(e,t,r,n,i,s){return r.title.length>0?(o.openBlock(),o.createElementBlock("div",Qf,[o.createElementVNode("h3",{class:o.normalizeClass([s.typeSpecificStyling,"ui-dynamic-form-title-responsive"]),style:{display:"flex",gap:"25px","align-items":"center"}},[r.collapsible&&!r.collapsed?(o.openBlock(),o.createElementBlock("svg",{key:0,style:{width:"25px",height:"25px",cursor:"pointer"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:t[0]||(t[0]=(...a)=>r.toggleCollapse&&r.toggleCollapse(...a))},[o.createElementVNode("path",{fill:r.style==="default"?"white":"black",d:"M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"},null,8,ep)])):o.createCommentVNode("",!0),r.collapsible&&r.collapsed?(o.openBlock(),o.createElementBlock("svg",{key:1,style:{width:"25px",height:"25px",cursor:"pointer"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",onClick:t[1]||(t[1]=(...a)=>r.toggleCollapse&&r.toggleCollapse(...a))},[o.createElementVNode("path",{fill:r.style==="default"?"white":"black",d:"M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"},null,8,tp)])):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle({width:"fit-content",display:r.style==="default"?"":"flex"})},[r.titleIcon.length>0?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.titleIcon,style:{"padding-right":"16px"}},null,8,rp)):o.createCommentVNode("",!0),o.createElementVNode("span",{style:o.normalizeStyle(r.customStyles)},o.toDisplayString(r.title),5),r.style==="default"?(o.openBlock(),o.createElementBlock("hr",np)):o.createCommentVNode("",!0)],4)],2)])):o.createCommentVNode("",!0)}const sp=fn(Xf,[["render",ip]]);function ap({value:e},[t,r],n){var a,l;return console.debug(arguments),!(((l=(a=n==null?void 0:n.root)==null?void 0:a.value)==null?void 0:l[t])===r&&(e===""||e===null||e===void 0))}class lp extends z.Renderer{link(t){return super.link(t).replace("<a","<a target='_blank'")}html(t){const r=super.html(t);return r.startsWith("<a ")&&!r.includes("target=")?r.replace("<a ",'<a target="_blank" '):r}}class op extends z.Hooks{postprocess(t){return Hf.sanitize(t,{ADD_ATTR:["target"]})}}function cp(e){return e?z.parse(e.toString(),{renderer:new lp,hooks:new op}):""}const up={name:"UIDynamicForm",components:{FormKit:Hr,UIDynamicFormFooterAction:Jf,UIDynamicFormTitleText:sp},inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!1,visible:!1})}},setup(e){console.info("UIDynamicForm setup with:",e),console.debug("Vue function loaded correctly",o.markRaw);const r=o.getCurrentInstance().appContext.app,n=Ur({theme:"genesis",locales:{de:Ll},locale:"de",rules:{requiredIf:ap}});r.use(Tu,n)},data(){return{actions:[],formData:{},originalFileData:{},userTask:null,theme:"",errorMsg:"",formIsFinished:!1,msg:null,collapsed:!1,firstFormFieldRef:null,imageModalOpen:!1,modalImage:null,objectUrlsByField:{},previewCache:{}}},computed:{dynamicClass(){return`ui-dynamic-form-${this.theme} ui-dynamic-form-common`},dynamicFooterClass(){return`ui-dynamic-form-footer-${this.theme} ui-dynamic-form-footer-common`},hasUserTask(){return!!this.userTask},totalOutputs(){const e=this.props.handle_confirmation_dialogs?this.props.confirm_actions?this.props.confirm_actions.length:2:0;return this.props.options.length+e+(this.props.trigger_on_change?1:0)},isConfirmDialog(){return this.userTask.userTaskConfig.formFields.some(e=>e.type==="confirm")},effectiveTitle(){return this.props.title_text_type==="str"?this.props.title_text:this.props.title_text_type==="msg"?this.msg.dynamicTitle:""}},watch:{formData:{handler(e,t){if(t&&(this.userTask&&this.userTask.userTaskConfig&&this.userTask.userTaskConfig.formFields&&this.userTask.userTaskConfig.formFields.filter(n=>n.type==="file").forEach(n=>{const i=n.id,s=e[i],a=t[i];s!==a&&this.originalFileData[i]&&this.hasActualFileObjects(s)&&(delete this.originalFileData[i],Object.keys(this.previewCache).forEach(c=>{c.startsWith(i+"_")&&delete this.previewCache[c]}),this.cleanupObjectUrls(i))}),this.props.trigger_on_change)){const r={payload:{formData:e,userTask:this.userTask}};this.send(r,this.totalOutputs-1)}},deep:!0},collapsed(e){!e&&this.hasUserTask&&o.nextTick(()=>{this.focusFirstFormField()})},userTask(e){e&&!this.collapsed&&o.nextTick(()=>{this.focusFirstFormField()})}},created(){const e=window.location.pathname,t=e.substring(e.lastIndexOf("/")),r=this.$store.state;for(const n in r.ui.pages)if(r.ui.pages[n].path===t){const i=r.ui.pages[n].theme;r.ui.themes[i].name==="ProcessCube Lightmode"?this.theme="light":r.ui.themes[i].name==="ProcessCube Darkmode"?this.theme="dark":this.theme="default";break}},mounted(){document.querySelectorAll(".formkit-input").forEach(t=>{t.classList.add("test")}),this.$socket.on("msg-input:"+this.id,t=>{this.init(t)}),this.$socket.emit("widget-load",this.id)},unmounted(){var e;(e=this.$socket)==null||e.off("msg-input:"+this.id),this.cleanupObjectUrls()},methods:{createComponent(e){const t=e.customForm?JSON.parse(JSON.stringify(e.customForm)):{},r=t.hint,n=t.placeholder,i=t.validation,s=e.id,a=t.customProperties??[],l=this.props.readonly||this.formIsFinished||a.find(c=>["readOnly","readonly"].includes(c.name)&&c.value==="true")?"true":void 0;switch(e.type){case"long":return{type:"FormKit",props:{type:"number",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],number:"integer",min:0,validation:i?`${i}|number`:"number",help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validationVisibility:"live"}};case"number":const c=e.customForm?JSON.parse(JSON.stringify(e.customForm)).step:void 0;return{type:"FormKit",props:{type:"number",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],step:c,number:"float",validation:i?`${i}|number`:"number",help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validationVisibility:"live"}};case"date":return{type:"FormKit",props:{type:"date",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"enum":const u=e.enumValues.map(A=>({value:A.id,label:A.name}));return{type:"FormKit",props:{type:"select",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:u,help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"select":const p=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"select",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:p,placeholder:n,help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"string":return{type:"FormKit",props:{type:"text",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"confirm":return{type:"h3",innerText:e.label};case"boolean":return{type:"FormKit",props:{type:"checkbox",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"file":const y=e.customForm?JSON.parse(JSON.stringify(e.customForm)).multiple==="true":!1;return{type:"div",props:{class:"ui-dynamic-form-file-wrapper"},isFileField:!0,field:e,multiple:y,isReadOnly:l,hint:r,validation:i,name:s};case"checkbox":const $=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"checkbox",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:$,help:r,fieldsetClass:"custom-fieldset",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"color":return{type:"FormKit",props:{type:"color",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"datetime-local":return{type:"FormKit",props:{type:"datetime-local",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"email":return{type:"FormKit",props:{type:"email",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"header":let w="h1";return e.customForm&&JSON.parse(JSON.stringify(e.customForm)).style==="heading_2"&&(w="h2"),e.customForm&&JSON.parse(JSON.stringify(e.customForm)).style==="heading_3"&&(w="h3"),{type:w,innerText:this.formData[e.id]};case"hidden":return{type:"input",props:{type:"hidden",value:this.formData[e.id]}};case"month":return{type:"FormKit",props:{type:"month",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"paragraph":const b=this.formData[e.id]||e.defaultValue||e.label||"";return{type:"div",innerHTML:cp(b),class:"ui-dynamic-form-paragraph"};case"password":return{type:"FormKit",props:{type:"password",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"radio":const v=JSON.parse(JSON.stringify(e.customForm)).entries.map(A=>({value:A.key,label:A.value}));return{type:"FormKit",props:{type:"radio",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],options:v,help:r,fieldsetClass:"custom-fieldset",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"range":const k=JSON.parse(JSON.stringify(e.customForm));return{type:"v-slider",props:{id:e.id,name:s,required:e.required,min:k.min,max:k.max,step:k.step,thumbLabel:!0,labelClass:"ui-dynamic-form-input-label",readonly:l,disabled:l,validation:i,validationVisibility:"live"}};case"tel":return{type:"FormKit",props:{type:"tel",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"textarea":const C=e.customForm?JSON.parse(JSON.stringify(e.customForm)).rows:void 0;return{type:"FormKit",props:{type:"textarea",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],rows:C,help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"time":return{type:"FormKit",props:{type:"time",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"url":return{type:"FormKit",props:{type:"url",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};case"week":return{type:"FormKit",props:{type:"week",id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,placeholder:n,wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}};default:return{type:"FormKit",props:{type:e.type,id:e.id,name:s,label:e.label,required:e.required,value:this.formData[e.id],help:r,labelClass:"ui-dynamic-form-input-label",inputClass:`input-${this.theme}`,innerClass:`ui-dynamic-form-input-outlines ${this.theme==="dark"?"$remove:formkit-inner":""}`,readonly:l,validation:i,validationVisibility:"live"}}}},toggleCollapse(){this.collapsed=!this.collapsed},getRowWidthStyling(e,t){let r="";return t===0&&(r+="margin-top: 12px;"),e.type,r+="flex-basis: 100%;",r},fields(){var r;return(((r=this.userTask.userTaskConfig)==null?void 0:r.formFields)??[]).map(n=>({...n,items:fp(n.type,n)}))},send(e,t){const r=[];r[t]=e,this.$socket.emit("widget-action",this.id,r)},init(e){if(this.msg=e,!e)return;if(this.originalFileData={},this.previewCache={},this.cleanupObjectUrls(),this.actions=this.props.options,e.payload&&e.payload.userTask)this.userTask=e.payload.userTask;else{this.userTask=null,this.formData={},this.originalFileData={},this.cleanupObjectUrls();return}const r=this.userTask.userTaskConfig.formFields,n=r.map(l=>l.id),i=this.userTask.startToken,s=e.payload.formData;this.formIsFinished=!!e.payload.formData,this.formIsFinished&&(this.collapsed=this.props.collapse_when_finished);const a=r.some(l=>l.type==="confirm");r&&r.forEach(l=>{var c,u,p,y;if(this.formData[l.id]=l.defaultValue,l.type==="confirm"){const $=l.customForm?JSON.parse(JSON.stringify(l.customForm)):{},w=$.confirmButtonText??"Confirm",b=$.declineButtonText??"Decline",h=[{alignment:((c=this.props.confirm_actions[1])==null?void 0:c.alignment)||"left",primary:((u=this.props.confirm_actions[1])==null?void 0:u.primary)||"destructive",label:b,condition:"",isConfirmAction:!0,confirmFieldId:l.id,confirmValue:!1},{alignment:((p=this.props.confirm_actions[0])==null?void 0:p.alignment)||"right",primary:((y=this.props.confirm_actions[0])==null?void 0:y.primary)||"primary",label:w,condition:"",isConfirmAction:!0,confirmFieldId:l.id,confirmValue:!0}],v=this.props.options.filter(k=>{if(!k.condition)return!0;try{const C={...this.userTask,isConfirmDialog:!0};return!!Function("fields","usertask","msg",'"use strict"; return ('+k.condition+")")(this.formData,C,this.msg)}catch(C){return console.error("Error while evaluating condition: "+C),!1}});this.actions=[...v,...h]}}),!a&&this.props.handle_confirmation_dialogs&&(this.actions=this.props.options.filter(l=>{if(!l.condition)return!0;try{const c={...this.userTask,isConfirmDialog:!1};return!!Function("fields","usertask","msg",'"use strict"; return ('+l.condition+")")(this.formData,c,this.msg)}catch(c){return console.error("Error while evaluating condition: "+c),!1}})),i&&Object.keys(i).filter(l=>n.includes(l)).forEach(l=>{const c=r.find(u=>u.id===l);c&&c.type==="file"?this.formData[l]=this.transformBase64ToFormKitFormat(i[l],c):this.formData[l]=i[l]}),this.formIsFinished&&Object.keys(s).filter(l=>n.includes(l)).forEach(l=>{const c=r.find(u=>u.id===l);c&&c.type==="file"?this.formData[l]=this.transformBase64ToFormKitFormat(s[l],c):this.formData[l]=s[l]}),o.nextTick(()=>{this.focusFirstFormField()})},async actionFn(e){if(e.isConfirmAction&&e.confirmFieldId&&(this.formData[e.confirmFieldId]=e.confirmValue),this.checkCondition(e.condition,{isConfirmDialog:this.isConfirmDialog})){this.showError("");let t={...this.formData};const r=this.userTask.userTaskConfig.formFields;try{t=await this.processFileFields(t,r)}catch{this.showError("Fehler beim Verarbeiten der Dateien");return}r.forEach(s=>{const a=t[s.id];if((s.type==="number"||s.type==="long")&&a!=null&&a!=="")if(s.type==="long"){const l=Number.parseInt(a,10);isNaN(l)||(t[s.id]=l)}else{const l=Number.parseFloat(a);isNaN(l)||(t[s.id]=l)}});const n=this.msg??{};n.payload={formData:t,userTask:this.userTask};let i;if(e.isConfirmAction){const s=e.confirmValue?1:0;i=this.props.options.length+s}else i=this.props.options.findIndex(s=>s.label===e.label);this.send(n,i)}else this.showError(e.errorMessage)},checkCondition(e,t={}){if(e==="")return!0;try{const r={...this.userTask,isConfirmDialog:t.isConfirmDialog||!1};return!!Function("fields","usertask","msg",'"use strict"; return ('+e+")")(this.formData,r,this.msg)}catch(r){return console.error("Error while evaluating condition: "+r),!1}},showError(e){this.errorMsg=e},focusFirstFormField(){if(!(this.collapsed||!this.hasUserTask)&&this.firstFormFieldRef){let e=null;this.firstFormFieldRef.node&&this.firstFormFieldRef.node.input instanceof HTMLElement?e=this.firstFormFieldRef.node.input:this.firstFormFieldRef.$el instanceof HTMLElement&&(["INPUT","TEXTAREA","SELECT"].includes(this.firstFormFieldRef.$el.tagName)?e=this.firstFormFieldRef.$el:e=this.firstFormFieldRef.$el.querySelector('input:not([type="hidden"]), textarea, select')),e?e.focus():console.warn("Could not find a focusable input element for the first form field.")}},transformBase64ToFormKitFormat(e,t){if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0].name&&!e[0].data)return e;const r=t.id,n=t.customForm?JSON.parse(JSON.stringify(t.customForm)).multiple==="true":!1;if(e&&typeof e=="object"&&e.name&&e.data){this.originalFileData[r]=e;const i={name:e.name};return n?[i]:[i]}return Array.isArray(e)?(this.originalFileData[r]=e,e.filter(s=>s&&typeof s=="object"&&s.name).map(s=>({name:s.name}))):[]},hasActualFileObjects(e){return e?Array.isArray(e)?e.some(t=>t instanceof File||t&&t.file instanceof File||t&&t.file instanceof FileList&&t.file.length>0):e instanceof File||e instanceof FileList&&e.length>0||e&&e.file instanceof File||e&&e.file instanceof FileList&&e.file.length>0:!1},async convertFileToBase64(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const i=n.result.split(",")[1];t({name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,data:i})},n.onerror=r,n.readAsDataURL(e)})},async processFileFields(e,t){const r={...e};for(const n of t)if(n.type==="file"){const i=r[n.id],s=n.id;if(this.originalFileData[s]){r[s]=this.originalFileData[s];continue}if(i){const a=n.customForm?JSON.parse(JSON.stringify(n.customForm)).multiple==="true":!1;if(a&&Array.isArray(i)){const l=[];for(const c of i){const u=await this.processIndividualFile(c);u&&l.push(u)}r[n.id]=l}else if(Array.isArray(i)){const l=[];for(const c of i){const u=await this.processIndividualFile(c);u&&l.push(u)}r[n.id]=a?l:l[0]||null}else if(i){const l=await this.processIndividualFile(i);l&&(r[n.id]=l)}}}return r},async processIndividualFile(e){let t=null;if(e instanceof File)t=e;else if(e instanceof FileList&&e.length>0)t=e[0];else if(e&&e.file instanceof File)t=e.file;else if(e&&e.file instanceof FileList&&e.file.length>0)t=e.file[0];else if(Array.isArray(e)&&e.length>0)e[0]instanceof File?t=e[0]:e[0]&&e[0].file instanceof File?t=e[0].file:e[0]&&e[0].file instanceof FileList&&e[0].file.length>0&&(t=e[0].file[0]);else if(typeof e=="object"&&e.data&&e.name)return e;return t instanceof File?await this.convertFileToBase64(t):(e&&typeof e=="object"&&!e.data&&console.warn("Could not process file data:",e),e)},isImageFile(e){if(!e||typeof e!="object")return!1;const t=e.type;return t?t.startsWith("image/"):!1},generateImagePreviewUrl(e){return!e||!e.data||!e.type?null:`data:${e.type};base64,${e.data}`},getFilePreviewsForField(e){const t=this.formData[e]||null,r=this.originalFileData[e]||null,n=`${e}_${JSON.stringify(t)}_${JSON.stringify(r)}`;if(this.previewCache[n])return this.previewCache[n];const i=this.formData[e],s=this.originalFileData[e];if(!i&&!s)return this.previewCache[n]=[],[];let a=[];return i&&Array.isArray(i)&&i.length>0&&this.hasActualFileObjects(i)?a=this.generatePreviewsFromCurrentFiles(i,e):s&&(a=(Array.isArray(s)?s:[s]).filter(u=>this.isImageFile(u)).map(u=>({name:u.name,url:this.generateImagePreviewUrl(u),size:u.size,type:u.type}))),this.previewCache[n]=a,a},generatePreviewsFromCurrentFiles(e,t=null){return t&&this.objectUrlsByField[t]?(this.objectUrlsByField[t].forEach(n=>URL.revokeObjectURL(n)),this.objectUrlsByField[t]=[]):t&&(this.objectUrlsByField[t]=[]),e.filter(n=>{let i=null;return n instanceof File?i=n:n&&n.file instanceof File?i=n.file:Array.isArray(n)&&n[0]instanceof File&&(i=n[0]),i&&i.type&&i.type.startsWith("image/")}).map(n=>{let i=null;n instanceof File?i=n:n&&n.file instanceof File?i=n.file:Array.isArray(n)&&n[0]instanceof File&&(i=n[0]);const s=i?URL.createObjectURL(i):null;return s&&t&&(this.objectUrlsByField[t]||(this.objectUrlsByField[t]=[]),this.objectUrlsByField[t].push(s)),{name:i.name,url:s,size:i.size,type:i.type,isObjectUrl:!0}}).filter(n=>n.url!==null)},formatFileSize(e){if(!e)return"0 B";const t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]},openImageModal(e){this.modalImage=e,this.imageModalOpen=!0},closeImageModal(){this.imageModalOpen=!1,this.modalImage=null},cleanupObjectUrls(e=null){e?(this.objectUrlsByField[e]&&(this.objectUrlsByField[e].forEach(t=>{URL.revokeObjectURL(t)}),this.objectUrlsByField[e]=[]),Object.keys(this.previewCache).forEach(t=>{t.startsWith(e+"_")&&delete this.previewCache[t]})):(Object.keys(this.objectUrlsByField).forEach(t=>{this.objectUrlsByField[t].forEach(r=>{URL.revokeObjectURL(r)})}),this.objectUrlsByField={},this.previewCache={})}}};function fp(e,t){return e==="enum"?t.enumValues.map(r=>({title:r.name,value:r.id})):null}const pp={className:"ui-dynamic-form-wrapper"},mp={key:0,style:{"margin-bottom":"0px"}},hp={key:0},dp=["data-columns"],gp={key:2},yp={class:"formkit-label"},bp={class:"formkit-help"},_p={key:3,class:"ui-dynamic-form-file-wrapper"},kp={key:0,class:"ui-dynamic-form-image-previews"},vp={class:"ui-dynamic-form-preview-grid"},wp=["src","alt","onClick"],$p={class:"ui-dynamic-form-preview-info"},xp={class:"ui-dynamic-form-preview-name"},Cp={class:"ui-dynamic-form-preview-size"},Ap={key:1},Sp={key:1,style:{"padding-top":"32px"}},Tp=["src","alt"],Ep={style:{"margin-top":"16px"}};function Fp(e,t,r,n,i,s){const a=o.resolveComponent("UIDynamicFormTitleText"),l=o.resolveComponent("FormKit"),c=o.resolveComponent("v-col"),u=o.resolveComponent("v-row"),p=o.resolveComponent("v-alert"),y=o.resolveComponent("UIDynamicFormFooterAction"),$=o.resolveComponent("v-form"),w=o.resolveComponent("v-card-title"),b=o.resolveComponent("v-card-text"),h=o.resolveComponent("v-spacer"),v=o.resolveComponent("v-btn"),k=o.resolveComponent("v-card-actions"),C=o.resolveComponent("v-card"),A=o.resolveComponent("v-dialog");return o.openBlock(),o.createElementBlock("div",{className:"ui-dynamic-form-external-sizing-wrapper",style:o.normalizeStyle(r.props.card_size_styling)},[r.props.title_style==="outside"&&s.hasUserTask?(o.openBlock(),o.createBlock(a,{key:0,style:o.normalizeStyle(r.props.title_style),title:s.effectiveTitle,customStyles:r.props.title_custom_text_styling,titleIcon:r.props.title_icon,collapsible:r.props.collapsible||r.props.collapse_when_finished&&i.formIsFinished,collapsed:i.collapsed,toggleCollapse:s.toggleCollapse},null,8,["style","title","customStyles","titleIcon","collapsible","collapsed","toggleCollapse"])):o.createCommentVNode("",!0),o.createElementVNode("div",pp,[s.hasUserTask?(o.openBlock(),o.createElementBlock("p",mp,[o.createVNode($,{ref:"form",modelValue:e.form,"onUpdate:modelValue":t[0]||(t[0]=d=>e.form=d),class:o.normalizeClass(s.dynamicClass)},{default:o.withCtx(()=>[r.props.title_style!="outside"?(o.openBlock(),o.createBlock(a,{key:0,style:o.normalizeStyle(r.props.title_style),title:s.effectiveTitle,customStyles:r.props.title_custom_text_styling,titleIcon:r.props.title_icon,collapsible:r.props.collapsible||r.props.collapse_when_finished&&i.formIsFinished,collapsed:i.collapsed,toggleCollapse:s.toggleCollapse},null,8,["style","title","customStyles","titleIcon","collapsible","collapsed","toggleCollapse"])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{name:"cardCollapse"},{default:o.withCtx(()=>[i.collapsed?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",hp,[o.createElementVNode("div",{className:"ui-dynamic-form-formfield-positioner",style:o.normalizeStyle(r.props.inner_card_styling),"data-columns":r.props.form_columns||1},[o.createVNode(l,{id:"form",type:"group"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.fields(),(d,T)=>(o.openBlock(),o.createBlock(u,{key:d,class:o.normalizeClass(d.type==="header"?"ui-dynamic-form-header-row":""),style:o.normalizeStyle(s.getRowWidthStyling(d,T))},{default:o.withCtx(()=>[o.createVNode(c,{cols:"12"},{default:o.withCtx(()=>[s.createComponent(d).innerHTML?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:0,ref_for:!0},s.createComponent(d).props,{class:s.createComponent(d).class,innerHTML:s.createComponent(d).innerHTML,ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)}}),null,16,["class","innerHTML"])):s.createComponent(d).innerText?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:1,ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m}),{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.createComponent(d).innerText),1)]),_:2},1040,["modelValue","onUpdate:modelValue"])):s.createComponent(d).type=="v-slider"?(o.openBlock(),o.createElementBlock("div",gp,[o.createElementVNode("p",yp,o.toDisplayString(d.label),1),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:d.defaultValue,"onUpdate:modelValue":m=>d.defaultValue=m}),null,16,["modelValue","onUpdate:modelValue"])),o.createElementVNode("p",bp,o.toDisplayString(d.customForm?d.customForm.hint:void 0),1)])):s.createComponent(d).isFileField?(o.openBlock(),o.createElementBlock("div",_p,[s.getFilePreviewsForField(d.id).length>0?(o.openBlock(),o.createElementBlock("div",kp,[t[2]||(t[2]=o.createElementVNode("h4",null,"Current files:",-1)),o.createElementVNode("div",vp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.getFilePreviewsForField(d.id),m=>(o.openBlock(),o.createElementBlock("div",{key:m.name,class:"ui-dynamic-form-preview-item"},[o.createElementVNode("img",{src:m.url,alt:m.name,class:"ui-dynamic-form-preview-image",onClick:_=>s.openImageModal(m)},null,8,wp),o.createElementVNode("div",$p,[o.createElementVNode("span",xp,o.toDisplayString(m.name),1),o.createElementVNode("span",Cp,o.toDisplayString(s.formatFileSize(m.size)),1)])]))),128))])])):o.createCommentVNode("",!0),o.createVNode(l,{type:"file",id:d.id,name:s.createComponent(d).name,label:d.label,required:d.required,modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m,help:s.createComponent(d).hint,innerClass:"reset-background",wrapperClass:"$remove:formkit-wrapper",labelClass:"ui-dynamic-form-input-label",inputClass:`input-${i.theme}`,readonly:s.createComponent(d).isReadOnly,disabled:s.createComponent(d).isReadOnly,multiple:s.createComponent(d).multiple,validation:s.createComponent(d).validation,validationVisibility:"live",ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)}},null,8,["id","name","label","required","modelValue","onUpdate:modelValue","help","inputClass","readonly","disabled","multiple","validation"])])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.createComponent(d).type),o.mergeProps({key:4,ref_for:!0},s.createComponent(d).props,{ref_for:!0,ref:m=>{T===0&&(i.firstFormFieldRef=m)},modelValue:i.formData[d.id],"onUpdate:modelValue":m=>i.formData[d.id]=m}),null,16,["modelValue","onUpdate:modelValue"]))]),_:2},1024)]),_:2},1032,["class","style"]))),128))]),_:1})],12,dp),o.createVNode(u,{class:o.normalizeClass(s.dynamicFooterClass)},{default:o.withCtx(()=>[i.errorMsg.length>0?(o.openBlock(),o.createBlock(u,{key:0,style:{padding:"12px"}},{default:o.withCtx(()=>[o.createVNode(p,{type:"error"},{default:o.withCtx(()=>[o.createTextVNode("Error: "+o.toDisplayString(i.errorMsg),1)]),_:1})]),_:1})):o.createCommentVNode("",!0),r.props.actions_inside_card&&s.hasUserTask&&i.actions.length>0?(o.openBlock(),o.createBlock(y,{key:1,actions:i.actions,actionCallback:s.actionFn,formIsFinished:i.formIsFinished,style:{padding:"16px","padding-top":"0px"}},null,8,["actions","actionCallback","formIsFinished"])):o.createCommentVNode("",!0)]),_:1},8,["class"])]))]),_:1})]),_:1},8,["modelValue","class"])])):(o.openBlock(),o.createElementBlock("p",Ap,[r.props.waiting_info.length>0||r.props.waiting_title.length>0?(o.openBlock(),o.createBlock(p,{key:0,text:r.props.waiting_info,title:r.props.waiting_title},null,8,["text","title"])):o.createCommentVNode("",!0)]))]),!r.props.actions_inside_card&&s.hasUserTask&&i.actions.length>0?(o.openBlock(),o.createElementBlock("div",Sp,[o.createVNode(y,{actions:i.actions,actionCallback:s.actionFn},null,8,["actions","actionCallback"])])):o.createCommentVNode("",!0),o.createVNode(A,{modelValue:i.imageModalOpen,"onUpdate:modelValue":t[1]||(t[1]=d=>i.imageModalOpen=d),"max-width":"800px"},{default:o.withCtx(()=>[i.modalImage?(o.openBlock(),o.createBlock(C,{key:0},{default:o.withCtx(()=>[o.createVNode(w,{class:"headline"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.modalImage.name),1)]),_:1}),o.createVNode(b,null,{default:o.withCtx(()=>[o.createElementVNode("img",{src:i.modalImage.url,alt:i.modalImage.name,style:{width:"100%","max-height":"70vh","object-fit":"contain"}},null,8,Tp),o.createElementVNode("div",Ep,[t[3]||(t[3]=o.createElementVNode("strong",null,"Size:",-1)),o.createTextVNode(" "+o.toDisplayString(s.formatFileSize(i.modalImage.size)),1),t[4]||(t[4]=o.createElementVNode("br",null,null,-1)),t[5]||(t[5]=o.createElementVNode("strong",null,"Type:",-1)),o.createTextVNode(" "+o.toDisplayString(i.modalImage.type),1)])]),_:1}),o.createVNode(k,null,{default:o.withCtx(()=>[o.createVNode(h),o.createVNode(v,{color:"primary",text:"",onClick:s.closeImageModal},{default:o.withCtx(()=>t[6]||(t[6]=[o.createTextVNode("Close")])),_:1},8,["onClick"])]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["modelValue"])],4)}const Rp=fn(up,[["render",Fp]]);ue.UIDynamicForm=Rp,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
@@ -988,8 +988,6 @@ export default {
988
988
  const formFields = this.userTask.userTaskConfig.formFields;
989
989
  const formFieldIds = formFields.map((ff) => ff.id);
990
990
  const initialValues = this.userTask.startToken;
991
- console.log('Initial Values:', initialValues);
992
- console.log('Form Fields:', formFields);
993
991
  const finishedFormData = msg.payload.formData;
994
992
  this.formIsFinished = !!msg.payload.formData;
995
993
  if (this.formIsFinished) {
@@ -1109,14 +1107,8 @@ export default {
1109
1107
  const formFields = this.userTask.userTaskConfig.formFields;
1110
1108
 
1111
1109
  try {
1112
- console.log(
1113
- 'Processing file fields:',
1114
- formFields.filter((f) => f.type === 'file')
1115
- );
1116
1110
  processedFormData = await this.processFileFields(processedFormData, formFields);
1117
- console.log('File processing completed successfully');
1118
1111
  } catch (error) {
1119
- console.error('Error processing file fields:', error);
1120
1112
  this.showError('Fehler beim Verarbeiten der Dateien');
1121
1113
  return;
1122
1114
  }
@@ -1309,7 +1301,6 @@ export default {
1309
1301
 
1310
1302
  if (this.originalFileData[fieldId]) {
1311
1303
  processedData[fieldId] = this.originalFileData[fieldId];
1312
- console.log(`Using original file data for field ${fieldId}:`, this.originalFileData[fieldId]);
1313
1304
  continue;
1314
1305
  }
1315
1306