UNPKG

@digital-blueprint/formalize-app

Version:

[GitHub Repository](https://github.com/digital-blueprint/formalize-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/formalize-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/formalize-app/) | [Formalize Bundle](https:

544 lines • 87.8 kB
/*!
* License: LGPL-2.1-or-later
* Dependencies:
* 
* @webcomponents/scoped-custom-element-registry: BSD-3-Clause
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* lit-html: BSD-3-Clause
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/auth: LGPL-2.1-or-later
* @dbp-toolkit/theme-switcher: LGPL-2.1-or-later
* universal-router: MIT
* @dbp-toolkit/matomo: LGPL-2.1-or-later
* cssfilter: MIT
* xss: MIT
* @dbp-toolkit/form-elements: LGPL-2.1-or-later
* html2pdf.js: MIT
* exceljs: MIT
* jspdf-autotable: MIT
* keycloak-js: Apache-2.0
* pdfjs-dist: Apache-2.0
* jszip: (MIT OR GPL-3.0-or-later)
* @babel/runtime: MIT
* fflate: MIT
* iobuffer: MIT
* pako: (MIT AND Zlib)
* fast-png: MIT
* jspdf: MIT
* core-js: MIT
* performance-now: MIT
* raf: MIT
* rgbcolor: MIT OR SEE LICENSE IN FEEL-FREE.md
* svg-pathdata: MIT
* stackblur-canvas: MIT
* canvg: MIT
* dompurify: (MPL-2.0 OR Apache-2.0)
* i18next: MIT
* @dbp-toolkit/common: LGPL-2.1-or-later
* @lit/reactive-element: BSD-3-Clause
* lit-element: BSD-3-Clause
* @open-wc/dedupe-mixin: MIT
* @open-wc/scoped-elements: MIT
* dialog-polyfill: BSD
* jquery: MIT
* select2: MIT
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/tabulator-table: LGPL-2.1-or-later
* tabulator-tables: MIT
* @dbp-toolkit/file-handling: LGPL-2.1-or-later
* webdav: MIT
* jose: MIT
* file-saver: MIT
* @dbp-toolkit/grant-permission-dialog: LGPL-2.1-or-later
* @dbp-toolkit/pdf-viewer: LGPL-2.1-or-later
* @dbp-toolkit/resource-select: LGPL-2.1-or-later
* @popperjs/core: MIT
* tippy.js: MIT
* @dbp-toolkit/tooltip: LGPL-2.1-or-later
*/
import{_ as e,a as t,c as n,g as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d,x as f,y as p}from"./ref.DqB7ABXf.js";import{A as m,I as h,J as g,O as _,Q as v,X as y,c as b,g as x,k as S,l as C,p as w,s as T,v as E}from"./directive-helpers.C6Xz79AM.js";import{c as D,h as O,l as k,m as A,p as j,u as M}from"./select2.min.DRitHUO_.js";var N=`bottom`,P=`right`,F=`left`,ee=`auto`,I=[`top`,N,P,F],L=`start`,te=`clippingParents`,ne=`viewport`,R=`popper`,re=`reference`,ie=/*#__PURE__*/ I.reduce(function(e,t){return e.concat([t+`-`+L,t+`-end`])},[]),ae=/*#__PURE__*/ [].concat(I,[ee]).reduce(function(e,t){return e.concat([t,t+`-`+L,t+`-end`])},[]),z=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function B(e){return e?(e.nodeName||``).toLowerCase():null}function V(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof V(e).Element||e instanceof Element}function U(e){return e instanceof V(e).HTMLElement||e instanceof HTMLElement}function oe(e){return typeof ShadowRoot>`u`?!1:e instanceof V(e).ShadowRoot||e instanceof ShadowRoot}function se(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];U(i)&&B(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function ce(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});U(r)&&B(r)&&(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var le={name:`applyStyles`,enabled:!0,phase:`write`,fn:se,effect:ce,requires:[`computeStyles`]};function W(e){return e.split(`-`)[0]}var G=Math.max,K=Math.min,q=Math.round;function J(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function ue(){return!/^((?!chrome|android).)*safari/i.test(J())}function Y(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&U(e)&&(i=e.offsetWidth>0&&q(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&q(r.height)/e.offsetHeight||1);var o=(H(e)?V(e):window).visualViewport,s=!ue()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function de(e){var t=Y(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function fe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&oe(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function X(e){return V(e).getComputedStyle(e)}function pe(e){return[`table`,`td`,`th`].indexOf(B(e))>=0}function Z(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function me(e){return B(e)===`html`?e:e.assignedSlot||e.parentNode||(oe(e)?e.host:null)||Z(e)}function he(e){return!U(e)||X(e).position===`fixed`?null:e.offsetParent}function ge(e){var t=/firefox/i.test(J());if(/Trident/i.test(J())&&U(e)&&X(e).position===`fixed`)return null;var n=me(e);for(oe(n)&&(n=n.host);U(n)&&[`html`,`body`].indexOf(B(n))<0;){var r=X(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function _e(e){for(var t=V(e),n=he(e);n&&pe(n)&&X(n).position===`static`;)n=he(n);return n&&(B(n)===`html`||B(n)===`body`&&X(n).position===`static`)?t:n||ge(e)||t}function ve(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function ye(e,t,n){return G(e,K(t,n))}function be(e,t,n){var r=ye(e,t,n);return r>n?n:r}function xe(){return{top:0,right:0,bottom:0,left:0}}function Se(e){return Object.assign({},xe(),e)}function Ce(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var we=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,Se(typeof e==`number`?Ce(e,I):e)};function Te(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=W(n.placement),c=ve(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(a&&o){var u=we(i.padding,n),d=de(a),f=c===`y`?`top`:F,p=c===`y`?N:P,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=_e(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=ye(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function Ee(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||fe(t.elements.popper,r)&&(t.elements.arrow=r))}var De={name:`arrow`,enabled:!0,phase:`main`,fn:Te,effect:Ee,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function Oe(e){return e.split(`-`)[1]}var ke={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function Ae(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:q(n*i)/i||0,y:q(r*i)/i||0}}function je(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=F,b=`top`,x=window;if(l){var S=_e(n),C=`clientHeight`,w=`clientWidth`;if(S===V(n)&&(S=Z(n),X(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=N;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=P;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&ke),O=u===!0?Ae({x:p,y:h},V(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function Me(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:W(t.placement),variation:Oe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,je(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,je(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Ne={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:Me,data:{}},Pe={passive:!0};function Fe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=V(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,Pe)}),s&&c.addEventListener(`resize`,n.update,Pe),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,Pe)}),s&&c.removeEventListener(`resize`,n.update,Pe)}}var Ie={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:Fe,data:{}},Le={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Re(e){return e.replace(/left|right|bottom|top/g,function(e){return Le[e]})}var ze={start:`end`,end:`start`};function Be(e){return e.replace(/start|end/g,function(e){return ze[e]})}function Ve(e){var t=V(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function He(e){return Y(Z(e)).left+Ve(e).scrollLeft}function Ue(e,t){var n=V(e),r=Z(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=ue();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+He(e),y:c}}function We(e){var t=Z(e),n=Ve(e),r=e.ownerDocument?.body,i=G(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=G(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+He(e),s=-n.scrollTop;return X(r||t).direction===`rtl`&&(o+=G(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function Ge(e){var t=X(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ke(e){return[`html`,`body`,`#document`].indexOf(B(e))>=0?e.ownerDocument.body:U(e)&&Ge(e)?e:Ke(me(e))}function qe(e,t){t===void 0&&(t=[]);var n=Ke(e),r=n===e.ownerDocument?.body,i=V(n),a=r?[i].concat(i.visualViewport||[],Ge(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(qe(me(a)))}function Je(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ye(e,t){var n=Y(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Xe(e,t,n){return t===`viewport`?Je(Ue(e,n)):H(t)?Ye(t,n):Je(We(Z(e)))}function Ze(e){var t=qe(me(e)),n=[`absolute`,`fixed`].indexOf(X(e).position)>=0&&U(e)?_e(e):e;return H(n)?t.filter(function(e){return H(e)&&fe(e,n)&&B(e)!==`body`}):[]}function Qe(e,t,n,r){var i=t===`clippingParents`?Ze(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=Xe(e,n,r);return t.top=G(i.top,t.top),t.right=K(i.right,t.right),t.bottom=K(i.bottom,t.bottom),t.left=G(i.left,t.left),t},Xe(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function $e(e){var t=e.reference,n=e.element,r=e.placement,i=r?W(r):null,a=r?Oe(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case N:c={x:o,y:t.y+t.height};break;case P:c={x:t.x+t.width,y:s};break;case F:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?ve(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case L:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2)}}return c}function et(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?te:s,l=n.rootBoundary,u=l===void 0?ne:l,d=n.elementContext,f=d===void 0?R:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=Se(typeof g==`number`?Ce(g,I):g),v=f===`popper`?re:R,y=e.rects.popper,b=e.elements[m?v:f],x=Qe(H(b)?b:b.contextElement||Z(e.elements.popper),c,u,o),S=Y(e.elements.reference),C=$e({reference:S,element:y,strategy:`absolute`,placement:i}),w=Je(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function tt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?ae:c,u=Oe(r),d=u?s?ie:ie.filter(function(e){return Oe(e)===u}):I,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=et(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[W(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function nt(e){if(W(e)===`auto`)return[];var t=Re(e);return[Be(e),t,Be(t)]}function rt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=W(g)===g,v=c||(_||!m?[Re(g)]:nt(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(W(n)===`auto`?tt(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=/* @__PURE__ */ new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=W(E),O=Oe(E)===L,k=[`top`,N].indexOf(D)>=0,A=k?`width`:`height`,j=et(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?P:F:O?N:`top`;b[A]>x[A]&&(M=Re(M));var ee=Re(M),I=[];if(a&&I.push(j[D]<=0),s&&I.push(j[M]<=0,j[ee]<=0),I.every(function(e){return e})){w=E,C=!1;break}S.set(E,I)}if(C)for(var te=m?3:1,ne=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},R=te;R>0&&ne(R)!==`break`;R--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var it={name:`flip`,enabled:!0,phase:`main`,fn:rt,requiresIfExists:[`offset`],data:{_skip:!1}};function at(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ot(e){return[`top`,P,N,F].some(function(t){return e[t]>=0})}function st(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=et(t,{elementContext:`reference`}),s=et(t,{altBoundary:!0}),c=at(o,r),l=at(s,i,a),u=ot(c),d=ot(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var ct={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:st};function lt(e,t,n){var r=W(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function ut(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=ae.reduce(function(e,n){return e[n]=lt(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var dt={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:ut};function ft(e){var t=e.state,n=e.name;t.modifiersData[n]=$e({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var pt={name:`popperOffsets`,enabled:!0,phase:`read`,fn:ft,data:{}};function mt(e){return e===`x`?`y`:`x`}function ht(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=et(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=W(t.placement),v=Oe(t.placement),y=!v,b=ve(_),x=mt(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:F,A=b===`y`?N:P,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],I=M-g[A],L=p?-w[j]/2:0,te=v===`start`?C[j]:w[j],ne=v===`start`?-w[j]:-C[j],R=t.elements.arrow,re=p&&R?de(R):{width:0,height:0},ie=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:xe(),ae=ie[k],z=ie[A],B=ye(0,C[j],re[j]),V=y?C[j]/2-L-B-ae-E.mainAxis:te-B-ae-E.mainAxis,H=y?-C[j]/2+L+B+z+E.mainAxis:ne+B+z+E.mainAxis,U=t.elements.arrow&&_e(t.elements.arrow),oe=U?b===`y`?U.clientTop||0:U.clientLeft||0:0,se=D?.[b]??0,ce=M+V-se-oe,le=M+H-se,q=ye(p?K(ee,ce):ee,M,p?G(I,le):I);S[b]=q,O[b]=q-M}if(s){var J=b===`x`?`top`:F,ue=b===`x`?N:P,Y=S[x],fe=x===`y`?`height`:`width`,X=Y+g[J],pe=Y-g[ue],Z=[`top`,F].indexOf(_)!==-1,me=D?.[x]??0,he=Z?X:Y-C[fe]-w[fe]-me+E.altAxis,ge=Z?Y+C[fe]+w[fe]-me-E.altAxis:pe,Se=p&&Z?be(he,Y,ge):ye(p?he:X,Y,p?ge:pe);S[x]=Se,O[x]=Se-Y}t.modifiersData[r]=O}}var gt={name:`preventOverflow`,enabled:!0,phase:`main`,fn:ht,requiresIfExists:[`offset`]};function _t(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function vt(e){return e===V(e)||!U(e)?Ve(e):_t(e)}function yt(e){var t=e.getBoundingClientRect(),n=q(t.width)/e.offsetWidth||1,r=q(t.height)/e.offsetHeight||1;return n!==1||r!==1}function bt(e,t,n){n===void 0&&(n=!1);var r=U(t),i=U(t)&&yt(t),a=Z(t),o=Y(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((B(t)!==`body`||Ge(a))&&(s=vt(t)),U(t)?(c=Y(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=He(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function xt(e){var t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function St(e){var t=xt(e);return z.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function Ct(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function wt(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Tt={placement:`bottom`,modifiers:[],strategy:`absolute`};function Et(){return![...arguments].some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function Dt(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Tt:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Tt,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:H(e)?qe(e):e.contextElement?qe(e.contextElement):[],popper:qe(t)};var s=St(wt([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(Et(t,n)){i.rects={reference:bt(t,_e(n),i.options.strategy===`fixed`),popper:de(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:Ct(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!Et(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var Ot=/*#__PURE__*/ Dt({defaultModifiers:[Ie,pt,Ne,le,dt,it,gt,De,ct]}),kt=`tippy-box`,At=`tippy-content`,jt=`tippy-backdrop`,Mt=`tippy-arrow`,Nt=`tippy-svg-arrow`,Pt={passive:!0,capture:!0},Ft=function(){return document.body};function It(e,t,n){return Array.isArray(e)?e[t]??(Array.isArray(n)?n[t]:n):e}function Lt(e,t){var n={}.toString.call(e);return n.indexOf(`[object`)===0&&n.indexOf(t+`]`)>-1}function Rt(e,t){return typeof e==`function`?e.apply(void 0,t):e}function zt(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Bt(e){return e.split(/\s+/).filter(Boolean)}function Vt(e){return[].concat(e)}function Ht(e,t){e.indexOf(t)===-1&&e.push(t)}function Ut(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Wt(e){return e.split(`-`)[0]}function Gt(e){return[].slice.call(e)}function Kt(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function qt(){return document.createElement(`div`)}function Jt(e){return[`Element`,`Fragment`].some(function(t){return Lt(e,t)})}function Yt(e){return Lt(e,`NodeList`)}function Xt(e){return Lt(e,`MouseEvent`)}function Zt(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Qt(e){return Jt(e)?[e]:Yt(e)?Gt(e):Array.isArray(e)?e:Gt(document.querySelectorAll(e))}function $t(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+`ms`)})}function en(e,t){e.forEach(function(e){e&&e.setAttribute(`data-state`,t)})}function tn(e){var t,n=Vt(e)[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function nn(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,a=e.props.interactiveBorder,o=Wt(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c=o===`bottom`?s.top.y:0,l=o===`top`?s.bottom.y:0,u=o===`right`?s.left.x:0,d=o===`left`?s.right.x:0,f=t.top-r+c>a,p=r-t.bottom-l>a,m=t.left-n+u>a,h=n-t.right-d>a;return f||p||m||h})}function rn(e,t,n){var r=t+`EventListener`;[`transitionend`,`webkitTransitionEnd`].forEach(function(t){e[r](t,n)})}function an(e,t){for(var n=t;n;){if(e.contains(n))return!0;n=n.getRootNode==null?void 0:n.getRootNode()?.host}return!1}var Q={isTouch:!1},on=0;function sn(){Q.isTouch||(Q.isTouch=!0,window.performance&&document.addEventListener(`mousemove`,cn))}function cn(){var e=performance.now();e-on<20&&(Q.isTouch=!1,document.removeEventListener(`mousemove`,cn)),on=e}function ln(){var e=document.activeElement;if(Zt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function un(){document.addEventListener(`touchstart`,sn,Pt),window.addEventListener(`blur`,ln)}var dn=typeof window<`u`&&typeof document<`u`&&!!window.msCrypto,$=Object.assign({appendTo:Ft,aria:{content:`auto`,expanded:`auto`},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:``,offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:`top`,plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:`mouseenter focus`,triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:`fade`,arrow:!0,content:``,inertia:!1,maxWidth:350,role:`tooltip`,theme:``,zIndex:9999}),fn=Object.keys($),pn=function(e){Object.keys(e).forEach(function(t){$[t]=e[t]})};function mn(e){var t=(e.plugins||[]).reduce(function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=e[r]===void 0?$[r]??i:e[r]),t},{});return Object.assign({},e,t)}function hn(e,t){return(t?Object.keys(mn(Object.assign({},$,{plugins:t}))):fn).reduce(function(t,n){var r=(e.getAttribute(`data-tippy-`+n)||``).trim();if(!r)return t;if(n===`content`)t[n]=r;else try{t[n]=JSON.parse(r)}catch{t[n]=r}return t},{})}function gn(e,t){var n=Object.assign({},t,{content:Rt(t.content,[e])},t.ignoreAttributes?{}:hn(e,t.plugins));return n.aria=Object.assign({},$.aria,n.aria),n.aria={expanded:n.aria.expanded===`auto`?t.interactive:n.aria.expanded,content:n.aria.content===`auto`?t.interactive?null:`describedby`:n.aria.content},n}var _n=function(){return`innerHTML`};function vn(e,t){e[_n()]=t}function yn(e){var t=qt();return e===!0?t.className=Mt:(t.className=Nt,Jt(e)?t.appendChild(e):vn(t,e)),t}function bn(e,t){Jt(t.content)?(vn(e,``),e.appendChild(t.content)):typeof t.content!=`function`&&(t.allowHTML?vn(e,t.content):e.textContent=t.content)}function xn(e){var t=e.firstElementChild,n=Gt(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(At)}),arrow:n.find(function(e){return e.classList.contains(Mt)||e.classList.contains(Nt)}),backdrop:n.find(function(e){return e.classList.contains(jt)})}}function Sn(e){var t=qt(),n=qt();n.className=kt,n.setAttribute(`data-state`,`hidden`),n.setAttribute(`tabindex`,`-1`);var r=qt();r.className=At,r.setAttribute(`data-state`,`hidden`),bn(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(n,r){var i=xn(t),a=i.box,o=i.content,s=i.arrow;r.theme?a.setAttribute(`data-theme`,r.theme):a.removeAttribute(`data-theme`),typeof r.animation==`string`?a.setAttribute(`data-animation`,r.animation):a.removeAttribute(`data-animation`),r.inertia?a.setAttribute(`data-inertia`,``):a.removeAttribute(`data-inertia`),a.style.maxWidth=typeof r.maxWidth==`number`?r.maxWidth+`px`:r.maxWidth,r.role?a.setAttribute(`role`,r.role):a.removeAttribute(`role`),(n.content!==r.content||n.allowHTML!==r.allowHTML)&&bn(o,e.props),r.arrow?s?n.arrow!==r.arrow&&(a.removeChild(s),a.appendChild(yn(r.arrow))):a.appendChild(yn(r.arrow)):s&&a.removeChild(s)}return{popper:t,onUpdate:i}}Sn.$$tippy=!0;var Cn=1,wn=[],Tn=[];function En(e,t){var n=gn(e,Object.assign({},$,mn(Kt(t)))),r,i,a,o=!1,s=!1,c=!1,l=!1,u,d,f,p=[],m=zt(U,n.interactiveDebounce),h,g=Cn++,_=null,v=Ut(n.plugins),y={id:g,reference:e,popper:qt(),popperInstance:_,props:n,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:de,setProps:fe,setContent:X,show:pe,hide:Z,hideWithInteractivity:me,enable:ue,disable:Y,unmount:he,destroy:ge};
/* istanbul ignore if */
if(!n.render)return y;var b=n.render(y),x=b.popper,S=b.onUpdate;x.setAttribute(`data-tippy-root`,``),x.id=`tippy-`+y.id,y.popper=x,e._tippy=y,x._tippy=y;var C=v.map(function(e){return e.fn(y)}),w=e.hasAttribute(`aria-expanded`);return B(),F(),M(),N(`onCreate`,[y]),n.showOnCreate&&q(),x.addEventListener(`mouseenter`,function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),x.addEventListener(`mouseleave`,function(){y.props.interactive&&y.props.trigger.indexOf(`mouseenter`)>=0&&k().addEventListener(`mousemove`,m)}),y;function T(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return T()[0]===`hold`}function D(){var e;return!!((e=y.props.render)!=null&&e.$$tippy)}function O(){return h||e}function k(){var e=O().parentNode;return e?tn(e):document}function A(){return xn(x)}function j(e){return y.state.isMounted&&!y.state.isVisible||Q.isTouch||u&&u.type===`focus`?0:It(y.props.delay,+!e,$.delay)}function M(e){e===void 0&&(e=!1),x.style.pointerEvents=y.props.interactive&&!e?``:`none`,x.style.zIndex=``+y.props.zIndex}function N(e,t,n){if(n===void 0&&(n=!0),C.forEach(function(n){n[e]&&n[e].apply(n,t)}),n){var r;(r=y.props)[e].apply(r,t)}}function P(){var t=y.props.aria;if(t.content){var n=`aria-`+t.content,r=x.id;Vt(y.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+` `+r:r);else{var i=t&&t.replace(r,``).trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function F(){!w&&y.props.aria.expanded&&Vt(y.props.triggerTarget||e).forEach(function(e){y.props.interactive?e.setAttribute(`aria-expanded`,y.state.isVisible&&e===O()?`true`:`false`):e.removeAttribute(`aria-expanded`)})}function ee(){k().removeEventListener(`mousemove`,m),wn=wn.filter(function(e){return e!==m})}function I(t){if(!Q.isTouch||!c&&t.type!==`mousedown`){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!(y.props.interactive&&an(x,n))){if(Vt(y.props.triggerTarget||e).some(function(e){return an(e,n)})){if(Q.isTouch||y.state.isVisible&&y.props.trigger.indexOf(`click`)>=0)return}else N(`onClickOutside`,[y,t]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),s=!0,setTimeout(function(){s=!1}),y.state.isMounted||R())}}}function L(){c=!0}function te(){c=!1}function ne(){var e=k();e.addEventListener(`mousedown`,I,!0),e.addEventListener(`touchend`,I,Pt),e.addEventListener(`touchstart`,te,Pt),e.addEventListener(`touchmove`,L,Pt)}function R(){var e=k();e.removeEventListener(`mousedown`,I,!0),e.removeEventListener(`touchend`,I,Pt),e.removeEventListener(`touchstart`,te,Pt),e.removeEventListener(`touchmove`,L,Pt)}function re(e,t){ae(e,function(){!y.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}function ie(e,t){ae(e,t)}function ae(e,t){var n=A().box;function r(e){e.target===n&&(rn(n,`remove`,r),t())}if(e===0)return t();rn(n,`remove`,d),rn(n,`add`,r),d=r}function z(t,n,r){r===void 0&&(r=!1),Vt(y.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),p.push({node:e,eventType:t,handler:n,options:r})})}function B(){E()&&(z(`touchstart`,H,{passive:!0}),z(`touchend`,oe,{passive:!0})),Bt(y.props.trigger).forEach(function(e){if(e!==`manual`)switch(z(e,H),e){case`mouseenter`:z(`mouseleave`,oe);break;case`focus`:z(dn?`focusout`:`blur`,se);break;case`focusin`:z(`focusout`,se)}})}function V(){p.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),p=[]}function H(e){var t=!1;if(!(!y.state.isEnabled||ce(e)||s)){var n=u?.type===`focus`;u=e,h=e.currentTarget,F(),!y.state.isVisible&&Xt(e)&&wn.forEach(function(t){return t(e)}),e.type===`click`&&(y.props.trigger.indexOf(`mouseenter`)<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?t=!0:q(e),e.type===`click`&&(o=!t),t&&!n&&J(e)}}function U(e){var t=e.target,r=O().contains(t)||x.contains(t);e.type===`mousemove`&&r||nn(K().concat(x).map(function(e){var t=e._tippy.popperInstance?.state;return t?{popperRect:e.getBoundingClientRect(),popperState:t,props:n}:null}).filter(Boolean),e)&&(ee(),J(e))}function oe(e){if(!(ce(e)||y.props.trigger.indexOf(`click`)>=0&&o)){if(y.props.interactive){y.hideWithInteractivity(e);return}J(e)}}function se(e){y.props.trigger.indexOf(`focusin`)<0&&e.target!==O()||y.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||J(e)}function ce(e){return Q.isTouch?E()!==e.type.indexOf(`touch`)>=0:!1}function le(){W();var t=y.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,s=D()?xn(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||O()}:e,l=[{name:`offset`,options:{offset:i}},{name:`preventOverflow`,options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:`flip`,options:{padding:5}},{name:`computeStyles`,options:{adaptive:!o}},{name:`$$tippy`,enabled:!0,phase:`beforeWrite`,requires:[`computeStyles`],fn:function(e){var t=e.state;if(D()){var n=A().box;[`placement`,`reference-hidden`,`escaped`].forEach(function(e){e===`placement`?n.setAttribute(`data-placement`,t.placement):t.attributes.popper[`data-popper-`+e]?n.setAttribute(`data-`+e,``):n.removeAttribute(`data-`+e)}),t.attributes.popper={}}}}];D()&&s&&l.push({name:`arrow`,options:{element:s,padding:3}}),l.push.apply(l,n?.modifiers||[]),y.popperInstance=Ot(c,x,Object.assign({},n,{placement:r,onFirstUpdate:f,modifiers:l}))}function W(){y.popperInstance&&=(y.popperInstance.destroy(),null)}function G(){var e=y.props.appendTo,t,n=O();t=y.props.interactive&&e===Ft||e===`parent`?n.parentNode:Rt(e,[n]),t.contains(x)||t.appendChild(x),y.state.isMounted=!0,le()}function K(){return Gt(x.querySelectorAll(`[data-tippy-root]`))}function q(e){y.clearDelayTimeouts(),e&&N(`onTrigger`,[y,e]),ne();var t=j(!0),n=T(),i=n[0],a=n[1];Q.isTouch&&i===`hold`&&a&&(t=a),t?r=setTimeout(function(){y.show()},t):y.show()}function J(e){if(y.clearDelayTimeouts(),N(`onUntrigger`,[y,e]),!y.state.isVisible){R();return}if(!(y.props.trigger.indexOf(`mouseenter`)>=0&&y.props.trigger.indexOf(`click`)>=0&&[`mouseleave`,`mousemove`].indexOf(e.type)>=0&&o)){var t=j(!1);t?i=setTimeout(function(){y.state.isVisible&&y.hide()},t):a=requestAnimationFrame(function(){y.hide()})}}function ue(){y.state.isEnabled=!0}function Y(){y.hide(),y.state.isEnabled=!1}function de(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(a)}function fe(t){if(!y.state.isDestroyed){N(`onBeforeUpdate`,[y,t]),V();var n=y.props,r=gn(e,Object.assign({},n,Kt(t),{ignoreAttributes:!0}));y.props=r,B(),n.interactiveDebounce!==r.interactiveDebounce&&(ee(),m=zt(U,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Vt(n.triggerTarget).forEach(function(e){e.removeAttribute(`aria-expanded`)}):r.triggerTarget&&e.removeAttribute(`aria-expanded`),F(),M(),S&&S(n,r),y.popperInstance&&(le(),K().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),N(`onAfterUpdate`,[y,t])}}function X(e){y.setProps({content:e})}function pe(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=Q.isTouch&&!y.props.touch,i=It(y.props.duration,0,$.duration);if(!(e||t||n||r)&&!O().hasAttribute(`disabled`)&&(N(`onShow`,[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,D()&&(x.style.visibility=`visible`),M(),ne(),y.state.isMounted||(x.style.transition=`none`),D()){var a=A(),o=a.box,s=a.content;$t([o,s],0)}f=function(){var e;if(y.state.isVisible&&!l){if(l=!0,x.offsetHeight,x.style.transition=y.props.moveTransition,D()&&y.props.animation){var t=A(),n=t.box,r=t.content;$t([n,r],i),en([n,r],`visible`)}P(),F(),Ht(Tn,y),(e=y.popperInstance)==null||e.forceUpdate(),N(`onMount`,[y]),y.props.animation&&D()&&ie(i,function(){y.state.isShown=!0,N(`onShown`,[y])})}},G()}}function Z(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=It(y.props.duration,1,$.duration);if(!(e||t||n)&&(N(`onHide`,[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,D()&&(x.style.visibility=`hidden`),ee(),R(),M(!0),D()){var i=A(),a=i.box,s=i.content;y.props.animation&&($t([a,s],r),en([a,s],`hidden`))}P(),F(),y.props.animation?D()&&re(r,y.unmount):y.unmount()}}function me(e){k().addEventListener(`mousemove`,m),Ht(wn,m),m(e)}function he(){y.state.isVisible&&y.hide(),y.state.isMounted&&(W(),K().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Tn=Tn.filter(function(e){return e!==y}),y.state.isMounted=!1,N(`onHidden`,[y]))}function ge(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),V(),delete e._tippy,y.state.isDestroyed=!0,N(`onDestroy`,[y]))}}function Dn(e,t){t===void 0&&(t={});var n=$.plugins.concat(t.plugins||[]);un();var r=Object.assign({},t,{plugins:n}),i=Qt(e).reduce(function(e,t){var n=t&&En(t,r);return n&&e.push(n),e},[]);return Jt(e)?i[0]:i}Dn.defaultProps=$,Dn.setDefaultProps=pn,Dn.currentInput=Q,Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Dn.setDefaultProps({render:Sn});var On=`shared/tippy.e012f5144451ed83.css`,kn=class extends S(w){constructor(){super(),this.textContent=`missing text.`,this.buttonText=`submit`,this.addEventListener(`click`,this._handleClick),this.type=`submit`,this.formId=``}static get properties(){return{...super.properties,textContent:{type:String,attribute:`text-content`},buttonText:{type:String,attribute:`button-text`},type:{type:String},formId:{type:String,attribute:`form-id`}}}firstUpdated(){this.setOrUpdateTippy()}setOrUpdateTippy(){let e=this._(`#info-tooltip-button`),t=this.shadowRoot;if(e&&t){let n=t;e._tippy?e._tippy.setProps({content:this.textContent,appendTo:n}):Dn(e,{content:this.textContent,appendTo:n})}}_handleClick(e){let t=this.formId?document.getElementById(this.formId):this.closest(`form`);if(t instanceof HTMLFormElement)switch(this.type){case`reset`:t.reset();break;case`submit`:t.requestSubmit()}}static get styles(){return y`
            ${_()}
            ${E(!1)}
            ${x()}

            .info-icon {
                display: inline;
                opacity: 0.7;
                top: 2px;
                position: relative;
            }

            .tippy-box {
                background-color: var(--dbp-tooltip-box-bg-color, var(--dbp-content-surface));
                color: var(--dbp-tooltip-box-font-color, var(--dbp-on-content-surface));
                font-weight: var(--dbp-tooltip-box-font-weight, normal);
            }

            .tippy-arrow {
                color: var(--dbp-tooltip-arrow-color, var(--dbp-content));
            }

            .tooltip-button {
                background-color: var(--dbp-tooltip-button-background-color, var(--dbp-background));
                border: var(--dbp-tooltip-button-border, var(--dbp-border));
                color: var(--dbp-tooltip-button-color, var(--dbp-content));
            }
        `}render(){let e=h(On);return this.setOrUpdateTippy(),g`
            <link rel="stylesheet" href="${e}" />
            <button id="info-tooltip-button" class="tooltip-button">
                <div class="info-icon">
                    <!-- https://icons.getbootstrap.com/icons/info-circle/ -->
                    <svg
                        xmlns="http://www.w3.org/2000/svg"
                        width="16"
                        height="16"
                        fill="currentColor"
                        class="bi bi-info-circle"
                        viewBox="0 0 16 16">
                        <path
                            d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
                        <path
                            d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
                    </svg>
                </div>
                ${this.buttonText}
            </button>
        `}};const An=()=>y`
        fieldset {
            border: none;
            margin: 10px 0;
            padding: 0;
        }

        fieldset label {
            font-weight: var(--dbp-label-font-weight, bolder);
            margin-bottom: var(--dbp-label-margin-bottom, 0);
            display: block;
        }

        fieldset input:not([type='radio']):not([type='checkbox']),
        fieldset select,
        fieldset textarea {
            box-sizing: border-box;
            width: 100%;
            padding: 2px 5px;
            border: var(--dbp-border);
            background-color: var(--dbp-background);
            color: var(--dbp-content);
            min-height: 2rem;
        }
    `,jn=async(e,t=!1)=>{let n=Mn(e),r=Pn(e),i=n.map(e=>new Promise(n=>{let i=new CustomEvent(`evaluate`,{detail:{data:r,respond:n,silent:t}});e.dispatchEvent(i)}));return!(await Promise.all(i)).includes(!1)},Mn=e=>Array.from(e.getElementsByTagName(`*`)).filter(e=>e.tagName.toLowerCase().match(/^dbp-.*-element$/)),Nn=e=>JSON.stringify(e).replace(/"/g,`&quot;`),Pn=e=>{let t={};Mn(e).forEach(e=>{let n=e.getAttribute(`name`)||e.id;e.shouldOmitEmptyValue?.()||(t[n]=e.value)});let n=e.querySelectorAll(`[data-value]`),r={};n.forEach(e=>{if(e.shouldOmitEmptyValue?.())return;let t=e.getAttribute(`name`)||e.id,n=e.getAttribute(`data-value`),i=n.replace(/&quot;/g,`"`);try{r[t]=JSON.parse(i)}catch{r[t]=n}});let i={};for(let[e,n]of Object.entries(t))Fn(i,e,n);let a=new FormData(e);for(let[e,t]of a.entries())Fn(i,e,t);for(let[e,t]of Object.entries(r))Fn(i,e,t);return i},Fn=(e,t,n)=>{let r=t.replace(/\]/g,``).split(`[`),i=e;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=n:((!i[t]||typeof i[t]!=`object`)&&(i[t]={}),i=i[t])}};var In=class{getUrlSlug(){return`url-slug`}getFormComponent(){return Ln}getFormIdentifier(){return`uuid`}getFormName(e){return this.getUrlSlug()}getManageFormsOverviewActions(e,t=[]){return t}hasReadOnlyMode(){return!1}getEnumTranslations(e){return{}}},Ln=class extends b(S(w)){constructor(){super(),this._i18n=p(),this.lang=this._i18n.language,this.formData={},this.data={},this.entryPointUrl=``,this.formIdentifier=``,this.formUrlSlug=``,this.formProperties={},this.submitted=!1,this.submissionId=``,this.currentSubmission={},this.userAllSubmissions=[],this.submissionError=!1,this.readOnly=!1,this.isAdmin=!1,this.isFormValid=null,this.hideForm=!1,this.currentState=null,this.allowedSubmissionStates=4,this.allowedActionsWhenSubmitted=[],this.submissionBinaryState=l.NONE,this.maxNumberOfSubmissionsPerUser=10,this.lastModifiedCreatorName=null,this.lastModifiedCreatorId=null,this.fileUploadLimits={},this.conditionalFields={},this.filesByGroup={},this.currentUploadGroup=null,this.fileUploadError=!1,this.fileUploadCounts={},this.selectedTags={},this.allowedTags={},this.newSubmissionId=null,this.tagIsInline=`inline`,this.mediaQuery=null,this.formGrantedSubmissionCollectionActions=[],this.formGrantedFormActions=[],this.submissionGrantedActions=[],this.isUserAllowedToEditSubmission=!1,this.isUserAllowedToEditPermission=!1,this.isUserAllowedToDeleteSubmission=!1,this.isUserAllowedToDownloadPdf=!1,this.saveButtonEnabled=!0,this.isViewModeButtonAllowed=!1,this.isDraftButtonAllowed=!1,this.isDeleteSubmissionButtonAllowed=!1,this.isSubmitButtonEnabled=!1,this.isPrintButtonAllowed=!1,this._formHeaderObserved=!1,this._formHeaderObserver=null,this.isDownloadButtonAllowed=!1,this.isSaveButtonEnabled=!1,this.handleChangeEvents=this.handleChangeEvents.bind(this),this.handleToggleSubmissionState=this.handleToggleSubmissionState.bind(this),this.handleResize=this.handleResize.bind(this),this.conditionalFields={}}static get scopedElements(){return{"dbp-button":f,"dbp-icon":m,"dbp-select":O,"dbp-button-tooltip":kn}}getToken(){if(!this.auth?.token)throw Error(`Authentication token is not available`);return this.auth.token}get formElement(){let e=this.renderRoot.querySelector(`form`);if(!e)throw Error(`${this.localName}: expected a rendered form element`);return e}getUserId(){if(!this.auth?.[`user-id`])throw Error(`User ID is not available`);return this.auth[`user-id`]}connectedCallback(){super.connectedCallback(),this.mediaQuery=window.matchMedia(`(min-width: 350px)`),this.handleResize(),this.mediaQuery.addEventListener(`change`,this.handleResize),this.updateComplete.then(()=>{this.addEventListener(`change`,this.handleChangeEvents),this.addEventListener(`DbpFormalizeFormToggleSubmissionState`,this.handleToggleSubmissionState)})}disconnectedCallback(){super.disconnectedCallback(),this.mediaQuery&&=(this.mediaQuery.removeEventListener(`change`,this.handleResize),null),this._formHeaderObserver&&=(this._formHeaderObserver.disconnect(),null),this._formHeaderObserved=!1,this.removeEventListener(`change`,this.handleChangeEvents),this.removeEventListener(`DbpFormalizeFormToggleSubmissionState`,this.handleToggleSubmissionState)}async validateAndSendSubmission(e){e.preventDefault();let t=this.formElement;if(!await jn(t)){this.scrollToFirstInvalidField(t,!0);return}this.sendSubmission(e)}scrollToFirstInvalidField(e,t=!1){let n=Mn(e);for(let e of n){let n=e.shadowRoot?.querySelector(`.validation-errors`);if(n){let e=n.closest(`fieldset`),r=e?.querySelector(`label`);r&&(r.style.scrollMarginTop=`100px`,r.scrollIntoView({behavior:`smooth`,block:`start`})),t&&(e?.querySelector(`input, textarea`)??null)?.focus();break}}}toggleSubmissionState(e){let t={submissionId:this.submissionId},n=new CustomEvent(`DbpFormalizeFormToggleSubmissionState`,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}async handleToggleSubmissionState(e){let t=e.detail.submissionId,n=new FormData;n.append(`submissionState`,String(l.SUBMITTED));let r=this._buildRequestOptions(n,`PATCH`),i=this._buildSubmissionUrl(t);try{let e=await fetch(i,r);e.ok?(this.currentState=s.SUBMITTED,this.submitted=!0,this.hideForm=!0,this.disableLeavePageWarning(),T({summary:this._i18n.t(`success.success-title`),body:this._i18n.t(`success.form-submitted-successfully`),type:`success`,timeout:5}),this.dispatchEvent(new CustomEvent(`dbpFormDataUpdated`,{detail:{needUpdate:!0},bubbles:!0,composed:!0}))):(this.submissionError=!0,await this.displayErrors(e))}catch(e){console.error(e),T({summary:this._i18n.t(`errors.error-title`),body:this._i18n.t(`errors.unknown-error-on-form-submission`),type:`danger`,timeout:0})}}sendSubmission(e){this.saveButtonEnabled=!1;let t=this.formElement,n={formData:Pn(t),submissionId:this.submissionId},r=new CustomEvent(`DbpFormalizeFormSubmission`,{detail:n,bubbles:!0,composed:!0});this.dispatchEvent(r)}sendSaveDraft(e){this.draftButtonEnabled=!1;let t=this.formElement,n={formData:Pn(t),submissionId:this.submissionId},r=new CustomEvent(`DbpFormalizeFormSaveDraft`,{bubbles:!0,composed:!0,detail:n});this.dispatchEvent(r)}sendDeleteSubmission(){if(!this.submissionId)return;let e={submissionId:this.submissionId},t=new CustomEvent(`DbpFormalizeFormDeleteSubmission`,{bubbles:!0,composed:!0,detail:e});this.dispatchEvent(t)}async sendSaveSubmission(){if(!this.submissionId)return;let e=this.formElement;if(!await jn(e)){this.scrollToFirstInvalidField(e);return}let t={submissionId:this.submissionId,formData:Pn(e)},n=new CustomEvent(`DbpFormalizeFormSaveSubmission`,{bubbles:!0,composed:!0,detail:t});this.dispatchEvent(n)}disableLeavePageWarning(){let e=new CustomEvent(`disableBeforeunloadWarning`,{bubbles:!0,composed:!0});this.dispatchEvent(e)}static get properties(){return{...super.properties,lang:{type:String},person:{type:Object},additionalType:{type:String,attribute:`additional-type`},formData:{type:Object,attribute:!1},data:{type:Object},auth:{type:Object},submitted:{type:Boolean,attribute:!1},entryPointUrl:{type:String,attribute:`entry-point-url`},formIdentifier:{type:String,attribute:`form-identifier`},formUrlSlug:{type:String,attribute:`form-url-slug`},submissionError:{type:Boolean,attribute:!1},hideForm:{type:Boolean,attribute:!1},readOnly:{type:Boolean,attribute:`read-only`},isFormValid:{type:Boolean,attribute:!1},tagIsInline:{type:String,attribute:!1},allowedSubmissionStates:{type:Number,attribute:`allowed-submission-states`},maxNumberOfSubmissionsPerUser:{type:String,attribute:`max-number-of-submissions`},lastModifiedCreatorName:{type:String,attribute:!1},formProperties:{type:Object},userAllSubmissions:{type:Array},conditionalFields:{type:Object,attribute:!1},saveButtonEnabled:{type:Boolean,attribute:!1},isViewModeButtonAllowed:{type:Boolean,attribute:!1},isDeleteSubmissionButtonAllowed:{type:Boolean,attribute:!1},isDraftButtonAllowed:{type:Boolean,attribute:!1},isSubmitButtonEnabled:{type:Boolean,attribute:!1},isPrintButtonAllowed:{type:Boolean,attribute:!1},isDownloadButtonAllowed:{type:Boolean,attribute:!1}}}static get styles(){return y`
            @layer theme, utility, formalize, print;
            @layer theme {
                ${E(!1)}
                ${x()}
                ${j()}

                .button-row {
                    margin-top: 1em;
                    text-align: right;
                }
            }
            @layer formalize {
                ${M()}
                ${k()}
                ${A()}
                ${D()}

                .after-submission-button-container {
                    display: flex;
                    justify-content: flex-start;
                    gap: 1em;
                    margin-top: 2em;
                }

                .after-submission-button-container .button dbp-icon {
                    padding-right: 0.5em;
                }
            }
        `}resetForm(e){e.preventDefault(),this.saveButtonEnabled=!0,this.currentSubmission={},this.formData={},this.data={},this.currentState=null,this.lastModifiedCreatorName=``,this.submissionBinaryState=0,this.submissionId=``;let t=new CustomEvent(`DbpFormalizeFormReset`,{bubbles:!0,composed:!0});this.dispatchEvent(t)}getButtonRowHtml(){let e=this._i18n;return this.formActions=[],this.isUserAllowedToEditSubmission&&this.formActions.push({value:`cancel`,label:this.readOnly?e.t(`render-form.forms.base-object.edit-mode`):e.t(`render-form.forms.base-object.view-mode`),iconName:this.readOnly?`pencil`:`close`}),this.isUserAllowedToEditPermission&&this.formActions.push({value:`edit-permissions`,label:e.t(`render-form.forms.base-object.edit-permission-button-text`),iconName:`edit-permission`}),this.isUserAllowedToDownloadPdf&&this.formActions.push({value:`download`,label:e.t(`render-form.forms.base-object.download-button-text`),iconName:`download`}),this.isUserAllowedToDeleteSubmission&&this.formActions.push({value:`delete`,label:this.currentState===s.SUBMITTED?e.t(`render-form.forms.base-object.delete-submission-button-text-label`):e.t(`render-form.forms.base-object.discard-draft-button-text-label`),iconName:`trash`}),g`
            <div class="header-top">
                <div class="submission-info-wrapper">${this.renderSubmissionInfo()}</div>
                <div class="tag-management">${this.renderHeaderTags()}</div>
            </div>
            <div class="buttons-wrapper">
                <div class="status-tags-wrapper">
                    ${this.renderStatusTags()}
                    ${this.readOnly?``:this.renderFormValidityIndicator()}
                </div>

                <div class="action-buttons" id="action-buttons" tabindex="-1">
                    ${this.formActions.length>0?g`
                                  <dbp-select
                                      id="action-dropdown"
                                      class="action-dropdown"
                                      label="${e.t(`render-form.forms.base-object.actions-dropdown-label`)}"
                                      .options="${this.formActions}"></dbp-select>
                              `:``}
                    ${this.isViewModeButtonAllowed?g`
                                  <dbp-button
                                      id="toggle-edit-mode"
                                      class="toggle-edit-mode"
                                      type="is-secondary"
                                      no-spinner-on-click
                                      title="${e.t(`render-form.forms.base-object.toggle-edit-submission-button-title`)}"
                                      @click="${()=>{if(this.readOnly){this.redirectToEditForm(!0);return}if(confirm(this._i18n.t(`render-form.form-exit-warning-message`))){let e=this.formElement,t=Pn(e);Object.keys(t).length&&(this.formData=t),this.disableLeavePageWarning(),this.redirectToReadonlyForm(),this.readOnly=!this.readOnly;return}}}">
                                      ${this.readOnly?g`
                                                    <dbp-icon name="pencil"></dbp-icon>
                                                    <span class="button-label">
                                                        ${e.t(`render-form.forms.base-object.edit-mode`)}
                                                    </span>
                                                `:g`
                                                    <dbp-icon name="close"></dbp-icon>
                                                    <span class="button-label">
                                                        ${e.t(`render-form.forms.base-object.view-mode`)}
                                                    </span>
                                                `}
                                  </dbp-button>
                              `:``}
                    ${this.isDraftButtonAllowed?g`
                                  <dbp-button
                                      class="form-save-draft-button"
                                      type="is-secondary"
                                      no-spinner-on-click
                                      @click=${this.sendSaveDraft}
                                      title="${e.t(`render-form.forms.base-object.save-draft-button-text`)}"
                                      aria-label="${e.t(`render-form.forms.base-object.save-draft-button-text`)}">
                                      <dbp-icon name="save" aria-hidden="true"></dbp-icon>
                                      <span class="button-label">
                                          ${e.t(`render-form.forms.base-object.save-draft-button-text`)}
                                      </span>
                                  </dbp-button>
                              `:``}
                    ${this.isSaveButtonEnabled?g`
                                  <dbp-button
                                      class="form-save-button"
                                      type="is-primary"
                                      no-spinner-on-click
                                      @click=${this.sendSaveSubmission}
                                      title="${e.t(`render-form.forms.base-object.save-button-text`)}"
                                      aria-label="${e.t(`render-form.forms.base-object.save-button-text`)}">
                                      <dbp-icon
                                          name="checkmark-circle"
                                          aria-hidden="true"></dbp-icon>
                                      <span class="button-label">
                                          ${e.t(`render-form.forms.base-object.save-button-text`)}
                                      </span>
                                  </dbp-button>
                              `:``}
                    ${this.isSubmitButtonEnabled?g`
                                  <dbp-button
                                      class="form-submit-button"
                                      type="is-primary"
                                      no-spinner-on-click
                                      @click=${e=>{this.readOnly?this.toggleSubmissionState(e):this.validateAndSendSubmission(e)}}
                                      title="${e.t(`render-form.forms.base-object.submit-button-text`)}"
                                      aria-label="${e.t(`render-form.forms.base-object.submit-button-text`)}">
                                      <dbp-icon name="send-diagonal" aria-hidden="true"></dbp-icon>
                                      <span class="button-label">
                                          ${e.t(`render-form.forms.base-object.submit-button-text`)}
                                      </span>
                                  </dbp-button>
                              `:``}
                </div>
            </div>
        `}renderHeaderTags(){return Object.keys(this.allowedTags).length===0||this.formProperties.tagPermissionsForSubmitters===n.NONE&&!this.isAdmin?g``:this.readOnly?(this.formProperties.tagPermissionsForSubmitters>=n.READ||this.isAdmin)&&Object.values(this.selectedTags).length>0?g`
                          <dbp-form-enum-view
                              subscribe="lang"
                              name="formTags"
                              display-mode="tags"
                              layout-type="inline"
                              label="Tags:"
                              .value=${Object.values(this.selectedTags)}></dbp-form-enum-view>
                      `:g``:this.isAdmin||this.formProperties.tagPermissionsForSubmitters>=n.READ_ADD?g`
                    <dbp-form-enum-element
                        id="form-tags"
                        name="formTags"
                        subscribe="lang"
                        label="Tags:"
                        @change="${e=>{this.allowedTags&&Object.keys(this.allowedTags).length>0&&this.setCurrentTags(e)}}"
                        display-mode="tags"
                        layout-type="${this.tagIsInline}"
                        multiple
                        .tagPlaceholder=${{en:`Select tags`,de:`Wähle Tags`}}
                        .value=${Object.values(this.selectedTags)}
                        .items=${this.allowedTags}></dbp-form-enum-element>
                `:this.formProperties.tagPermissionsForSubmitters>=n.READ&&Object.values(this.selectedTags).length>0?g`
                        <dbp-form-enum-view
                            subscribe="lang"
                            name="formTags"
                            display-mode="tags"
                            layout-type="inline"
                            label="Tags:"
                            .value=${Object.values(this.selectedTags)}></dbp-form-enum-view>
                    `:g``}handleResize(){this.tagIsInline=this.mediaQuery?.matches?`inline`:``}setCurrentTags(e){if(Object.keys(this.allowedTags).length===0)return;let t={},n=e.detail.value;if(n.length>0)for(let e of n)t[e]=e;this.selectedTags=t}renderStatusTags(){let e=this.currentState,t={draft:this._i18n.t(`render-form.forms.base-object.draft-state-tag-label`),submitted:this._i18n.t(`render-form.forms.base-object.submitted-state-tag-label`)},n=this.readOnly?``:this._i18n.t(`render-form.forms.base-object.edit-mode-tag-label`);return g`
            <div class="tag-container">
                ${e?g`
                              <span class="tag tag--state">${t[e]}</span>
                          `:``}
                ${n?g`
                              <span class="tag tag--mode">${n}</span>
                          `:``}
            </div>
        `}renderFormValidityIndicator(){return this.submissionId?this.isFormValid?g`
                <div class="form-validity-indicator valid">
                    <dbp-icon name="checkmark-circle" aria-hidden="true"></dbp-icon>
                    <span class="validity-text">
                        ${this._i18n.t(`render-form.forms.base-object.form-validity-valid-text`)}
                    </span>
                    <dbp-button-tooltip
                        text-content="${this._i18n.t(`render-form.forms.base-object.form-validity-valid-tooltip`)}"
                        type="button"
                        button-text=" "
                        icon-name="question-circle"></dbp-button-tooltip>
                </div>
            `:g`
                <div class="form-validity-indicator invalid">
                    <dbp-icon name="cross-circle" aria-hidden="true"></dbp-icon>
                    <span class="validity-text">
                        ${this._i18n.t(`render-form.forms.base-object.form-validity-invalid-text`)}
                    </span>
                    <dbp-button-tooltip
                        text-content="${this._i18n.t(`render-form.forms.base-object.form-validity-invalid-tooltip`)}"
                        button-text=" "
                        type="button"
                        icon-name="question-circle"></dbp-button-tooltip>
                </div>
            `:g``}redirectToReadonlyForm(){let e=window.location.href,t=new URL(e),n=t.pathname.replace(/\/+$/,``);t.pathname=n.match(/\/readonly$/)?n:n+`/readonly`,t.searchParams.delete(`validate`),window.history.pushState({},``,t),window.location.href=t.toString()}redirectToEditForm(e=!1){let t=window.location.href,n=new URL(t);n.pathname.endsWith(`/readonly`)&&(n.pathname=n.pathname.replace(/\/readonly$/,``),e&&n.searchParams.set(`validate`,`true`),window.history.pushState({},``,n),window.location.href=n.toString())}evaluateCondition(e,t){let n=null;if(t.startsWith(`[`)&&t.endsWith(`]`))try{n=JSON.parse(t)}catch(e){console.warn(`Failed to parse condition as JSON array:`,e),n=null}let r;if(n!==null&&Array.isArray(n))r=Array.isArray(e)?e.some(e=>n.includes(e)):n.includes(e);else if(t.startsWith(`!`)){let n=t.substring(1);r=Array.isArray(e)?!e.includes(n):e!==n}else r=Array.isArray(e)?!!e.includes(t):e===t;return r}handleChangeEvents(e){if(e.detail&&e.detail.option&&e.detail.value){let t=e.detail.option,n=e.detail.value;if(t.value===`cancel`&&n===`cancel`){if(this.readOnly){this.redirectToEditForm(!0);return}if(confirm(this._i18n.t(`render-form.forms.base-object.form-exit-warning-message`))){let e=this.formElement,t=Pn(e);Object.keys(t).length&&(this.formData=t),this.disableLeavePageWarning(),this.redirectToReadonlyForm(),this.readOnly=!this.readOnly;return}return}if(t.value===`delete`&&n===`delete`){this.sendDeleteSubmission();return}if(t.value===`save`&&n===`save`){this.sendSaveSubmission();return}}if(e.detail&&e.detail.fieldName&&e.detail.value){let t=e.detail.fieldName,n=e.detail.value;this.formData[t]=n;let r=this._(`[name=${t}]`).dataset?.condition;if(!r)return;let i=this.evaluateCondition(n,r);this.conditionalFields={...this.conditionalFields,[t]:i}}}async processConditionalFields(){let e=this._a(`[data-condition]`),t=e.length;e.length!==0&&(e.forEach(e=>{let t=e.value;if(t===void 0||t===``)return;let n=e.getAttribute(`name`),r=e.dataset.condition,i=this.evaluateCondition(t,r);this.conditionalFields[n]!==void 0&&(this.conditionalFields={...this.conditionalFields,[n]:i})}),await this.updateComplete,this._a(`[data-condition]`).length>t&&await this.processConditionalFields())}renderSubmissionInfo(){let e=this._i18n,t=d(this.currentSubmission.dateCreated),n=d(this.currentSubmission.dateLastModified),r=d(this.currentSubmission.availabilityEnds);return g`
            <div class="submission-info">
                ${r?g`
                              <div class="submission-deadline">
                                  <span class="label">
                                      ${e.t(`render-form.forms.base-object.submission-deadline-label`)}:
                                  </span>
                                  <span class="value">${r}</span>
                              </div>
                          `:``}
                <div class="submission-date">
                    <span class="label">
                        ${e.t(`render-form.forms.base-object.submission-creation-date-label`)}:
                    </span>
                    <span class="value">
                        ${t||g`
                                &mdash;
                            `}
                    </span>
                </div>
                <div class="last-modified">
                    <span class="label">
                        ${e.t(`render-form.forms.base-object.last-modified-date-label`)}:
                    </span>
                    <span class="value">
                        ${n||g`
                                &mdash;
                            `}
                    </span>
                </div>
                <div class="last-modified-by">
                    <span class="label">
                        ${e.t(`render-form.forms.base-object.last-modified-by-name-label`)}:
                    </span>
                    <span class="value">
                        ${this.lastModifiedCreatorName||g`
                                &mdash;
                            `}
                    </span>
                </div>
            </div>
        `}update(e){e.forEach((e,t)=>{t===`lang`&&this._i18n.changeLanguage(this.lang)}),super.update(e),e.has(`data`),(e.has(`userAllSubmissions`)||e.has(`readOnly`))&&this.setButtonStates(),e.has(`formProperties`)&&Object.keys(this.formProperties).length>0&&(this.allowedActionsWhenSubmitted=this.formProperties.allowedActionsWhenSubmitted,this.formGrantedSubmissionCollectionActions=this.formProperties.grantedSubmissionCollectionActions,this.formGrantedFormActions=this.formProperties.grantedFormActions,this.allowedTags=a(this.formProperties.availableTags),this.fileUploadLimits=this.getFileUploadLimits(this.formProperties?.dataFeedSchema),this.isAdmin=this.formGrantedSubmissionCollectionActions.some(e=>e===i.MANAGE||e===i.UPDATE),this.setButtonStates())}getFileGroupsFromSchema(){if(!this.formProperties?.dataFeedSchema)return[];try{let e=JSON.parse(this.formProperties.dataFeedSchema);return e.additionalFiles===!0&&!e.files?[]:e.files&&typeof e.files==`object`?Object.keys(e.files):[]}catch(e){return console.error(`Failed to parse schema for file groups:`,e),[]}}initializeFileGroups(){let e=this.getFileGroupsFromSchema();for(let t of e)this.filesByGroup[t]||(this.filesByGroup[t]={submittedFiles:/* @__PURE__ */ new Map,filesToSubmit:/* @__PURE__ */ new Map,filesToRemove:/* @__PURE__ */ new Map})}getOrCreateFileGroup(e){return this.filesByGroup[e]||(this.filesByGroup[e]={submittedFiles:/* @__PURE__ */ new Map,filesToSubmit:/* @__PURE__ */ new Map,filesToRemove:/* @__PURE__ */ new Map}),this.filesByGroup[e]}setButtonStates(){this.isViewModeButtonAllowed=!1,this.isDraftButtonAllowed=!1,this.isDeleteSubmissionButtonAllowed=!1,this.isSubmitButtonEnabled=!1,this.isPrintButtonAllowed=!1,this.isDownloadButtonAllowed=!1,this.isSaveButtonEnabled=!1,this.isUserAllowedToEditSubmission=!1,this.isUserAllowedToEditPermission=!1,this.isUserAllowedToDeleteSubmission=!1,this.isUserAllowedToDownloadPdf=!1,this.submissionBinaryState===l.NONE&&(this.isDraftButtonAllowed=r(this.allowedSubmissionStates)&&this.canUserSubmitSubmission(),this.isSubmitButtonEnabled=e(this.allowedSubmissionStates)&&this.canUserSubmitSubmission()),this.currentState===s.DRAFT&&(this.isSubmitButtonEnabled=e(this.allowedSubmissionStates)&&(this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.UPDATE)),this.readOnly?(this.isUserAllowedToDownloadPdf=!0,this.isUserAllowedToEditSubmission=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.UPDATE),this.isUserAllowedToEditPermission=this.submissionGrantedActions.includes(t.MANAGE),this.isUserAllowedToDeleteSubmission=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.DELETE)):(this.isViewModeButtonAllowed=!0,this.isDraftButtonAllowed=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.UPDATE))),this.currentState===s.SUBMITTED&&(this.readOnly?(this.isUserAllowedToDownloadPdf=!0,this.isUserAllowedToEditSubmission=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.UPDATE),this.isUserAllowedToEditPermission=this.submissionGrantedActions.includes(t.MANAGE),this.isUserAllowedToDeleteSubmission=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.DELETE)):(this.isViewModeButtonAllowed=!0,this.isSaveButtonEnabled=this.submissionGrantedActions.includes(t.MANAGE)||this.submissionGrantedActions.includes(t.UPDATE)))}async transformApiResponseToFile(e){if(!e||e.length===0)return/* @__PURE__ */ new Map;let t=/* @__PURE__ */ new Map;try{for(let n of e){let e={method:`GET`,headers:{Authorization:`Bearer `+this.getToken()}},r=await fetch(n.downloadUrl,e);if(!r.ok)T({summary:this._i18n.t(`errors.other-title`),body:this._i18n.t(`errors.other-body`),type:`danger`,timeout:0});else{let e=await r.blob(),i=new File([e],n.fileName,{type:n.mimeType});t.set(n.identifier,i)}}return t}catch(e){throw console.error(`Error transforming API response to File:`,e),e}}handleFilesToSubmit(e){let t=this.currentUploadGroup||`attachments`,n=this.getOrCreateFileGroup(t),r=e.detail.file?[e.detail.file]:[];if(r&&r.length>0)for(let e of r){let t=crypto.randomUUID();n.filesToSubmit.set(t,e)}this.requestUpdate()}deleteAttachment(e,t){let n=this.getOrCreateFileGroup(t),r=n.submittedFiles.get(e);r===void 0?n.filesToSubmit.has(e)&&n.filesToSubmit.delete(e):(n.filesToRemove.set(e,r),n.submittedFiles.delete(e)),this.requestUpdate()}renderAttachedFilesHtml(e=`attachments`){let t=this.getOrCreateFileGroup(e),n=this._i18n,r=[];if(t.submittedFiles.size>0){let n=g`
                <div class="fileblock-container submitted-files">
                    ${Array.from(t.submittedFiles).map(([t,n])=>this.addFileBlock(n,t,e))}
                </div>
            `;r.push(n)}if(t.filesToSubmit.size>0){let i=g`
                <div class="fileblock-container files-to-upload">
                    <div class="attachment-header">
                        <dbp-icon name="upload"></dbp-icon>
                        <h5>
                            ${n.t(`render-form.download-widget.attachment-upload-file-text`)}
                            <span class="attachment-warning">
                                ${n.t(`render-form.download-widget.attachment-upload-warning-text`)}
                            </span>
                        </h5>
                    </div>
                    ${Array.from(t.filesToSubmit).map(([t,n])=>this.addFileBlock(n,t,e))}
                </div>
            `;r.push(i)}if(t.filesToRemove.size>0){let i=g`
                <div class="fileblock-container files-to-remove">
                    <div class="attachment-header">
                        <dbp-icon name="trash"></dbp-icon>
                        <h5>
                            ${n.t(`render-form.download-widget.attachment-remove-file-text`)}
                            <span class="attachment-warning">
                                ${n.t(`render-form.download-widget.attachment-deletion-warning-text`)}
                            </span>
                        </h5>
                    </div>
                    ${Array.from(t.filesToRemove).map(([t,n])=>this.addFileBlock(n,t,e))}
                </div>
            `;r.push(i)}return r}addFileBlock(e,t,n=`attachments`,r=!0){let i=this.getOrCreateFileGroup(n),a=e.type===`application/pdf`,o=r&&a&&this._(`#pdf-view-modal`)&&this._(`dbp-pdf-viewer`);return g`
            <div class="file-block">
                <span class="file-info">
                    <strong class="file-name">${e.name}</strong>
                    <span class="additional-data">
                        <span class="file-type">(${e.type})</span>
                        <span class="file-size">${(e.size/1024).toFixed(2)} KB</span>
                    </span>
                </span>
                <div class="file-action-buttons">
                    ${o?g`
                                  <button
                                      class="view-file-button button is-secondary"
                                      title="${this._i18n.t(`render-form.download-widget.view-attachment-title`,{filename:e.name})}"
                                      aria-label="${this._i18n.t(`render-form.download-widget.view-attachment-title`,{filename:e.name})}"
                                      @click=${t=>{t.preventDefault();let n=this._(`#pdf-view-modal`),r=this._(`dbp-pdf-viewer`);n&&r&&(n.open(),r.showPDF(e))}}>
                                      <dbp-icon name="eye" aria-hidden="true"></dbp-icon>
                                      ${this._i18n.t(`render-form.download-widget.view-attachment`)}
                                  </button>
                              `:``}
                    <button
                        class="download-file-button button is-secondary"
                        title="${this._i18n.t(`render-form.download-widget.download-attachment-title`,{filename:e.name})}"
                        aria-label="${this._i18n.t(`render-form.download-widget.download-attachment-title`,{filename:e.name})}"
                        @click=${t=>{t.preventDefault(),this._(`#file-sink`).files=[e]}}>
                        <dbp-icon name="download" aria-hidden="true"></dbp-icon>
                        ${this._i18n.t(`render-form.download-widget.download-attachment`)}
                    </button>
                    <button
                        class="delete-file-button button is-secondary"
                        .disabled=${i.filesToRemove.has(t)||this.readOnly}
                        title="${this._i18n.t(`render-form.download-widget.delete-attachment-title`,{filename:e.name})}"
                        aria-label="${this._i18n.t(`render-form.download-widget.delete-attachment-title`,{filename:e.name})}"
                        @click=${e=>{e.preventDefault(),this.deleteAttachment(t,n)}}>
                        <dbp-icon name="trash" aria-hidden="true"></dbp-icon>
                        ${this._i18n.t(`render-form.download-widget.delete-attachment`)}
                    </button>
                </div>
            </div>
        `}getFileUploadLimits(e){if(!e)return{};let t,n={allowedFileUploadCount:{},fileSizeLimit:{},minFileUploadCount:{}};try{if(t=JSON.parse(e),t.files===void 0)return{};for(let[e,r]of Object.entries(t.files))n.allowedFileUploadCount[e]=r.maxNumber,n.minFileUploadCount[e]=r.minNumber,n.fileSizeLimit[e]=r.maxSizeMb;return n}catch(e){return console.log(`Failed parsing json data`,e),{}}}displayValidationErrors(e){let t=e[`relay:errorDetails`],n=[];Object.keys(t).forEach(e=>{t[e].forEach(t=>{e=e.replace(/^\//,``),n.push(`${e}: ${t}`)})}),T({summary:this._i18n.t(`errors.error-title`),body:this._i18n.t(`errors.validation-failed`,{details:n.join(`; `)}),type:`danger`,timeout:0})}async displayErrors(e){let t=await e.json();t[`relay:errorId`]===`formalize:submission-data-feed-invalid-schema`?this.displayValidationErrors(t):t[`relay:errorId`]===`blob:create-file-data-file-does-not-validate-against-type`?T({summary:this._i18n.t(`errors.error-title`),body:this._i18n.t(`errors.file-security-validation-failed`),type:`danger`,timeout:0}):T({summary:this._i18n.t(`errors.error-title`),body:this._i18n.t(`errors.form-submission-failed`,{status:e.status,details:t.detail}),type:`danger`,timeout:0})}async apiGetUserDetails(e){let t={method:`GET`,headers:{"Content-Type":`application/ld+json`,Authorization:`Bearer `+this.getToken()}};return await fetch(this.entryPointUrl+`/base/people/${e}`,t)}_buildRequestOptions(e,t){return{method:t,headers:{Authorization:`Bearer ${this.getToken()}`},body:e}}_buildSubmissionUrl(e=null){let t=`${this.entryPointUrl}/formalize/submissions`;return e?`${t}/${e}`:`${t}`}stickyHeaderObserver(){if(!this._formHeaderObserved){let e=this._(`.form-header`);if(e){let t=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.target.classList.toggle(`is-pinned`,e.intersectionRatio<.45)})},{rootMargin:`0px`,scrollMargin:`0px`,threshold:.45});t.observe(e),this._formHeaderObserved=!0,this._formHeaderObserver=t}}}canUserSubmitSubmission(){return(this.formProperties?.numSubmissionsByCurrentUser??0)<(this.formProperties?.maxNumSubmissionsPerCreator??10)&&(this.formGrantedSubmissionCollectionActions?.includes(i.MANAGE)||this.formGrantedSubmissionCollectionActions?.includes(i.CREATE_SUBMISSIONS)||this.formGrantedFormActions?.includes(c.MANAGE)||this.formGrantedFormActions?.includes(c.CREATE_SUBMISSIONS))}areSubmissionReadableAfterSubmission(){return this.formGrantedSubmissionCollectionActions?.includes(i.MANAGE)||this.formProperties?.allowedActionsWhenSubmitted?.includes(t.READ)||this.formProperties?.allowedActionsWhenSubmitted?.includes(t.MANAGE)}render(){return console.log(`-- Render BaseFormElement --`),g`
            <form class="formalize-form">
                Please implement render() in your subclass! ${this.getButtonRowHtml()}
            </form>
        `}},Rn={"render-form":{"base-object":{"max-length":`Es sind nur {{maxLength}} Zeichen zulässig.`,"required-field":`*`,"required-field-validation-error":`Bitte füllen Sie das Pflichtfeld aus!`},enum:{"remove-all-items":`Alle Einträge entfernen`,"remove-item":`{{- item}} entfernen`,"select-placeholder":`Bitte wählen Sie eine Option aus`},number:{"max-exceeded":`Der Wert darf höchstens {{max}} sein.`,"min-exceeded":`Der Wert muss mindestens {{min}} sein.`},string:{"invalid-url":`Der eingegebene Wert muss eine gültige URL sein.`,"word-count-exceeded":`Sie haben die maximal zulässige Wortanzahl von {{wordLimit}} überschritten. Sie haben {{wordCount}} Wörter eingegeben. Bitte entfernen Sie die überschüssigen Wörter.`},"submission-select":{"load-error":`Einträge konnten nicht geladen werden`,loading:`Einträge werden geladen...`,"no-submissions":`Keine Einträge verfügbar`,"not-configured":`Eintrag Selector ist nicht konfiguriert`,"select-placeholder":`Bitte wählen Sie aus`}}},zn={"render-form":{"base-object":{"max-length":`Only {{maxLength}} character is allowed.`,"required-field":`*`,"required-field-validation-error":`Please fill out the required field!`},enum:{"remove-all-items":`Remove all items`,"remove-item":`Remove {{- item}}`,"select-placeholder":`Please select an option`},number:{"max-exceeded":`The value must be at most {{max}}.`,"min-exceeded":`The value must be at least {{min}}.`},string:{"invalid-url":`The entered value must be a valid URL.`,"word-count-exceeded":`You have exceeded the maximum number of allowed {{wordLimit}} words. Entered {{wordCount}} words. Please remove the extra words.`},"submission-select":{"load-error":`Entries could not be loaded`,loading:`Loading entries...`,"no-submissions":`No entries available`,"not-configured":`Entry select is not configured`,"select-placeholder":`Please select`}}};function Bn(){return v({en:zn,de:Rn},`de`,`en`)}var Vn=class extends C(b(S(w)),Bn){constructor(){super(),this.formElementId=`form-element`,this.name=``,this.description=``,this.label=``,this.value=``,this.required=!1,this.disabled=!1,this.errorMessages=[],this.evaluationData={},this.customValidator=null,this.hidden=!1}static get properties(){return{...super.properties,name:{type:String},description:{type:String},label:{type:String},value:{type:String,reflect:!0},required:{type:Boolean},disabled:{type:Boolean},errorMessages:{type:Array,attribute:!1},customValidator:{type:Function},hidden:{type:Boolean}}}isValueEmpty(){return!this.value}handleErrors(){let e=[];if(this.required&&this.isValueEmpty())e.push(this._i18n.t(`render-form.base-object.required-field-validation-error`));else if(this.customValidator){let t=this.customValidator(this.value,this.evaluationData);t&&(e=e.concat(t))}return this.errorMessages=e,e.length===0}handleErrorsIfAny(){this.errorMessages.length>0&&this.handleErrors()}evaluateCallback(e,t=!1){if(this.evaluationData=e,t){let e=[];if(this.required&&this.isValueEmpty())e.push(this._i18n.t(`render-form.base-object.required-field-validation-error`));else if(this.customValidator){let t=this.customValidator(this.value,this.evaluationData);t&&(e=e.concat(t))}return e.length===0}return this.handleErrors()}renderErrorMessages(){return this.errorMessages.length?g`
            <ul class="validation-errors" id="${this.formElementId}-errors">
                ${this.errorMessages.map(e=>g`
                        <li>${e}</li>
                    `)}
            </ul>
        `:g``}hasDescription(){return this.querySelector(`[slot="description"]`)!==null||!!this.description}getDescribedByIds(){let e=[];return this.errorMessages.length&&e.push(`${this.formElementId}-errors`),this.hasDescription()&&e.push(`${this.formElementId}-description`),e}updateAriaDescribedBy(){let e=this.getDescribedByIds().join(` `),t=this.renderRoot.querySelectorAll(`input, textarea, select, .select2-search__field, .select2-selection`);for(let n of t)e?n.setAttribute(`aria-describedby`,e):n.removeAttribute(`aria-describedby`)}connectedCallback(){super.connectedCallback(),this.addEventListener(`evaluate`,e=>{let t=e.detail,n=t.silent||!1,r=this.evaluateCallback(t.data,n);t.respond(r)})}static get styles(){return[E(!1),An(),y`
                .validation-errors {
                    color: var(--dbp-danger);
                    list-style: none;
                    padding-left: 0;
                    margin-block: 0.25em;
                }

                .description {
                    color: var(--dbp-muted);
                    font-size: 0.875rem;
                    line-height: 1.4;
                    margin-bottom: 0.25em;
                }
                .required-mark {
                    color: var(--dbp-danger);
                }

                .slotted-label {
                    display: block;
                }

                .slotted-label--block {
                    display: flex;
                    align-items: baseline;
                }

                .slotted-label--block .required-mark {
                    flex-shrink: 0;
                }

                .slotted-label:not(.slotted-label--block) .required-mark {
                    display: none;
                }

                .slotted-label--required:not(.slotted-label--block)::after {
                    content: '*';
                    color: var(--dbp-danger);
                }
            `]}update(e){super.update(e),e.forEach((e,t)=>{t===`lang`&&this.handleErrorsIfAny()})}updated(e){super.updated(e),this.updateAriaDescribedBy()}handleInputValue(e){this.value=e.target.value,this.dispatchEvent(new CustomEvent(`change`,{detail:{name:this.name,value:this.value},bubbles:!0,composed:!0}))}render(){if(this.hidden)return g``;this.handleErrorsIfAny();let e=this.querySelector(`[slot="label"]`),t=e!==null,n=e&&Array.from(e.children).some(e=>getComputedStyle(e).display===`block`),r=[t?`slotted-label`:``,n?`slotted-label--block`:``,t&&this.required?`slotted-label--required`:``].filter(Boolean).join(` `);return g`
            <fieldset>
                <label
                    id="${this.formElementId}-label"
                    for="${this.formElementId}"
                    class="${r}">
                    <slot name="label">${this.label}</slot>
                    ${this.required&&(t||this.label)?g`
                                  <span class="required-mark">
                                      ${this._i18n.t(`render-form.base-object.required-field`)}
                                  </span>
                              `:g``}
                </label>
                ${this.hasDescription()?g`
                              <div class="description" id="${this.formElementId}-description">
                                  <slot name="description">${this.description}</slot>
                              </div>
                          `:``}
                ${this.renderErrorMessages()} ${this.renderInput()}
            </fieldset>
        `}renderInput(){return g`
            Please implement renderInput() in your subclass!
        `}},Hn=class extends S(Vn){constructor(){super(),this.label=`A string field`,this.rows=1,this.placeholder=``,this.maxLength=null,this.wordCountLimit=null,this.textareaRef=u(),this.inputRef=u(),this._userProvidedValidator=null,this.type=`text`}static get properties(){return{...super.properties,rows:{type:Number},placeholder:{type:String},maxLength:{type:Number,attribute:`maxlength`},wordCountLimit:{type:Number,attribute:`word-count-limit`},type:{type:String}}}firstUpdated(){super.firstUpdated(),this.type===`url`&&(this.customValidator=e=>{if(e===``)return[];try{return new URL(e),[]}catch{return[this._i18n.t(`render-form.string.invalid-url`)]}}),this.customValidator&&(this._userProvidedValidator=this.customValidator);let e=this.rows>1?this.textareaRef.value:this.inputRef.value;this.maxLength&&e&&e.addEventListener(`input`,e=>{this.customValidator=()=>{if(this._userProvidedValidator){let e=this._userProvidedValidator(this.value);if(e)return e}return this.value.length>this.maxLength?this._i18n.t(`render-form.base-object.max-length`,{maxLength:this.maxLength}):null},this.handleErrors()}),this.wordCountLimit&&e&&e.addEventListener(`input`,t=>{let n=e.value.trim().split(/\s+/);this.customValidator=()=>{if(this._userProvidedValidator){let e=this._userProvidedValidator(this.value);if(e)return e}return n.length>this.wordCountLimit?this._i18n.t(`render-form.string.word-count-exceeded`,{wordLimit:this.wordCountLimit,wordCount:n.length}):null},this.handleErrors()})}static get styles(){return[...super.styles,y`
                :host([layout-type='inline']) fieldset {
                    display: flex;
                    gap: var(--dbp-enum-label-gap, 1em);
                    align-items: center;
                }

                :host([layout-type='inline'][rows]) fieldset {
                    display: flex;
                    gap: var(--dbp-enum-label-gap, 1em);
                    align-items: flex-start;
                }

                :host([layout-type='inline']) label {
                    margin-bottom: 0;
                    white-space: nowrap;
                }

                textarea {
                    resize: vertical;
                }

                textarea[disabled],
                input[disabled] {
                    opacity: 0.5;
                    cursor: not-allowed;
                }
            `]}renderInput(){return g`
            ${this.rows>1?g`
                          <textarea
                              id="${this.formElementId}"
                              ${o(this.textareaRef)}
                              name="${this.name}"
                              rows="${this.rows}"
                              .value="${this.value}"
                              placeholder="${this.placeholder}"
                              @input="${this.handleInputValue}"
                              maxlength="${this.maxLength}"
                              ?disabled=${this.disabled}
                              ?required=${this.required}></textarea>
                      `:g`
                          <input
                              type="${this.type}"
                              id="${this.formElementId}"
                              ${o(this.inputRef)}
                              name="${this.name}"
                              .value="${this.value}"
                              placeholder="${this.placeholder}"
                              @input="${this.handleInputValue}"
                              maxlength="${this.maxLength}"
                              ?disabled=${this.disabled}
                              ?required=${this.required} />
                      `}
        `}};export{In as a,Ln as i,Vn as n,Nn as o,Bn as r,jn as s,Hn as t};
//# sourceMappingURL=string.qUj92gVq.js.map