@enablerr-ui/detail 0.3.186 → 0.3.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(e){"use strict";var t,n,r,i,o,s,a,l,c,d,u,f;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.settings,s=e.TextArea,a=e.toasts,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){f=e.taskClipboard}],execute:function(){function h(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}e("version","0.3.186");const m=e("checkDate",(e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map(e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e).filter(e=>!!e).join(" · ")),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},g=(e,t)=>{let n,r;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=t[e+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(e=>""!==e).join(" - ").trim()},w=e=>!0===e?"(ja)":!1===e?"(nein)":"",y=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t};return(e.display?.reduce((t,r)=>{let[i,o]=r.split(".");if(e.list?.find(({name:e})=>e===i)&&o&&void 0!==n[i]){const e=`${i}_${o}`;n[e]=n[i][o],i=e}return t.find(e=>e===i)||t.push(i),t},[]).map(e=>"boolean"==typeof n[e]?w(n[e]):m(n["_"+e]||n[e]))||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&w(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!v(e)).join(" · ")).filter(e=>!!e).join(" • ")},v=e=>/^[0-9a-f]{24}/.test(e),I=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};function $(){}function _(e){return e()}function C(){return Object.create(null)}function E(e){e.forEach(_)}function A(e){return"function"==typeof e}function b(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function S(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return $;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function N(e){return null==e?"":e}function T(e,t,n=t){return e.set(n),t}function R(e,t){e.appendChild(t)}function D(e,t,n){e.insertBefore(t,n||null)}function x(e){e.parentNode.removeChild(e)}function k(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function O(e){return document.createElement(e)}function M(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function P(e){return document.createTextNode(e)}function B(){return P(" ")}function L(){return P("")}function F(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function V(e){return function(t){return t.preventDefault(),e.call(this,t)}}function U(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function W(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function H(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function z(e,t){e.value=null==t?"":t}function j(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function q(e,t,n){e.classList[n?"add":"remove"](t)}let G;function X(e){G=e}function Y(){if(!G)throw new Error("Function called outside component initialization");return G}function Z(e){Y().$$.on_mount.push(e)}function K(e){Y().$$.on_destroy.push(e)}function Q(){const e=Y();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const i=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}function J(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ee=[],te=[],ne=[],re=[],ie=Promise.resolve();let oe=!1;function se(){oe||(oe=!0,ie.then(fe))}function ae(){return se(),ie}function le(e){ne.push(e)}function ce(e){re.push(e)}let de=!1;const ue=new Set;function fe(){if(!de){de=!0;do{for(let e=0;e<ee.length;e+=1){const t=ee[e];X(t),he(t.$$)}for(X(null),ee.length=0;te.length;)te.pop()();for(let e=0;e<ne.length;e+=1){const t=ne[e];ue.has(t)||(ue.add(t),t())}ne.length=0}while(ee.length);for(;re.length;)re.pop()();oe=!1,de=!1,ue.clear()}}function he(e){if(null!==e.fragment){e.update(),E(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(le)}}const me=new Set;let pe;function ge(){pe={r:0,c:[],p:pe}}function we(){pe.r||E(pe.c),pe=pe.p}function ye(e,t){e&&e.i&&(me.delete(e),e.i(t))}function ve(e,t,n,r){if(e&&e.o){if(me.has(e))return;me.add(e),pe&&pe.c.push(()=>{me.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function Ie(e,t){const n=t.token={};function r(e,r,i,o){if(t.token!==n)return;t.resolved=o;let s=t.ctx;void 0!==i&&(s=s.slice(),s[i]=o);const a=e&&(t.current=e)(s);let l=!1;t.block&&(t.blocks?t.blocks.forEach((e,n)=>{n!==r&&e&&(ge(),ve(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),we())}):t.block.d(1),a.c(),ye(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&fe()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=Y();if(e.then(e=>{X(n),r(t.then,1,t.value,e),X(null)},e=>{if(X(n),r(t.catch,2,t.error,e),X(null),!t.hasCatch)throw e}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}var i}function $e(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}const _e="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Ce(e,t){ve(e,1,1,()=>{t.delete(e.key)})}function Ee(e,t,n,r,i,o,s,a,l,c,d,u){let f=e.length,h=o.length,m=f;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=h;m--;){const e=u(i,o,m),a=n(e);let l=s.get(a);l?r&&l.p(e,t):(l=c(a,e),l.c()),w.set(a,g[m]=l),a in p&&y.set(a,Math.abs(m-p[a]))}const v=new Set,I=new Set;function $(e){ye(e,1),e.m(a,d),s.set(e.key,e),d=e.first,h--}for(;f&&h;){const t=g[h-1],n=e[f-1],r=t.key,i=n.key;t===n?(d=t.first,f--,h--):w.has(i)?!s.has(r)||v.has(r)?$(t):I.has(i)?f--:y.get(r)>y.get(i)?(I.add(r),$(t)):(v.add(i),f--):(l(n,s),f--)}for(;f--;){const t=e[f];w.has(t.key)||l(t,s)}for(;h;)$(g[h-1]);return g}function Ae(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function be(e){e&&e.c()}function Se(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||le(()=>{const t=o.map(_).filter(A);s?s.push(...t):E(t),e.$$.on_mount=[]}),a.forEach(le)}function Ne(e,t){const n=e.$$;null!==n.fragment&&(E(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Te(e,t,n,r,i,o,s=[-1]){const a=G;X(e);const l=e.$$={fragment:null,ctx:null,props:o,update:$,not_equal:i,bound:C(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:t.context||[]),callbacks:C(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(e,t.props||{},(t,n,...r)=>{const o=r.length?r[0]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=o)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](o),c&&function(e,t){-1===e.$$.dirty[0]&&(ee.push(e),se(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,E(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);l.fragment&&l.fragment.l(e),e.forEach(x)}else l.fragment&&l.fragment.c();t.intro&&ye(e.$$.fragment),Se(e,t.target,t.anchor,t.customElement),fe()}X(a)}class Re{$destroy(){Ne(this,1),this.$destroy=$}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function De(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polygon"),W(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),W(r,"points","12 15 17 21 7 21 12 15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-airplay "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function xe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ke extends Re{constructor(e){super(),Te(this,e,xe,De,b,{size:0,strokeWidth:1,class:2})}}function Oe(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("line"),i=M("line"),W(n,"d","M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"),W(r,"x1","12"),W(r,"y1","9"),W(r,"x2","12"),W(r,"y2","13"),W(i,"x1","12"),W(i,"y1","17"),W(i,"x2","12.01"),W(i,"y2","17"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Me(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Pe extends Re{constructor(e){super(),Te(this,e,Me,Oe,b,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("circle"),r=M("polyline"),i=M("line"),W(n,"cx","12"),W(n,"cy","12"),W(n,"r","10"),W(r,"points","8 12 12 16 16 12"),W(i,"x1","12"),W(i,"y1","8"),W(i,"x2","12"),W(i,"y2","16"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Le(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Fe extends Re{constructor(e){super(),Te(this,e,Le,Be,b,{size:0,strokeWidth:1,class:2})}}function Ve(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("path"),W(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),W(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-book-open "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Ue(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class We extends Re{constructor(e){super(),Te(this,e,Ue,Ve,b,{size:0,strokeWidth:1,class:2})}}function He(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("circle"),W(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),W(r,"cx","12"),W(r,"cy","13"),W(r,"r","4"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-camera "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class je extends Re{constructor(e){super(),Te(this,e,ze,He,b,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),W(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),W(r,"points","22 4 12 14.01 9 11.01"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Ge(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Xe extends Re{constructor(e){super(),Te(this,e,Ge,qe,b,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,r;return{c(){t=M("svg"),n=M("path"),W(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",r="feather feather-command "+e[2])},m(e,r){D(e,t,r),R(t,n)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&W(t,"class",r)},i:$,o:$,d(e){e&&x(t)}}}function Ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ke extends Re{constructor(e){super(),Te(this,e,Ze,Ye,b,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,r,i;return{c(){t=M("svg"),n=M("polyline"),r=M("path"),W(n,"points","9 10 4 15 9 20"),W(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Je(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class et extends Re{constructor(e){super(),Te(this,e,Je,Qe,b,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("line"),i=M("line"),W(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),W(r,"x1","18"),W(r,"y1","9"),W(r,"x2","12"),W(r,"y2","15"),W(i,"x1","12"),W(i,"y1","9"),W(i,"x2","18"),W(i,"y2","15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-delete "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function nt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class rt extends Re{constructor(e){super(),Te(this,e,nt,tt,b,{size:0,strokeWidth:1,class:2})}}function it(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),i=M("line"),W(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),W(r,"points","15 3 21 3 21 9"),W(i,"x1","10"),W(i,"y1","14"),W(i,"x2","21"),W(i,"y2","3"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-external-link "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function ot(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class st extends Re{constructor(e){super(),Te(this,e,ot,it,b,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,r,i,o,s;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),i=M("line"),o=M("line"),W(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),W(r,"points","14 2 14 8 20 8"),W(i,"x1","12"),W(i,"y1","18"),W(i,"x2","12"),W(i,"y2","12"),W(o,"x1","9"),W(o,"y1","15"),W(o,"x2","15"),W(o,"y2","15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){D(e,t,s),R(t,n),R(t,r),R(t,i),R(t,o)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&W(t,"class",s)},i:$,o:$,d(e){e&&x(t)}}}function lt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ct extends Re{constructor(e){super(),Te(this,e,lt,at,b,{size:0,strokeWidth:1,class:2})}}function dt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("circle"),r=M("line"),i=M("path"),W(n,"cx","12"),W(n,"cy","12"),W(n,"r","10"),W(r,"x1","2"),W(r,"y1","12"),W(r,"x2","22"),W(r,"y2","12"),W(i,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-globe "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function ut(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ft extends Re{constructor(e){super(),Te(this,e,ut,dt,b,{size:0,strokeWidth:1,class:2})}}function ht(e){let t,n,r,i,o,s,a,l;return{c(){t=M("svg"),n=M("line"),r=M("line"),i=M("line"),o=M("line"),s=M("line"),a=M("line"),W(n,"x1","8"),W(n,"y1","6"),W(n,"x2","21"),W(n,"y2","6"),W(r,"x1","8"),W(r,"y1","12"),W(r,"x2","21"),W(r,"y2","12"),W(i,"x1","8"),W(i,"y1","18"),W(i,"x2","21"),W(i,"y2","18"),W(o,"x1","3"),W(o,"y1","6"),W(o,"x2","3.01"),W(o,"y2","6"),W(s,"x1","3"),W(s,"y1","12"),W(s,"x2","3.01"),W(s,"y2","12"),W(a,"x1","3"),W(a,"y1","18"),W(a,"x2","3.01"),W(a,"y2","18"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",l="feather feather-list "+e[2])},m(e,l){D(e,t,l),R(t,n),R(t,r),R(t,i),R(t,o),R(t,s),R(t,a)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&W(t,"class",l)},i:$,o:$,d(e){e&&x(t)}}}function mt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class pt extends Re{constructor(e){super(),Te(this,e,mt,ht,b,{size:0,strokeWidth:1,class:2})}}function gt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),W(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),W(r,"points","22,6 12,13 2,6"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-mail "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function wt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class yt extends Re{constructor(e){super(),Te(this,e,wt,gt,b,{size:0,strokeWidth:1,class:2})}}function vt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("circle"),W(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),W(r,"cx","12"),W(r,"cy","10"),W(r,"r","3"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function It(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class $t extends Re{constructor(e){super(),Te(this,e,It,vt,b,{size:0,strokeWidth:1,class:2})}}function _t(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("polyline"),r=M("line"),i=M("path"),W(n,"points","23 7 23 1 17 1"),W(r,"x1","16"),W(r,"y1","8"),W(r,"x2","23"),W(r,"y2","1"),W(i,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Ct(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Et extends Re{constructor(e){super(),Te(this,e,Ct,_t,b,{size:0,strokeWidth:1,class:2})}}function At(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("rect"),r=M("line"),i=M("line"),W(n,"x","3"),W(n,"y","3"),W(n,"width","18"),W(n,"height","18"),W(n,"rx","2"),W(n,"ry","2"),W(r,"x1","12"),W(r,"y1","8"),W(r,"x2","12"),W(r,"y2","16"),W(i,"x1","8"),W(i,"y1","12"),W(i,"x2","16"),W(i,"y2","12"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function bt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class St extends Re{constructor(e){super(),Te(this,e,bt,At,b,{size:0,strokeWidth:1,class:2})}}function Nt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("polyline"),r=M("path"),i=M("rect"),W(n,"points","6 9 6 2 18 2 18 9"),W(r,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),W(i,"x","6"),W(i,"y","14"),W(i,"width","12"),W(i,"height","8"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-printer "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Tt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Rt extends Re{constructor(e){super(),Te(this,e,Tt,Nt,b,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("circle"),r=M("line"),W(n,"cx","11"),W(n,"cy","11"),W(n,"r","8"),W(r,"x1","21"),W(r,"y1","21"),W(r,"x2","16.65"),W(r,"y2","16.65"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-search "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function xt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class kt extends Re{constructor(e){super(),Te(this,e,xt,Dt,b,{size:0,strokeWidth:1,class:2})}}const{document:Ot}=_e;function Mt(e){e[53]=e[54].items}function Pt(e,t,n){const r=e.slice();return r[55]=t[n],r[57]=n,r}function Bt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Lt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Ft(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Vt(e){let t,n,r,i,o,s;Mt(e);let a=e[5]?.length&&Ut(e),l=e[53]?.length&&Ht(e),c=e[5]?.length&&qt(e);return{c(){a&&a.c(),t=B(),n=O("div"),r=O("table"),l&&l.c(),i=B(),o=O("tbody"),c&&c.c(),W(r,"striped",""),W(r,"class","svelte-47aais"),W(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),D(e,t,d),D(e,n,d),R(n,r),l&&l.m(r,null),R(r,i),R(r,o),c&&c.m(o,null),s=!0},p(e,n){Mt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&ye(a,1)):(a=Ut(e),a.c(),ye(a,1),a.m(t.parentNode,t)):a&&(ge(),ve(a,1,1,()=>{a=null}),we()),e[53]?.length?l?l.p(e,n):(l=Ht(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&ye(c,1)):(c=qt(e),c.c(),ye(c,1),c.m(o,null)):c&&(ge(),ve(c,1,1,()=>{c=null}),we())},i(e){s||(ye(a),ye(c),s=!0)},o(e){ve(a),ve(c),s=!1},d(e){a&&a.d(e),e&&x(t),e&&x(n),l&&l.d(),c&&c.d()}}}function Ut(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&Wt(e);function h(t){e[34](t)}let m={id:e[11]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),te.push(()=>Ae(i,"value",h)),i.$on("input",e[15]),l=new rt({props:{size:"18"}}),{c(){f&&f.c(),t=B(),n=O("div"),r=P("Suchen: "),be(i.$$.fragment),s=B(),a=O("span"),be(l.$$.fragment),W(a,"class","feather pointer svelte-47aais"),j(n,"margin-bottom","1em"),j(n,"position","relative")},m(o,h){f&&f.m(o,h),D(o,t,h),D(o,n,h),R(n,r),Se(i,n,null),R(n,s),R(n,a),Se(l,a,null),c=!0,d||(u=F(a,"click",e[17]),d=!0)},p(e,n){e[6]?f?64&n[0]&&ye(f,1):(f=Wt(e),f.c(),ye(f,1),f.m(t.parentNode,t)):f&&(ge(),ve(f,1,1,()=>{f=null}),we());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],ce(()=>o=!1)),i.$set(r)},i(e){c||(ye(f),ye(i.$$.fragment,e),ye(l.$$.fragment,e),c=!0)},o(e){ve(f),ve(i.$$.fragment,e),ve(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&x(t),e&&x(n),Ne(i),Ne(l),d=!1,u()}}}function Wt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Ht(e){let t,n,r,i=e[4]&&e[0]&&zt(),o=e[53],s=[];for(let t=0;t<o.length;t+=1)s[t]=jt(Lt(e,o,t));return{c(){t=O("thead"),n=O("tr"),i&&i.c(),r=B();for(let e=0;e<s.length;e+=1)s[e].c();W(n,"class","svelte-47aais"),W(t,"class","svelte-47aais")},m(e,o){D(e,t,o),R(t,n),i&&i.m(n,null),R(n,r);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(e[4]&&e[0]?i||(i=zt(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),16388&t[0]){let r;for(o=e[53],r=0;r<o.length;r+=1){const i=Lt(e,o,r);s[r]?s[r].p(i,t):(s[r]=jt(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&x(t),i&&i.d(),k(s,e)}}}function zt(e){let t;return{c(){t=O("th"),W(t,"class","svelte-47aais")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function jt(e){let t,n,r=e[58]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-47aais")},m(e,r){D(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[58]?.designation+"")&&H(n,r)},d(e){e&&x(t)}}}function qt(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[55].index||e[55]?._id;for(let t=0;t<o.length;t+=1){let n=Pt(e,o,t),a=s(n);i.set(a,r[t]=Zt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);D(e,t,i),n=!0},p(e,n){356415&n[0]&&(o=e[5],ge(),r=Ee(r,n,s,1,e,o,i,t.parentNode,Ce,Zt,t,Pt),we())},i(e){if(!n){for(let e=0;e<o.length;e+=1)ye(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ve(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&x(t)}}}function Gt(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Xt(e),l=e[53],c=[];for(let t=0;t<l.length;t+=1)c[t]=Yt(Bt(e,l,t));return{c(){t=O("tr"),a&&a.c(),n=B();for(let e=0;e<c.length;e+=1)c[e].c();r=B(),W(t,"class","pointer svelte-47aais"),q(t,"active",e[55]._id===e[1]),q(t,"blocked",!!e[55].blocked),q(t,"undeliverable",!!e[55].undeliverable)},m(l,d){D(l,t,d),a&&a.m(t,null),R(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);R(t,r),i=!0,o||(s=F(t,"click",U(function(){A(e[13](e[55],e[57]))&&e[13](e[55],e[57]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&ye(a,1)):(a=Xt(e),a.c(),ye(a,1),a.m(t,n)):a&&(ge(),ve(a,1,1,()=>{a=null}),we()),20516&o[0]){let n;for(l=e[53],n=0;n<l.length;n+=1){const i=Bt(e,l,n);c[n]?c[n].p(i,o):(c[n]=Yt(i),c[n].c(),c[n].m(t,r))}for(;n<c.length;n+=1)c[n].d(1);c.length=l.length}34&o[0]&&q(t,"active",e[55]._id===e[1]),32&o[0]&&q(t,"blocked",!!e[55].blocked),32&o[0]&&q(t,"undeliverable",!!e[55].undeliverable)},i(e){i||(ye(a),i=!0)},o(e){ve(a),i=!1},d(e){e&&x(t),a&&a.d(),k(c,e),o=!1,s()}}}function Xt(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"class","editRow svelte-47aais"),j(t,"color","#326173")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",U(function(){A(e[18](e[55]))&&e[18](e[55]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Yt(e){let t,n,r,i=e[12](e[55],e[58])+"";return{c(){t=O("td"),n=P(i),W(t,"class",r=N(e[58].type)+" svelte-47aais")},m(e,r){D(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[12](e[55],e[58])+"")&&H(n,i),4&o[0]&&r!==(r=N(e[58].type)+" svelte-47aais")&&W(t,"class",r)},d(e){e&&x(t)}}}function Zt(e,t){let n,r,i,o=t[16](t[55],t[53],t[3]),s=o&&Gt(t);return{key:e,first:null,c(){n=L(),s&&s.c(),r=L(),this.first=n},m(e,t){D(e,n,t),s&&s.m(e,t),D(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[16](t[55],t[53],t[3])),o?s?(s.p(t,n),44&n[0]&&ye(s,1)):(s=Gt(t),s.c(),ye(s,1),s.m(r.parentNode,r)):s&&(ge(),ve(s,1,1,()=>{s=null}),we())},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(n),s&&s.d(e),e&&x(r)}}}function Kt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Qt(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Kt,then:Vt,catch:Ft,value:54,blocks:[,,,]};return Ie(n=e[2]&&e[14](),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[14]())&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}const Jt=e("getDisplayItems",async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function en(e,o,s){let a,l,d;S(e,i,e=>s(40,l=e));let f=JSON.parse(n.getItem("Locale")).id;const h=Q(),{Loading:p,TextField:g}=c,{currentTasks:y,loggedIn:v}=u;S(e,y,e=>s(39,a=e)),S(e,v,e=>s(41,d=e));let I,$,_,C,E,{inputList:A}=o,{eventId:b}=o,{prevEventId:N}=o,{record:T}=o,{className:R}=o,{rowId:D}=o,{filterForReady:x=!1}=o,{filter:k}=o,{query:O}=o,{refStatus:M}=o,{showEdit:P=!1}=o,{praefix:B=""}=o,{selectionFields:L=!1}=o,{deList:F}=o,{stopAggregation:V=!1}=o,{shouldBlock:U}=o,{inputSearch:W=""}=o,H=!0,z=W,j=R+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=!1,G=!0;const X=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(f,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?w(n):m(e[`_${t.name}`]||n||"")},Y=t.getSchemaByClass(R),K=async(e,n)=>{if(!e)return[];if(k){let n=k;const r=k.startsWith("!");r&&(n=k.replace("!",""));const i=k.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=k.replace("$","");const[r,i]=n.split(".");if(T[i]){const n=await t.getSectionView(r,{[i]:T[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(M&&!O)return s(19,M=[].concat(M)),e.filter(e=>!!M.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(N){const n=await t.getEvent(N);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===R)return"Information"===n.state.task?e.filter(e=>"Closed"!==e._task.status):e.filter(e=>"Ready"===e._task.status)}return e.filter(e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status)},J=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(f,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t},ee=async e=>{let n,r=0;G=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await Y;for(;r++<200&&!V&&!(n=await te(e,o.id));)await i(500);s(6,q=!1),V&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=J($.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),G=!0,document.getElementById(j)?.focus()},100))},te=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ne=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(B),c=l&&await up(s,l);if(!c)return e;const d=c[a];return d?.length?d.map(n=>{let r=e?.find(e=>e._id===n[t])||{};r={...r};for(const e in r)n[e]&&(r[e]=n[e]);for(const e in n)n[e]&&(r[e]=n[e]);return cp(o+r._id.toString(),r),r}):e};Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(j)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await Y;e.eventId===t.id&&(fp(t.class,e.eventId),s(2,H=!s(2,H=!1)))});return e.$$set=e=>{"inputList"in e&&s(21,A=e.inputList),"eventId"in e&&s(22,b=e.eventId),"prevEventId"in e&&s(23,N=e.prevEventId),"record"in e&&s(24,T=e.record),"className"in e&&s(25,R=e.className),"rowId"in e&&s(1,D=e.rowId),"filterForReady"in e&&s(26,x=e.filterForReady),"filter"in e&&s(27,k=e.filter),"query"in e&&s(28,O=e.query),"refStatus"in e&&s(19,M=e.refStatus),"showEdit"in e&&s(0,P=e.showEdit),"praefix"in e&&s(29,B=e.praefix),"selectionFields"in e&&s(30,L=e.selectionFields),"deList"in e&&s(31,F=e.deList),"stopAggregation"in e&&s(20,V=e.stopAggregation),"shouldBlock"in e&&s(32,U=e.shouldBlock),"inputSearch"in e&&s(33,W=e.inputSearch)},[P,D,H,z,I,_,q,p,g,y,v,j,X,(e,t)=>n=>{s(20,V=!0);const r=G?e:C[t];h("choose",{row:r})},async()=>{$=await Y,s(4,I=(e=>!a?.length||!!a.find(t=>t===e))($.id)),O&&s(5,_=C=await t.getTasksFiltered($.class,O)),_||s(5,_=C=J($.displaySort,await A||await ap($.class,$.id))),500!==_?.length||O||(s(6,q=!0),await t.getTasksList($.id,!1,!0).then(({aggregationId:e})=>ee(e)));let e,n=!1,r="";const i=L&&L?.find(e=>$.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(B);if(o){const[a,l]=i.refClass.split(":");$.class===a&&s(5,_=await ne(_,a,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],o,a,"quantity")}s(0,P&&=!i),!i&&(k||x||M)&&s(5,_=await K(_,$)),E=$.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>$.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:c}=$;let u=await Jt(c,$,_);if(!P&&n?(u=u.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),s(5,_=_.map((t,n)=>{const r=e.find(e=>e._id===t._id);return r&&(t.ist=r.quantity.$numberDecimal),t.index=n,t})),e.map(e=>{if(!_.find(t=>t._id===e._id)){const t=C.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),_.push(t)}}),h("init",_)):F&&s(5,_=_.filter(e=>!F.find(t=>t?._id===e._id))),U&&s(5,_=_.filter(e=>!e[U])),E){const e={businessEmail:d.user},n=await t.getSectionView("employee",e);s(5,_=n?.length?_.filter(e=>e.employee===n[0]._id):[])}return{items:u}},({detail:{value:e}})=>{s(3,z=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=X(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,z="")},async e=>{let t=e._task;t||(t=await lp(R,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},M,V,A,b,N,T,R,x,k,O,B,L,F,U,W,function(e){z=e,s(3,z)}]}class tn extends Re{constructor(e){var t;super(),Ot.getElementById("svelte-47aais-style")||((t=O("style")).id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",R(Ot.head,t)),Te(this,e,en,Qt,b,{inputList:21,eventId:22,prevEventId:23,record:24,className:25,rowId:1,filterForReady:26,filter:27,query:28,refStatus:19,showEdit:0,praefix:29,selectionFields:30,deList:31,stopAggregation:20,shouldBlock:32,inputSearch:33},[-1,-1,-1])}}function nn(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function rn(e){let t,n,r=e[45]&&on(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&ye(r,1)):(r=on(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function on(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[pn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1048577&n[0]&&(r.title=e[20]?"Auswahl":e[0]),262144&n[0]&&(r.class="eList "+(e[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function sn(e){let t,n;return t=new yp({props:{schema:e[2],recID:e[1],readonly:e[19]}}),t.$on("choose",function(){A(e[34](e[45]))&&e[34](e[45]).apply(this,arguments)}),t.$on("back",e[31]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(n,r){e=n;const i={};4&r[0]&&(i.schema=e[2]),2&r[0]&&(i.recID=e[1]),524288&r[0]&&(i.readonly=e[19]),t.$set(i)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function an(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[cn,ln],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new tn({props:{inputSearch:e[15],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[14],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],praefix:e[9],selectionFields:e[10],rowId:e[1],shouldBlock:e[16],deList:e[12],stopAggregation:e[24],showEdit:e[11]}}),s.$on("edit",e[35]),s.$on("choose",e[38]),s.$on("init",e[36]),{c(){be(t.$$.fragment),n=B(),i.c(),o=B(),be(s.$$.fragment)},m(e,i){Se(t,e,i),D(e,n,i),c[r].m(e,i),D(e,o,i),Se(s,e,i),a=!0},p(e,n){const a={};1048576&n[0]&&(a.text=e[20]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):(ge(),ve(c[u],1,1,()=>{c[u]=null}),we(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),ye(i,1),i.m(o.parentNode,o));const f={};32768&n[0]&&(f.inputSearch=e[15]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),16384&n[0]&&(f.prevEventId=e[14]),32&n[0]&&(f.filterForReady=e[5]),64&n[0]&&(f.filter=e[6]),128&n[0]&&(f.query=e[7]),256&n[0]&&(f.refStatus=e[8]),512&n[0]&&(f.praefix=e[9]),1024&n[0]&&(f.selectionFields=e[10]),2&n[0]&&(f.rowId=e[1]),65536&n[0]&&(f.shouldBlock=e[16]),4096&n[0]&&(f.deList=e[12]),16777216&n[0]&&(f.stopAggregation=e[24]),2048&n[0]&&(f.showEdit=e[11]),s.$set(f)},i(e){a||(ye(t.$$.fragment,e),ye(i),ye(s.$$.fragment,e),a=!0)},o(e){ve(t.$$.fragment,e),ve(i),ve(s.$$.fragment,e),a=!1},d(e){Ne(t,e),e&&x(n),c[r].d(e),e&&x(o),Ne(s,e)}}}function ln(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[dn]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&un(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),W(t,"class","form--buttons svelte-jb5mrh")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[29]&&e[13]?o?(o.p(e,r),8192&r[0]&&ye(o,1)):(o=un(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function cn(e){let t,n,r,i,o,s,a=e[23]&&hn(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[mn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=B(),n=O("div"),be(r.$$.fragment),i=B(),be(o.$$.fragment),W(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),D(e,t,l),D(e,n,l),Se(r,n,null),D(e,i,l),Se(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&ye(a,1)):(a=hn(e),a.c(),ye(a,1),a.m(t.parentNode,t)):a&&(ge(),ve(a,1,1,()=>{a=null}),we());const i={};32768&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};131072&n[0]&&(s.text="Liste aus "+e[17]),o.$set(s)},i(e){s||(ye(a),ye(r.$$.fragment,e),ye(o.$$.fragment,e),s=!0)},o(e){ve(a),ve(r.$$.fragment,e),ve(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&x(t),e&&x(n),Ne(r),e&&x(i),Ne(o,e)}}}function dn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function un(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[fn]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function fn(e){let t;return{c(){t=P("Neu")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function hn(e){let t,n;return t=new Su({props:{item:e[21],record:{_id:"",[e[21].name]:""},noForm:"true",classId:"sel_"+e[21].name,eventId:e[22],required:!1,hidden:!1,readonly:!1,deList:e[23]}}),t.$on("notify",e[37]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.item=e[21]),2097152&n[0]&&(r.record={_id:"",[e[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+e[21].name),4194304&n[0]&&(r.eventId=e[22]),8388608&n[0]&&(r.deList=e[23]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function mn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function pn(e){let t,n,r,i;const o=[an,sn],s=[];function a(e,t){return e[45].length&&!e[18]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function gn(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function wn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:gn,then:rn,catch:nn,value:45,blocks:[,,,]};return Ie(n=e[30](e[4]),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,16&r[0]&&n!==(n=e[30](e[4]))&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}function yn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=Q(),{currentTasks:d}=u;S(e,d,e=>r(41,i=e));let{title:f}=n,{schema:h}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:I}=n,{praefix:$=""}=n,{selectionFields:_=!1}=n,{showEdit:C=!0}=n,{deList:E}=n,{newAllowed:A=!0}=n,{prevEventId:b}=n,{inputSearch:N}=n,{shouldBlock:T}=n,R=h.id;h.class;let D,x,k,O,M,P,B,L="",F=!1,V=!1;f??=h.identity.designation;const U=!i?.length||i.find(e=>e===R);return e.$$set=e=>{"title"in e&&r(0,f=e.title),"schema"in e&&r(2,h=e.schema),"record"in e&&r(3,m=e.record),"recID"in e&&r(1,p=e.recID),"isOpening"in e&&r(4,g=e.isOpening),"filterForReady"in e&&r(5,w=e.filterForReady),"filter"in e&&r(6,y=e.filter),"query"in e&&r(7,v=e.query),"refStatus"in e&&r(8,I=e.refStatus),"praefix"in e&&r(9,$=e.praefix),"selectionFields"in e&&r(10,_=e.selectionFields),"showEdit"in e&&r(11,C=e.showEdit),"deList"in e&&r(12,E=e.deList),"newAllowed"in e&&r(13,A=e.newAllowed),"prevEventId"in e&&r(14,b=e.prevEventId),"inputSearch"in e&&r(15,N=e.inputSearch),"shouldBlock"in e&&r(16,T=e.shouldBlock)},[f,p,h,m,g,w,y,v,I,$,_,C,E,A,b,N,T,L,F,D,k,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await ap(h.class,h.id);if(x=_&&_?.find(e=>h.class===e.refClass.split(":")[0]),r(20,k=x?.value?.get&&x.value.get($)),k){O=x.refClass;const[e,n]=O.split(":"),[i]=n.split(".");r(21,M=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(M.refClass);r(22,P=o.id),r(17,L=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(18,F=!1),p||l("back"),C||l("back")},()=>{r(24,V=!0),r(18,F=!1),l("back")},()=>{r(24,V=!0),r(1,p=!1),r(19,D=!1),r(18,F=!0)},e=>({detail:{row:e}})=>{let t=h.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=h.list?.find(e=>e.name===n)?.item.find(e=>e.name===r);if(i){e[`${n}_${r}`]=e[n][r]}}),l("choose",{row:e})},({detail:e})=>{r(19,D=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(18,F=!0)},({detail:e})=>{k&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){J(e,t)}]}class vn extends Re{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=O("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",R(document.head,t)),Te(this,e,yn,wn,b,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:In}=_e;function $n(e){e[28]=e[30].list,e[29]=e[30].items}function _n(e,t,n){const r=e.slice();return r[31]=t[n],r}function Cn(e,t,n){const r=e.slice();return r[34]=t[n],r}function En(e,t,n){const r=e.slice();return r[34]=t[n],r}function An(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function bn(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[25](t)}$n(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Sn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let I={id:e[8]};void 0!==e[0]&&(I.value=e[0]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[29]?.length&&function(e){let t,n,r,i,o=e[29],s=[];for(let t=0;t<o.length;t+=1)s[t]=Nn(En(e,o,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),i=B();for(let e=0;e<s.length;e+=1)s[e].c();W(r,"class","svelte-14hcfjl"),W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,o){D(e,t,o),R(t,n),R(n,r),R(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(o=e[29],r=0;r<o.length;r+=1){const i=En(e,o,r);s[r]?s[r].p(i,t):(s[r]=Nn(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&x(t),k(s,e)}}}(e),_=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=Dn(_n(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(44547&n[0]){let s;for(r=e[28],s=0;s<r.length;s+=1){const o=_n(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Dn(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){$n(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&1&t[0]&&(a=!0,i.value=e[0],ce(()=>a=!1)),s.$set(i),e[29]?.length&&$.p(e,t),e[28]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),ye(_),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),ve(_),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function Sn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Nn(e){let t,n,r=e[34]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Tn(e){let t,n,r,i,o,s,a,l;r=new st({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=Rn(Cn(e,c,t));return{c(){t=O("tr"),n=O("td"),be(r.$$.fragment),i=B();for(let e=0;e<d.length;e+=1)d[e].c();o=B(),W(n,"class","editRow svelte-14hcfjl"),W(t,"class","pointer svelte-14hcfjl"),q(t,"active",e[31]._id===e[1])},m(c,u){D(c,t,u),R(t,n),Se(r,n,null),R(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);R(t,o),s=!0,a||(l=F(n,"click",e[15](e[31])),a=!0)},p(n,r){if(e=n,3584&r[0]){let n;for(c=e[29],n=0;n<c.length;n+=1){const i=Cn(e,c,n);d[n]?d[n].p(i,r):(d[n]=Rn(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2050&r[0]&&q(t,"active",e[31]._id===e[1])},i(e){s||(ye(r.$$.fragment,e),s=!0)},o(e){ve(r.$$.fragment,e),s=!1},d(e){e&&x(t),Ne(r),k(d,e),a=!1,l()}}}function Rn(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function Dn(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&Tn(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){1&n[0]&&(r=e[13](e[31],e[29],e[0])),r?i?(i.p(e,n),1&n[0]&&ye(i,1)):(i=Tn(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function xn(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function kn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:xn,then:bn,catch:An,value:30,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function On(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[kn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Mn(e,n,i){const o=Q(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{classId:h}=n,{className:p}=n,{rowId:g}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:$}=n,{multiValues:_}=n,{searchValue:C=""}=n,E=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(E)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&fp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,f=e.item),"classId"in e&&i(17,h=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(1,g=e.rowId),"viewName"in e&&i(19,y=e.viewName),"viewValue"in e&&i(20,v=e.viewValue),"recordId"in e&&i(21,I=e.recordId),"filter"in e&&i(22,$=e.filter),"multiValues"in e&&i(23,_=e.multiValues),"searchValue"in e&&i(0,C=e.searchValue)},[C,g,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(f.lookup){let r,i,o;if("string"==typeof f.lookup){if(r="."+h+"#"+f.lookup,i=document.querySelector(r),o=i?.value||I,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await ap(f.name,e.id)}else if(o&&24===o.toString().length){const e=await up(f.lookup,o);if(e&&e[f.name]&&e[f.name].length){const r=e[f.name]?.map(e=>e[f.name]);r?.length&&(n=await t.getSectionView(f.name,{_id:{$in:r}},!0)),n?.length||(n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0))}else n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0)}}else{const{refItem:e,refList:s}=f.lookup,[a,l]=e.split(".");if(r="."+h+"#"+a,i=document.querySelector(r),o=i?.value||I,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0)}}}}else{const r="."+h+"#"+y.split(":")[0],i=document.querySelector(r);let o={[y]:i?.value||I};if(f.refItem){const e="."+h+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};o={...o,...e}}}catch{}}o[y]&&(n=await t.getSectionView(e.class,o,!0)),$&&(n=n.filter(e=>e._id!=$))}const r=e.display;return{list:n,items:await Jt(r,e,n)}},({detail:{value:e}})=>{i(0,C=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(A(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(0,C="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},f,h,p,y,v,I,$,_,()=>o("back"),function(e){C=e,i(0,C)}]}class Pn extends Re{constructor(e){var t;super(),In.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(In.head,t)),Te(this,e,Mn,On,b,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:Bn}=_e;function Ln(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Fn(e){let t,n,r=e[83]&&function(e){let t,n,r,i,o,a,l,c,d,u,f,h,m,p,g,w,y,v,I,$;function _(t){e[63](t)}function C(t){e[64](t)}let E={class:"full-width",id:e[34],name:e[34],rows:"1",required:e[2],disabled:e[3]||e[36],placeholder:e[36]?"":e[37],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[1]&&(E.value=e[1]);void 0!==e[27]&&(E.overwrite=e[27]);n=new s({props:E}),te.push(()=>Ae(n,"value",_)),te.push(()=>Ae(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[Wn,Un,Vn],b=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=b[a]=A[a](e));let T=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&qn(e);function k(t){e[65](t)}let M={class:"tModal",noClickaway:!0,$$slots:{default:[Zn]},$$scope:{ctx:e}};void 0!==e[19]&&(M.open=e[19]);m=new e[30]({props:M}),te.push(()=>Ae(m,"open",k));let P=e[20]&&Kn(e),V=e[24]&&er(e);return{c(){t=O("div"),be(n.$$.fragment),o=B(),l&&l.c(),c=B(),d=O("input"),f=B(),T&&T.c(),h=B(),be(m.$$.fragment),g=B(),P&&P.c(),w=B(),V&&V.c(),y=L(),W(d,"class",u=N(e[9]||e[10])+" svelte-10ggg6v"),W(d,"id",e[5]),W(d,"name",e[5]),d.value=e[0],d.hidden=!0,j(t,"position","relative")},m(r,i){D(r,t,i),Se(n,t,null),R(t,o),~a&&b[a].m(t,null),R(t,c),R(t,d),R(t,f),T&&T.m(t,null),D(r,h,i),Se(m,r,i),D(r,g,i),P&&P.m(r,i),D(r,w,i),V&&V.m(r,i),D(r,y,i),v=!0,I||($=F(t,"keydown",e[41]),I=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]||e[36]),!r&&2&o[0]&&(r=!0,s.value=e[1],ce(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],ce(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&b[a].p(e,o):(l&&(ge(),ve(b[f],1,1,()=>{b[f]=null}),we()),~a?(l=b[a],l?l.p(e,o):(l=b[a]=A[a](e),l.c()),ye(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=N(e[9]||e[10])+" svelte-10ggg6v"))&&W(d,"class",u),(!v||32&o[0])&&W(d,"id",e[5]),(!v||32&o[0])&&W(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?T&&(ge(),ve(T,1,1,()=>{T=null}),we()):T?(T.p(e,o),196617&o[0]&&ye(T,1)):(T=qn(e),T.c(),ye(T,1),T.m(t,null));const h={};344784337&o[0]|4194304&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],ce(()=>p=!1)),m.$set(h),e[20]?P?(P.p(e,o),1048576&o[0]&&ye(P,1)):(P=Kn(e),P.c(),ye(P,1),P.m(w.parentNode,w)):P&&(ge(),ve(P,1,1,()=>{P=null}),we()),e[24]?V?(V.p(e,o),16777216&o[0]&&ye(V,1)):(V=er(e),V.c(),ye(V,1),V.m(y.parentNode,y)):V&&(ge(),ve(V,1,1,()=>{V=null}),we())},i(e){v||(ye(n.$$.fragment,e),ye(l),ye(T),ye(m.$$.fragment,e),ye(P),ye(V),v=!0)},o(e){ve(n.$$.fragment,e),ve(l),ve(T),ve(m.$$.fragment,e),ve(P),ve(V),v=!1},d(e){e&&x(t),Ne(n),~a&&b[a].d(),T&&T.d(),e&&x(h),Ne(m,e),e&&x(g),P&&P.d(e),e&&x(w),V&&V.d(e),e&&x(y),I=!1,$()}}}(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,t){e[83]&&r.p(e,t)},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Vn(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[48]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Un(e){let t,n,r,i,o;return n=new kt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=[F(t,"click",e[40](!0)),F(t,"choose",e[44])],i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,E(o)}}}function Wn(e){let t,n,r,i;const o=[jn,zn,Hn],s=[];function a(e,t){return e[0]?0:!e[3]&&e[12]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Hn(e){let t,n,r;return n=new St({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather3 svelte-10ggg6v")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function zn(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[50]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function jn(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[48]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function qn(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[47]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Gn(e){let t,n,r,i;const o=[Yn,Xn],s=[];function a(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Xn(e){let t,n;return t=new vn({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[35],query:e[38](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[26],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[28],inputSearch:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.title=e[6].designation),8388608&n[0]&&(r.newAllowed=e[23]),2048&n[0]&&(r.prevEventId=e[11]),262144&n[0]&&(r.schema=e[18]),128&n[0]&&(r.record=e[7]),1&n[0]&&(r.recID=e[0]),524288&n[0]&&(r.isOpening=e[19]),67108864&n[0]&&(r.filterForReady=e[26]),64&n[0]&&(r.refStatus=e[6].refStatus),16384&n[0]&&(r.selectionFields=e[14]),32768&n[0]&&(r.deList=e[15]),8192&n[0]&&(r.praefix=e[13]),268435456&n[0]&&(r.shouldBlock=e[28]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Yn(e){let t,n;return t=new Pn({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8],searchValue:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.item=e[6]),262144&n[0]&&(r.className=e[18].class),1024&n[0]&&(r.classId=e[10]),1&n[0]&&(r.rowId=e[0]),4096&n[0]&&(r.recordId=e[12]),16&n[0]&&(r.viewName=e[4]),256&n[0]&&(r.multiValues=e[8]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Zn(e){let t,n,r=e[19]&&Gn(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&ye(r,1)):(r=Gn(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Kn(e){let t,n,r;function i(t){e[66](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Jn]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[30]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function Qn(e){let t,n;return t=new yp({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),1&n[0]&&(r.recID=e[0]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Jn(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Qn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function er(e){let t,n,r;function i(t){e[67](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[nr]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function tr(e){let t,n;return t=new yp({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),33554432&n[0]&&(r.dialogAttr=e[25]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function nr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[tr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function rr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function ir(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:rr,then:Fn,catch:Ln,value:83,blocks:[,,,]};return Ie(e[39](),r),{c(){t=L(),r.block.c()},m(e,i){D(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){$e(r,e=t,n)},i(e){n||(ye(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ve(r.blocks[e])}n=!1},d(e){e&&x(t),r.block.d(e),r.token=null,r=null}}}function or(e,n,r){let s,a,l,d,f;S(e,i,e=>r(62,s=e)),S(e,o,e=>r(73,f=e));const h=Q(),{Dialog:m,Modal:p}=c,{currentTasks:g,environment:w,loggedIn:v}=u;S(e,g,e=>r(70,a=e)),S(e,w,e=>r(72,d=e)),S(e,v,e=>r(71,l=e));let{id:I}=n,{item:$}=n,{record:_}=n,{fullRecord:C}=n,{value:E=""}=n,{multiValues:A}=n,{desc:b=""}=n,{noForm:N=!1}=n,{classId:T}=n,{eventId:R}=n,{recordId:D}=n,{withRefValue:x=!1}=n,{refValue:k=""}=n,{shortEdit:O}=n,{required:M}=n,{disabled:P}=n,{readonly:B}=n,{praefix:L}=n,{selectionFields:F}=n,{formnovalidate:V}=n,{selection:U}=n,{deList:W}=n,{isTemplate:H}=n,{noList:z=!1}=n,{multi:j=!1}=n,{initFinished:q}=n,{listName:G=""}=n;const X="comment_"+I,Y=$.filter,Z=$.properties?.startDialog;let K,J,ee,te,ne,re,ie,oe,se=!1,ae=!0,le=!1,ce=!0,de=!0,ue=!1,fe="";!U&&$.selection&&1===$.selection.split(":").length&&(U=$.selection);const he=B||P||$.lookup||U&&!$.constraint?"":"Suchbegriff ⏎",me=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},pe=()=>{$.refItem&&$.refItem.startsWith("owner")&&(r(52,k=d.owner[$.refClass]),k||r(52,k=me($.refItem,d)),k&&(r(51,x=!0),h("change",{value:k})))},ge=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{h("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},we=async e=>{const n=()=>{r(19,se=!0)};if(9==e.which)return;if(E)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),$.lookup)return n();const i=te.items.find(e=>e.properties?.search);if(!i)return n();const o=e.srcElement.value,{name:s,checkOn:a,refClass:l,properties:c}=i;let{search:d}=c;!0===d&&(d={}),"number"==typeof d&&(d={min:d});const{min:u=3,start:f=!1,end:h=!1}=d;if(o.length<u)return n();const m=(f?"^":"")+o+(h?"$":"");let p={[s]:{$regex:m,$options:"i"}};a&&(p=[{$lookup:{from:l,localField:s,foreignField:"_id",as:l}},{$match:{[l+"."+a]:{$regex:m,$options:"i"}}}]);const g=await t.getSectionView(te.class,p);1!==g?.length?n():r(0,E=g[0]._id)},ye=e=>{e&&(r(61,fe=r(1,b=y(te,e))),h("setRefDesc",b.split(" •")[0]),h("change",{value:E,description:b}),h("task",{row:e,eventId:te.id}))},ve=()=>{r(19,se=!1),r(20,J=!1)},Ie=()=>{r(24,le=!1)};return e.$$set=e=>{"id"in e&&r(5,I=e.id),"item"in e&&r(6,$=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,E=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,b=e.desc),"noForm"in e&&r(9,N=e.noForm),"classId"in e&&r(10,T=e.classId),"eventId"in e&&r(11,R=e.eventId),"recordId"in e&&r(12,D=e.recordId),"withRefValue"in e&&r(51,x=e.withRefValue),"refValue"in e&&r(52,k=e.refValue),"shortEdit"in e&&r(56,O=e.shortEdit),"required"in e&&r(2,M=e.required),"disabled"in e&&r(3,P=e.disabled),"readonly"in e&&r(53,B=e.readonly),"praefix"in e&&r(13,L=e.praefix),"selectionFields"in e&&r(14,F=e.selectionFields),"formnovalidate"in e&&r(57,V=e.formnovalidate),"selection"in e&&r(4,U=e.selection),"deList"in e&&r(15,W=e.deList),"isTemplate"in e&&r(16,H=e.isTemplate),"noList"in e&&r(58,z=e.noList),"multi"in e&&r(17,j=e.multi),"initFinished"in e&&r(54,q=e.initFinished),"listName"in e&&r(59,G=e.listName)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),4160&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(53,B||=D&&$.asInput),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&x&&r(0,E=k),3&e.$$.dirty[0]|1073741824&e.$$.dirty[1]&&!b&&E&&fe&&r(1,b=fe),399425&e.$$.dirty[0]|411041792&e.$$.dirty[1]&&E&&te){let e=!1;if(!Array.isArray(E)){if(D||$.asInput||$.upate||!1!==$.refItem||!0===j||!1===$.refItem&&q){const t="p$"+G+"$"+$.refClass+"$"+R,n=sp(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===E);t?ye(t):lp($.refClass,te.id,E,!!$.lookup||z).then(ye)}):e=!0}e&&lp($.refClass,te.id,E,!!$.lookup||z).then(ye),r(54,q=!0)}}if(65&e.$$.dirty[0]|536870912&e.$$.dirty[1]|1&e.$$.dirty[2]&&E&&ne&&$.name===ne.input?.at(0)&&ne.inputLookup?.length){const{domain:e}=ne.inputLookup[0]||{};"user"===e&&(s.some(e=>ne.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!E&&te&&ye({})},[E,b,M,P,U,I,$,C,A,N,T,R,D,L,F,W,H,j,te,se,J,ee,re,ae,le,ie,ce,de,ue,m,p,g,w,v,X,Y,Z,he,()=>{if(!$.query)return;const[e,t]=$.query.split(".");let n;return n=C[t]?[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:C[t]}}]:[{$match:{[e]:C[e]}}],$.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":$.refStatus}}])),n},async()=>{try{if(K=await t.getEvent(R),oe="report"===K.output.type,r(26,ce=!$.asInput),r(23,ae=K.output?.class[0].name!==$.refClass),r(18,te=await t.getSchemaByClass($.refClass)),te?.blocked)return h("initFail",!0),!1;if(oe||r(28,ue=((e,t)=>{let n=t.items.find(e=>!!e.properties?.blocking);if(!n)return!1;if(e.input?.class?.find(e=>e.name===t.class))return n.name;const r=e.output?.class.at(0)?.list||[];for(const e of r){const t=e.item.find(e=>e.name===$.name);if(t?.properties?.blocking)return n.name}return!1})(K,te)),r(22,re=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(60,ne=await t.getSchema(R)),R&&D&&E&&!P&&ne.input?.find(e=>e===$.refClass)&&r(3,P=!0),K.input?.class&&K.input.class[0]&&(K.input.class[0].name===$.refClass&&K.input.class[0].readonly&&r(3,P=!0),D&&K.input.class[0].name===$.refClass&&K.input.class[0].writeState)){(await t.getTaskByDocId(D,!0)).status===K.input.class[0].writeState&&r(3,P=r(53,B=!1))}if($.properties?.query?.lookup){const{domain:e,value:n}=$.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},o=await t.getSectionView($.refClass,i);if(o?.length){const[{_id:e}]=o;e&&(r(52,k=e),r(51,x=!0),h("change",{value:k}))}s.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else pe();if(!P&&!k&&$.filter&&(""===L||void 0===L)){const e=$.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly($.refClass,{[$.filter]:n});i&&(r(52,k=i._id),r(51,x=!0),h("change",{value:k}))}return r(21,ee=te.identity.designation),E||ge(te),!0}catch{return h("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!Z){if(!0===e&&r(19,se=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}($.lookup||U&&!$.constraint||E)&&r(19,se=!0)}},we,()=>{if(E)return"";r(1,b="");const e=document.querySelectorAll("#"+T+" #"+X)[0];return e?.value?e.value:""},async({detail:e})=>{if(e.className=te.class,r(0,E=e.row._id),""===L||void 0===L?h("saveDialog",{itemName:$.name,value:E,closeTask:$.properties?.closeTask}):h("listChange",e),$.properties?.closeTask&&K.output?.approval){const e=await t.getTaskByDocId(_._id),n=K.output.approval.flatMap(({refRole:e})=>e),r={eventId:R,eventDesignation:K.identity.designation,docId:_._id,role:n.filter(e=>s.find(t=>t===e)).join(", "),user:f.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}Ie()},({detail:e})=>{r(0,E=e.row._id),ve()},ve,Ie,()=>{(oe||re)&&(j?h("change",{value:E,delete:!0}):(r(0,E=""),r(1,b=""),r(27,de=!0),h("change",{value:E,description:b}),h("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id})))},async()=>{if(!E)return;let e=await lp($.refClass,te.id,E);e._task||(e={_task:await t.getTaskByDocId(E,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{E||b&&we({which:13,preventDefault:()=>{},srcElement:{value:b}})},async e=>{r(25,ie={});for(const e in Z){let n=Z[e],i="";if(n.startsWith("owner"))i=me(n,d);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await ap("",o.id);if(a?.length){a=a.sort((e,t)=>e[r]>t[r]?1:e[r]<t[r]?-1:0);const e=a.findIndex(e=>e._id===s);i=a[+e+1]._id||""}}else if(n.includes("|"))for(const e of n.split("|"))i||(i=_[e]);else i=_[n]||C&&C[n];r(25,ie[e]=i,ie)}r(24,le=!0)},x,k,B,q,_,O,V,z,G,ne,fe,s,function(e){b=e,r(1,b),r(0,E),r(61,fe),r(51,x),r(52,k)},function(e){de=e,r(27,de)},function(e){se=e,r(19,se)},function(e){J=e,r(20,J)},function(e){le=e,r(24,le)}]}class sr extends Re{constructor(e){var t;super(),Bn.getElementById("svelte-10ggg6v-style")||((t=O("style")).id="svelte-10ggg6v-style",t.textContent=".feather.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-10ggg6v{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.feather3.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:gray}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}.modal-overlay.tModal2 > .dialog{margin-top:0 !important}",R(Bn.head,t)),Te(this,e,or,ir,b,{id:5,item:6,record:55,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:51,refValue:52,shortEdit:56,required:2,disabled:3,readonly:53,praefix:13,selectionFields:14,formnovalidate:57,selection:4,deList:15,isTemplate:16,noList:58,multi:17,initFinished:54,listName:59},[-1,-1,-1])}}const{document:ar}=_e;function lr(e){e[45]=e[46].items}function cr(e,t,n){const r=e.slice();return r[47]=t[n],r[49]=n,r}function dr(e,t,n){const r=e.slice();return r[50]=t[n],r[52]=n,r}function ur(e,t,n){const r=e.slice();return r[50]=t[n],r}function fr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function hr(e){let t,n,r,i;lr(e);const o=[pr,mr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){lr(e);let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function mr(e){let t,n;return t=new yp({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.schema=e[4]),128&n[0]&&(r.recID=e[7]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function pr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v,I,$,_;n=new e[12]({props:{outline:!0,$$slots:{default:[gr]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let C=e[1]&&wr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[vr]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let E=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}(e);function A(t){e[34](t)}let b={id:e[13]};void 0!==e[3]&&(b.value=e[3]),d=new e[10]({props:b}),te.push(()=>Ae(d,"value",A)),d.$on("input",e[19]),m=new rt({props:{size:"18"}});let S=e[45]?.length&&Ir(e),N=e[5]?.length&&_r(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),C&&C.c(),i=B(),be(o.$$.fragment),s=B(),E&&E.c(),a=B(),l=O("div"),c=P("Suchen: "),be(d.$$.fragment),f=B(),h=O("span"),be(m.$$.fragment),p=B(),g=O("div"),w=O("table"),S&&S.c(),y=B(),v=O("tbody"),N&&N.c(),W(t,"class","form--buttons svelte-4visk8"),W(h,"class","feather pointer svelte-4visk8"),j(l,"margin-bottom","1em"),j(l,"position","relative"),W(w,"striped",""),W(w,"class","svelte-4visk8"),W(g,"class","eList svelte-4visk8")},m(u,A){D(u,t,A),Se(n,t,null),R(t,r),C&&C.m(t,null),R(t,i),Se(o,t,null),D(u,s,A),E&&E.m(u,A),D(u,a,A),D(u,l,A),R(l,c),Se(d,l,null),R(l,f),R(l,h),Se(m,h,null),D(u,p,A),D(u,g,A),R(g,w),S&&S.m(w,null),R(w,y),R(w,v),N&&N.m(v,null),I=!0,$||(_=F(h,"click",e[21]),$=!0)},p(e,r){const s={};16777216&r[1]&&(s.$$scope={dirty:r,ctx:e}),n.$set(s),e[1]?C?(C.p(e,r),2&r[0]&&ye(C,1)):(C=wr(e),C.c(),ye(C,1),C.m(t,i)):C&&(ge(),ve(C,1,1,()=>{C=null}),we());const a={};32&r[0]&&(a.disabled=!e[5].length),16777216&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],ce(()=>u=!1)),d.$set(l),e[45]?.length?S?(S.p(e,r),4&r[0]&&ye(S,1)):(S=Ir(e),S.c(),ye(S,1),S.m(w,y)):S&&(ge(),ve(S,1,1,()=>{S=null}),we()),e[5]?.length?N?(N.p(e,r),32&r[0]&&ye(N,1)):(N=_r(e),N.c(),ye(N,1),N.m(v,null)):N&&(ge(),ve(N,1,1,()=>{N=null}),we())},i(e){I||(ye(n.$$.fragment,e),ye(C),ye(o.$$.fragment,e),ye(E),ye(d.$$.fragment,e),ye(m.$$.fragment,e),ye(S),ye(N),I=!0)},o(e){ve(n.$$.fragment,e),ve(C),ve(o.$$.fragment,e),ve(E),ve(d.$$.fragment,e),ve(m.$$.fragment,e),ve(S),ve(N),I=!1},d(e){e&&x(t),Ne(n),C&&C.d(),Ne(o),e&&x(s),E&&E.d(e),e&&x(a),e&&x(l),Ne(d),Ne(m),e&&x(p),e&&x(g),S&&S.d(),N&&N.d(),$=!1,_()}}}function gr(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function wr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[yr]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16777216&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function yr(e){let t;return{c(){t=P("Neu")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function vr(e){let t;return{c(){t=P("Bestätigen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ir(e){let t,n,r,i,o,s,a,l;i=new Xe({props:{size:"20",style:"color: #326173;"}});let c=e[45],d=[];for(let t=0;t<c.length;t+=1)d[t]=$r(ur(e,c,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),be(i.$$.fragment),o=B();for(let e=0;e<d.length;e+=1)d[e].c();W(r,"class","svelte-4visk8"),W(n,"class","svelte-4visk8"),W(t,"class","svelte-4visk8")},m(c,u){D(c,t,u),R(t,n),R(n,r),Se(i,r,null),R(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=F(r,"click",function(){A(e[22](e[5]))&&e[22](e[5]).apply(this,arguments)}),a=!0)},p(t,r){if(e=t,262148&r[0]){let t;for(c=e[45],t=0;t<c.length;t+=1){const i=ur(e,c,t);d[t]?d[t].p(i,r):(d[t]=$r(i),d[t].c(),d[t].m(n,null))}for(;t<d.length;t+=1)d[t].d(1);d.length=c.length}},i(e){s||(ye(i.$$.fragment,e),s=!0)},o(e){ve(i.$$.fragment,e),s=!1},d(e){e&&x(t),Ne(i),k(d,e),a=!1,l()}}}function $r(e){let t,n,r=e[50]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-4visk8")},m(e,r){D(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[50]?.designation+"")&&H(n,r)},d(e){e&&x(t)}}}function _r(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[47]._id;for(let t=0;t<o.length;t+=1){let n=cr(e,o,t),a=s(n);i.set(a,r[t]=br(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);D(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],ge(),r=Ee(r,n,s,1,e,o,i,t.parentNode,Ce,br,t,cr),we())},i(e){if(!n){for(let e=0;e<o.length;e+=1)ye(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ve(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&x(t)}}}function Cr(e){let t,n,r,i,o=e[0],s=Er(e),a=e[45],l=[];for(let t=0;t<a.length;t+=1)l[t]=Ar(dr(e,a,t));return{c(){t=O("tr"),s.c(),n=B();for(let e=0;e<l.length;e+=1)l[e].c();r=B(),W(t,"class","svelte-4visk8"),q(t,"active",e[0].includes(e[47]._id))},m(e,o){D(e,t,o),s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);R(t,r),i=!0},p(e,i){if(1&i[0]&&b(o,o=e[0])?(ge(),ve(s,1,1,$),we(),s=Er(e),s.c(),ye(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=dr(e,a,n);l[n]?l[n].p(o,i):(l[n]=Ar(o),l[n].c(),l[n].m(t,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=a.length}33&i[0]&&q(t,"active",e[0].includes(e[47]._id))},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(t),s.d(e),k(l,e)}}}function Er(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[47]._id,checked:e[0].includes(e[47]._id),round:!0}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"title","Wählt den Wert aus"),W(t,"class","svelte-4visk8")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[47]._id),33&t[0]&&(r.checked=e[0].includes(e[47]._id)),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Ar(e){let t,n,r,i=e[16](e[47],e[50])+"";return{c(){t=O("td"),n=P(i),W(t,"class",r=N(e[50].type)+" svelte-4visk8")},m(e,r){D(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[47],e[50])+"")&&H(n,i),4&o[0]&&r!==(r=N(e[50].type)+" svelte-4visk8")&&W(t,"class",r)},d(e){e&&x(t)}}}function br(e,t){let n,r,i,o=t[20](t[47],t[45],t[3]),s=o&&Cr(t);return{key:e,first:null,c(){n=L(),s&&s.c(),r=L(),this.first=n},m(e,t){D(e,n,t),s&&s.m(e,t),D(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[47],t[45],t[3])),o?s?(s.p(t,n),44&n[0]&&ye(s,1)):(s=Cr(t),s.c(),ye(s,1),s.m(r.parentNode,r)):s&&(ge(),ve(s,1,1,()=>{s=null}),we())},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(n),s&&s.d(e),e&&x(r)}}}function Sr(e){let t,n;return t=new e[9]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Nr(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Sr,then:hr,catch:fr,value:46,blocks:[,,,]};return Ie(n=e[2]&&e[18](),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[18]())&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}function Tr(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=Q(),{Loading:l,TextField:d,Checkbox:u,Button:f}=c;let h,p,g,y,{inputList:v}=i,{selection:I}=i,{item:$}=i,{target:_}=i,{className:C}=i,{classId:E}=i,{recordId:A}=i,{stopAggregation:b=!1}=i,{shouldNew:S}=i,N=!0,T=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",R=!1;I||=[];let D=I;const x=C+_+"checkbox",k=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?w(n):m(e[`_${t.name}`]||n||"")},O=t.getSchemaByClass(C),M=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(s,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t};Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(T)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(fp(t.class,e.eventId),o(2,N=!o(2,N=!1)))});const P=()=>{o(6,R=!1)};return e.$$set=e=>{"inputList"in e&&o(26,v=e.inputList),"selection"in e&&o(0,I=e.selection),"item"in e&&o(27,$=e.item),"target"in e&&o(28,_=e.target),"className"in e&&o(29,C=e.className),"classId"in e&&o(30,E=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,b=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew)},[I,S,N,h,p,g,R,y,a,l,d,u,f,T,!1,x,k,()=>{const e=document.getElementsByName(x),t=Array.from(e).filter(e=>e.checked).map(e=>e.attributes.data.value);if(h){const e=D.filter(e=>!t.find(t=>t==e));o(0,I=t.concat(e)),D=[...I]}else o(0,I=t),D=[];a("choose",{list:I})},async()=>{o(4,p=await O),g||o(5,g=M(p.displaySort,await v||await ap(p.class,p.id)));const{display:e}=p;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items})(e,p,g);return{items:n}},({detail:{value:e}})=>{o(3,h=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=k(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,h="")},e=>()=>{document.getElementsByName(x).forEach((e,t)=>{e.checked=!e.checked})},()=>{o(7,y=!1),o(6,R=!0)},async e=>{o(5,g=M(p.displaySort,await ap(p.class,p.id))),e.detail?.row?._id&&I.push(e.detail.row._id),P()},P,v,$,_,C,E,A,b,()=>a("back"),function(e){h=e,o(3,h)}]}class Rr extends Re{constructor(e){var t;super(),ar.getElementById("svelte-4visk8-style")||((t=O("style")).id="svelte-4visk8-style",t.textContent=".feather.svelte-4visk8.svelte-4visk8{position:absolute;top:2em;right:0.5em;color:#326173}td .checkbox .selector{border:0.125em solid #326173 !important}.eList.svelte-4visk8.svelte-4visk8{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-4visk8 .editRow.svelte-4visk8{width:1em}.eList.svelte-4visk8 table.svelte-4visk8{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-4visk8 table thead.svelte-4visk8{position:sticky;top:0;background:#326173;color:white}.eList.svelte-4visk8 table thead tr.svelte-4visk8{height:2.3em}.eList.svelte-4visk8 table tbody tr.svelte-4visk8{height:2.75em !important}th.svelte-4visk8.svelte-4visk8,td.svelte-4visk8.svelte-4visk8{padding-left:0.4em;padding-right:0.4em}td.number.svelte-4visk8.svelte-4visk8{text-align:end}tr.active.svelte-4visk8.svelte-4visk8{color:#326173;background-color:#fcebd5}.form--buttons.svelte-4visk8.svelte-4visk8{display:flex;gap:1em;padding:0.5em 0}",R(ar.head,t)),Te(this,e,Tr,Nr,b,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1},[-1,-1])}}function Dr(e,t,n){const r=e.slice();return r[12]=t[n],r[42]=n,r}function xr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function kr(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[Pr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};36863&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Or(e){let t,n,r,i,o;return n=new pt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[23]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Mr(e){let t,n;return t=new sr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[42],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0+"}"}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};32&n[0]&&(r.classId=e[5]),64&n[0]&&(r.eventId=e[6]),256&n[0]&&(r.required=e[8]),1&n[0]&&(r.disabled=e[0]),2048&n[0]&&(r.formnovalidate=e[11]),512&n[0]&&(r.readonly=e[9]),2&n[0]&&(r.id=e[1]+"."+e[42]),4&n[0]&&(r.item=e[2]),8&n[0]&&(r.desc=e[3]),32768&n[0]&&(r.value=e[12]),16&n[0]&&(r.noForm=e[4]),1024&n[0]&&(r.praefix=e[10]),128&n[0]&&(r.recordId=e[7]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Pr(e){let t,n,r,i=!e[9]&&Or(e),o=e[15],s=[];for(let t=0;t<o.length;t+=1)s[t]=Mr(Dr(e,o,t));const a=e=>ve(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=B();for(let e=0;e<s.length;e+=1)s[e].c();n=L()},m(e,o){i&&i.m(e,o),D(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);D(e,n,o),r=!0},p(e,r){if(e[9]?i&&(ge(),ve(i,1,1,()=>{i=null}),we()):i?(i.p(e,r),512&r[0]&&ye(i,1)):(i=Or(e),i.c(),ye(i,1),i.m(t.parentNode,t)),36863&r[0]){let t;for(o=e[15],t=0;t<o.length;t+=1){const i=Dr(e,o,t);s[t]?(s[t].p(i,r),ye(s[t],1)):(s[t]=Mr(i),s[t].c(),ye(s[t],1),s[t].m(n.parentNode,n))}for(ge(),t=o.length;t<s.length;t+=1)a(t);we()}},i(e){if(!r){ye(i);for(let e=0;e<o.length;e+=1)ye(s[e]);r=!0}},o(e){ve(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ve(s[e]);r=!1},d(e){i&&i.d(e),e&&x(t),k(s,e),e&&x(n)}}}function Br(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Lr(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Fr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Fr(e){let t,n;return t=new Rr({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[22](),target:e[2].name,shouldNew:!e[20]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};65536&n[0]&&(r.selection=e[16]),4&n[0]&&(r.item=e[2]),16384&n[0]&&(r.className=e[14].class),32&n[0]&&(r.classId=e[5]),128&n[0]&&(r.recordId=e[7]),4&n[0]&&(r.target=e[2].name),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Vr(e){let t,n,r=e[13]&&Lr(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&ye(r,1)):(r=Lr(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Ur(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Br,then:kr,catch:xr,value:40,blocks:[,,,]};function s(t){e[34](t)}Ie(e[21](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[Vr]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),te.push(()=>Ae(n,"open",s)),{c(){o.block.c(),t=B(),be(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,D(e,t,r),Se(n,e,r),i=!0},p(t,i){$e(o,e=t,i);const s={};90276&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],ce(()=>r=!1)),n.$set(s)},i(e){i||(ye(o.block),ye(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){ve(o.blocks[e])}ve(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&x(t),Ne(n,e)}}}function Wr(e,n,r){const i=Q(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,f,{id:h}=n,{item:m}=n,{record:p}=n,{value:g=[]}=n,{desc:w=""}=n,{noForm:y=!1}=n,{classId:v}=n,{eventId:I}=n,{recordId:$}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:b}=n,{praefix:S}=n,{selectionFields:N}=n,{formnovalidate:T}=n,{selection:R}=n,{deList:D}=n,{isTemplate:x}=n,{noList:k=!1}=n,O=!1;const{lookup:M,refStatus:P,filter:B,constraint:L}=m.properties.multi;A=!0;const F=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(1,h=e.id),"item"in e&&r(2,m=e.item),"record"in e&&r(26,p=e.record),"value"in e&&r(12,g=e.value),"desc"in e&&r(3,w=e.desc),"noForm"in e&&r(4,y=e.noForm),"classId"in e&&r(5,v=e.classId),"eventId"in e&&r(6,I=e.eventId),"recordId"in e&&r(7,$=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(8,E=e.required),"disabled"in e&&r(0,A=e.disabled),"readonly"in e&&r(9,b=e.readonly),"praefix"in e&&r(10,S=e.praefix),"selectionFields"in e&&r(29,N=e.selectionFields),"formnovalidate"in e&&r(11,T=e.formnovalidate),"selection"in e&&r(30,R=e.selection),"deList"in e&&r(31,D=e.deList),"isTemplate"in e&&r(32,x=e.isTemplate),"noList"in e&&r(33,k=e.noList)},[A,h,m,w,y,v,I,$,E,b,S,T,g,O,d,u,f,o,s,a,M,async()=>{r(15,u=[].concat(g)),r(14,d=await t.getSchemaByClass(m.refClass))},async()=>{let e,n;if(M)if(M.refClass){if(p[M.refClass]){const r=await up(M.refClass,p[M.refClass]);r&&Array.isArray(r[M.refItem])&&(n=[{$match:{_id:{$in:r[M.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[M]:p[M]}}],P&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":P}}])),e=await t.getSectionView(d.class,n,!0);else e=await ap("",d.id);if(!e?.length)return[];if(L&&e?.length){const{refClass:r,refStatus:i}=L,o=d.class===r?"_id":d.class;n=[{$match:{[o]:{$in:e.map(({_id:e})=>e)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":i}}];const s=await t.getSectionView(r,n,!0);"project"!==r&&(e=e.filter(e=>!!s.find(t=>t.project==e._id)))}if(B)for(const t in B)e=e.filter(e=>{let[n,r]=t.split(".");if(r||(r=n,n=""),n){if(e[n][0]&&e[n][0][r].length)return!0}else if(e[r])return!0;return!1});return e},()=>{b||(r(13,O=!0),r(16,f=u))},({detail:e})=>{p.__id||(r(15,u=e.list),i("change",{value:u}),i("multi",{lookup:M,filter:B,name:m.name,value:u})),F()},F,p,_,C,N,R,D,x,k,function(e){O=e,r(13,O)}]}class Hr extends Re{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=O("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",R(document.head,t)),Te(this,e,Wr,Ur,b,{id:1,item:2,record:26,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:27,refValue:28,required:8,disabled:0,readonly:9,praefix:10,selectionFields:29,formnovalidate:11,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const zr=/\d+/g,jr=/%[HMSpPdmyY%]/g;function qr(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(jr);let s=0,a=0;const l=new Date(0);for(const c of o){if(!e.startsWith(c,s))return n;if(s+=c.length,s===e.length){if(a!==t.length)return n;break}if("%"!==t[a+c.length])break;if(a+=c.length+1,"%"===t[a]){if("%"!==e[s])return n;s++}else if("p"===t[a].toLowerCase()){const t=e.substr(s,2).toUpperCase();if("AM"===t)i=!1,l.getHours()>=12&&l.setHours(l.getHours()-12);else{if("PM"!==t)return n;i=!0,l.getHours()<12&&l.setHours(l.getHours()+12)}}else{zr.lastIndex=s;const o=zr.exec(e);if(null==o)return n;switch(t[a]){case"H":l.setHours(parseInt(o[0])+12*i);break;case"M":l.setMinutes(o[0]);break;case"S":l.setSeconds(o[0]);break;case"d":l.setDate(o[0]);break;case"m":l.setMonth(o[0]-1);break;case"y":l.setFullYear(100*r+parseInt(o[0]));break;case"Y":l.setFullYear(o[0])}s+=o[0].length}a++}return isNaN(l.valueOf())?n:l}function Gr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Xr}=_e;function Yr(e,t,n){const r=e.slice();return r[17]=t[n],r}function Zr(e,t,n){const r=e.slice();return r[20]=t[n],r}function Kr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Qr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=ei(Zr(e,m,t));const g=e=>ve(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ti(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[ri]},$$scope:{ctx:e}}}),l.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[ii]},$$scope:{ctx:e}}}),{c(){t=O("form"),n=O("input"),i=B();for(let e=0;e<p.length;e+=1)p[e].c();o=B(),w&&w.c(),s=B(),a=O("div"),be(l.$$.fragment),c=B(),be(d.$$.fragment),W(n,"class",N(e[6])+" svelte-1phofh5"),W(n,"name","_id"),W(n,"type","hidden"),n.value=r=e[1]._id||"",W(t,"class","fTask svelte-1phofh5"),W(t,"id",e[6]),W(a,"class","form--buttons svelte-1phofh5")},m(r,m){D(r,t,m),R(t,n),R(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);R(t,o),w&&w.m(t,null),D(r,s,m),D(r,a,m),Se(l,a,null),R(a,c),Se(d,a,null),u=!0,f||(h=[F(t,"keydown",e[8]),F(t,"submit",V(e[10]))],f=!0)},p(e,i){if((!u||2&i&&r!==(r=e[1]._id||""))&&(n.value=r),75&i){let n;for(m=e[0].items,n=0;n<m.length;n+=1){const r=Zr(e,m,n);p[n]?(p[n].p(r,i),ye(p[n],1)):(p[n]=ei(r),p[n].c(),ye(p[n],1),p[n].m(t,o))}for(ge(),n=m.length;n<p.length;n+=1)g(n);we()}e[0].list?w?(w.p(e,i),1&i&&ye(w,1)):(w=ti(e),w.c(),ye(w,1),w.m(t,null)):w&&(ge(),ve(w,1,1,()=>{w=null}),we());const s={};8388608&i&&(s.$$scope={dirty:i,ctx:e}),l.$set(s);const a={};4&i&&(a.disabled=e[2]),8388608&i&&(a.$$scope={dirty:i,ctx:e}),d.$set(a)},i(e){if(!u){for(let e=0;e<m.length;e+=1)ye(p[e]);ye(w),ye(l.$$.fragment,e),ye(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)ve(p[e]);ve(w),ve(l.$$.fragment,e),ve(d.$$.fragment,e),u=!1},d(e){e&&x(t),k(p,e),w&&w.d(),e&&x(s),e&&x(a),Ne(l),Ne(d),f=!1,E(h)}}}function Jr(e){let t,n;return t=new Su({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.item=e[20]),1&n&&(r.selection=e[20].selection),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),1&n&&(r.eventId=e[0].id),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ei(e){let t,n,r=ai(!0,e[20]),i=r&&Jr(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){1&n&&(r=ai(!0,e[20])),r?i?(i.p(e,n),1&n&&ye(i,1)):(i=Jr(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function ti(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=ni(Yr(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(75&n){let s;for(r=e[0].list,s=0;s<r.length;s+=1){const o=Yr(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=ni(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}function ni(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new vi({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=B(),be(r.$$.fragment)},m(e,o){Se(t,e,o),D(e,n,o),Se(r,e,o),i=!0},p(e,n){const i={};1&n&&(i.text=e[17].designation),t.$set(i);const o={};1&n&&(o.list=e[17]),1&n&&(o.eventId=e[0].id),1&n&&(o.schema=e[17].item),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),r.$set(o)},i(e){i||(ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!0)},o(e){ve(t.$$.fragment,e),ve(r.$$.fragment,e),i=!1},d(e){Ne(t,e),e&&x(n),Ne(r,e)}}}function ri(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function ii(e){let t;return{c(){t=P("Speichern")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function oi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function si(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:oi,then:Qr,catch:Kr,value:16,blocks:[,,,]};return Ie(e[7](),i),{c(){t=B(),n=O("section"),i.block.c(),Xr.title="Vorgaben",W(n,"class","sTask svelte-1phofh5")},m(e,o){D(e,t,o),D(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){$e(i,e=t,n)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),e&&x(n),i.block.d(),i.token=null,i=null}}}const ai=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function li(e,r,s){let l,d,u;S(e,o,e=>s(11,d=e)),S(e,i,e=>s(12,u=e));const{Divider:f,Button:h,FormField:m}=c,p=JSON.parse(n.getItem("Locale"));let{schema:g}=r,{record:w}=r,y="template-"+g.class+Math.floor(9e3*Math.random()+1e3).toString(),v=!1;const I=()=>window.history.back(),$=(e,t,n=!1)=>{const r=t.id,i=e.find(e=>e.name===r);let o=t.value;if(!n&&i&&i.properties?.multi&&(o=w[r]),o&&i&&i.type.startsWith("date"))try{return qr(o,"%d.%m.%Y").toISOString()}catch{return new Date(o).toISOString()}if(i&&"boolean"===i.type&&(o=!!t.checked),i&&"number"===i.type){const e=Number("1.1").toLocaleString(p.id).substring(1,2);try{o=Number(o.replace(e,".")).toString()}catch{}}return o};return e.$$set=e=>{"schema"in e&&s(0,g=e.schema),"record"in e&&s(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&s(3,l=v)},[g,w,v,l,f,h,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&s(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));s(2,v||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},I,async e=>{const n={};Array.from(document.querySelectorAll("form#"+y+" ."+y)).map(e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[r,i]=t.split("."),o=g.list.find(e=>e.name===r);n[t]=$(o.item,e)}else n[t]=$(g.items,e)}),await t.saveTemplate(g.class,n),a.success("Die Vorgaben wurden gespeichert.",2e3),I()}]}const{document:ci}=_e;function di(e,t,n){const r=e.slice();return r[35]=t[n],r}function ui(e){let t,n;return t=new Su({props:{classId:e[3],item:e[35],listName:e[2].name,eventId:e[4],record:e[0],disabled:e[5],required:e[6],currency:e[9],notifyList:e[1]}}),t.$on("notify",e[15]),t.$on("defPrep",e[17]),t.$on("formula",e[19]),t.$on("task",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.classId=e[3]),4&n[0]&&(r.item=e[35]),4&n[0]&&(r.listName=e[2].name),16&n[0]&&(r.eventId=e[4]),1&n[0]&&(r.record=e[0]),32&n[0]&&(r.disabled=e[5]),64&n[0]&&(r.required=e[6]),512&n[0]&&(r.currency=e[9]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function fi(e){let t,n,r=ai(e[8],e[35]),i=r&&ui(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){260&n[0]&&(r=ai(e[8],e[35])),r?i?(i.p(e,n),260&n[0]&&ye(i,1)):(i=ui(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function hi(e){let t,n,r,i=e[2].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=fi(di(e,i,t));const s=e=>ve(o[e],1,1,()=>{o[e]=null});return{c(){t=O("div");for(let e=0;e<o.length;e+=1)o[e].c();W(t,"id",n=`accordion-content-${e[3]}-${e[2].name}`)},m(e,n){D(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(689023&a[0]){let n;for(i=e[2].item,n=0;n<i.length;n+=1){const r=di(e,i,n);o[n]?(o[n].p(r,a),ye(o[n],1)):(o[n]=fi(r),o[n].c(),ye(o[n],1),o[n].m(t,null))}for(ge(),n=i.length;n<o.length;n+=1)s(n);we()}(!r||12&a[0]&&n!==(n=`accordion-content-${e[3]}-${e[2].name}`))&&W(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)ye(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ve(o[e]);r=!1},d(e){e&&x(t),k(o,e)}}}function mi(e){let t,n,r=e[14](e[10])+"";return{c(){t=O("span"),n=P(r)},m(e,r){D(e,t,r),R(t,n)},p(e,t){1024&t[0]&&r!==(r=e[14](e[10])+"")&&H(n,r)},d(e){e&&x(t)}}}function pi(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[mi]},$$scope:{ctx:e}}}),n.$on("click",function(){A(e[16](e[34]))&&e[16](e[34]).apply(this,arguments)}),{c(){t=O("div"),be(n.$$.fragment),W(t,"class","accordion svelte-148ktt9"),W(t,"slot","handle")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(t,r){e=t;const i={};1024&r[0]|128&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function gi(e){let t,n;return t=new e[13]({props:{open:e[7],$$slots:{handle:[pi,({toggle:e})=>({34:e}),({toggle:e})=>[0,e?8:0]],default:[hi,({toggle:e})=>({34:e}),({toggle:e})=>[0,e?8:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[18]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};128&n[0]&&(r.open=e[7]),1919&n[0]|136&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function wi(e){let t,n,r;return n=new e[12]({props:{$$slots:{default:[gi]},$$scope:{ctx:e}}}),{c(){t=O("div"),be(n.$$.fragment),W(t,"class","formList")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};2047&t[0]|128&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function yi(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=c;let{list:a}=n,{schema:l}=n,{record:d}=n,{classId:u}=n,{eventId:f}=n,{disabled:h}=n,{required:y}=n,{open:v=!1}=n,{template:I={}}=n,{isTemplate:$=!1}=n,{currency:_}=n,{update:C=!1}=n,{notifyList:E}=n,A=new Map;const b={};let S=d[a.name]||{};d[a.name]=S;const N=(e,t)=>""===t[e.name]?"":e._attr?T(e,t[e.name]):"object"===e.type?D(t[e.name]):Array.isArray(t[e.name])?R(t[e.name]):"boolean"===e.type?w(t[e.name]):"number"===e.type?x(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?g(e.name,t):"date"===e.type?m(gDate(t[e.name])):"datetime"===e.type?p(t[e.name]):e.properties?.multi?"":t[e.name],T=(e,t)=>b[t]?.split(" • ").at(e._attr),R=e=>e.slice(0,3).join(", "),D=e=>b[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),x=(e,t)=>("number"==typeof e&&e||(e=Number(e||0)),e.toFixed(t||0)),k=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},O=async({item:e,value:t})=>{const n=l.find(t=>t.properties?.value?.formula?.argument?.find(t=>t.refItem===e.name));if(!n)return;const i=n.properties.value.formula,{operator:o,argument:s}=i,c=s.map(n=>n.refItem===e.name?t:S[n.refItem]||d[n.refItem]);let u=0;"$add"===o&&(u=c.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,d[a.name][n.name]=x(u,n.properties?.decimals),d)};return e.$$set=e=>{"list"in e&&r(2,a=e.list),"schema"in e&&r(20,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(3,u=e.classId),"eventId"in e&&r(4,f=e.eventId),"disabled"in e&&r(5,h=e.disabled),"required"in e&&r(6,y=e.required),"open"in e&&r(7,v=e.open),"template"in e&&r(21,I=e.template),"isTemplate"in e&&r(8,$=e.isTemplate),"currency"in e&&r(9,_=e.currency),"update"in e&&r(22,C=e.update),"notifyList"in e&&r(1,E=e.notifyList)},e.$$.update=()=>{4194309&e.$$.dirty[0]&&C&&d&&r(10,S=d[a.name]||{})},[d,E,a,u,f,h,y,v,$,_,S,i,o,s,e=>{let t=l;return a.display?.refItem&&(t=a.display.refItem.map(e=>{const[t,n]=e.split("."),r=l.find(e=>e.name===t);if(r)return r._attr=n,r}).filter(e=>!!e)),e&&t.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==e[t.name])&&"html"!==t.properties?.format&&"textarea"!==t.properties?.format).map(t=>N(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;r(1,E={listName:a.name,itemName:e.itemName,value:e.value}),e.desc&&(b[n]=e.desc);const i=d[t];r(0,d[t]={...i,[n]:e.value},d),r(10,S=d[t])},e=>t=>{(()=>{const e=I[a.name]||{};for(const t in e)I[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=I[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`;document.querySelector(n),ae().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(k)})},async({detail:{className:e,itemName:n,value:r}})=>{if(A.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+a.name)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&A.set(e,o[0])},()=>{setTimeout(()=>{Array.from(A).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},({detail:e})=>{O(e)},l,I,C,function(t){J(e,t)}]}class vi extends Re{constructor(e){var t;super(),ci.getElementById("svelte-148ktt9-style")||((t=O("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",R(ci.head,t)),Te(this,e,yi,wi,b,{list:2,schema:20,record:0,classId:3,eventId:4,disabled:5,required:6,open:7,template:21,isTemplate:8,currency:9,update:22,notifyList:1},[-1,-1])}}const{document:Ii}=_e;function $i(e){e[0]=e[23].list,e[22]=e[23].items}function _i(e,t,n){const r=e.slice();return r[24]=t[n],r}function Ci(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ei(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ai(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function bi(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[19](t)}$i(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Si]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[22]?.length&&function(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ni(Ei(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[22],o=0;o<r.length;o+=1){const s=Ei(e,r,o);i[o]?i[o].p(s,t):(i[o]=Ni(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}(e),_=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=Di(_i(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);D(e,t,n)},p(e,i){if(11778&i[0]){let o;for(n=e[0],o=0;o<n.length;o+=1){const s=_i(e,n,o);r[o]?r[o].p(s,i):(r[o]=Di(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){k(r,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){$i(e);const r={};2&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ce(()=>a=!1)),s.$set(i),e[22]?.length&&$.p(e,t),e[0]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function Si(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ni(e){let t,n,r=e[27]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Ti(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ri(Ci(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=B(),W(t,"class","pointer svelte-14hcfjl")},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Ci(e,r,s);i[s]?i[s].p(a,o):(i[s]=Ri(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}function Ri(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function Di(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Ti(e);return{c(){r&&r.c(),t=L()},m(e,n){r&&r.m(e,n),D(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[24],e[22],e[1])),n?r?r.p(e,i):(r=Ti(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&x(t)}}}function xi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ki(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:xi,then:bi,catch:Ai,value:23,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function Oi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ki]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Mi(e,n,r){const i=Q(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:h}=n,{list:p}=n,g="",y=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},I=t.getSchemaByClass(f);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(y)?.focus()},200)});return e.$$set=e=>{"item"in e&&r(15,u=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,p=e.list)},[p,g,i,o,s,a,l,d,y,v,e=>()=>i("choose",{row:e}),async()=>{const e=await I,t=e.display;let n=await Jt(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(v(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,g="")},u,f,h,()=>i("back"),function(e){g=e,r(1,g)}]}class Pi extends Re{constructor(e){var t;super(),Ii.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(Ii.head,t)),Te(this,e,Mi,Oi,b,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Bi}=_e;function Li(e,t,n){const r=e.slice();return r[12]=t[n],r}function Fi(e,t,n){const r=e.slice();return r[4]=t[n],r}function Vi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Ui(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=qi(Fi(e,i,t));const s=e=>ve(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&Gi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=B(),a&&a.c(),n=L()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);D(e,t,i),a&&a.m(e,i),D(e,n,i),r=!0},p(e,r){if(60655567&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=Fi(e,i,n);o[n]?(o[n].p(s,r),ye(o[n],1)):(o[n]=qi(s),o[n].c(),ye(o[n],1),o[n].m(t.parentNode,t))}for(ge(),n=i.length;n<o.length;n+=1)s(n);we()}e[8].list?a?(a.p(e,r),256&r[0]&&ye(a,1)):(a=Gi(e),a.c(),ye(a,1),a.m(n.parentNode,n)):a&&(ge(),ve(a,1,1,()=>{a=null}),we())},i(e){if(!r){for(let e=0;e<i.length;e+=1)ye(o[e]);ye(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ve(o[e]);ve(a),r=!1},d(e){k(o,e),e&&x(t),a&&a.d(e),e&&x(n)}}}function Wi(e){let t,n,r,i;const o=[zi,Hi],s=[];function a(e,t){return e[4].name!==e[15]||e[16]?"lookup"!==e[4].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=L()},m(e,n){~t&&s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ge(),ve(s[l],1,1,()=>{s[l]=null}),we()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){~t&&s[t].d(e),e&&x(r)}}}function Hi(e){let t,n;return t=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[4].name===e[15]&&e[16]||e[0],eventId:e[6],notifyList:e[2],currency:e[3],changeValue:e[10]}}),t.$on("notify",e[18]),t.$on("multi",e[19]),t.$on("defPrep",e[20]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};512&n[0]&&(r.classId=e[9]),256&n[0]&&(r.item=e[4]),128&n[0]&&(r.record=e[7]),257&n[0]&&(r.disabled=e[4].name===e[15]&&e[16]||e[0]),64&n[0]&&(r.eventId=e[6]),4&n[0]&&(r.notifyList=e[2]),8&n[0]&&(r.currency=e[3]),1024&n[0]&&(r.changeValue=e[10]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function zi(e){let t,n,r,i;n=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[0]||!!e[1],required:!0,eventId:e[6],notifyList:!0,currency:e[3],changeValue:e[10]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]),n.$on("record",e[24]),n.$on("objRecord",e[25]);let o=e[1]&&ji(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"padding-top",".25em"),j(t,"background-color","lightyellow"),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};512&r[0]&&(i.classId=e[9]),256&r[0]&&(i.item=e[4]),128&r[0]&&(i.record=e[7]),3&r[0]&&(i.disabled=e[0]||!!e[1]),64&r[0]&&(i.eventId=e[6]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&ye(o,1)):(o=ji(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function ji(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[23]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function qi(e){let t,n,r="list"!==e[4].type&&Wi(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&ye(r,1)):(r=Wi(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Gi(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Yi(Li(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(973&n[0]){let s;for(r=e[8].list,s=0;s<r.length;s+=1){const o=Li(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Yi(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}function Xi(e){let t,n,r,i,o;function s(t){e[31](t)}t=new e[13]({props:{text:e[12].designation}});let a={classId:e[9],list:e[12],eventId:e[6],schema:e[12].item,record:e[7],disabled:e[0],currency:e[3],update:!0};return void 0!==e[2]&&(a.notifyList=e[2]),r=new vi({props:a}),te.push(()=>Ae(r,"notifyList",s)),{c(){be(t.$$.fragment),n=B(),be(r.$$.fragment)},m(e,i){Se(t,e,i),D(e,n,i),Se(r,e,i),o=!0},p(e,n){const o={};256&n[0]&&(o.text=e[12].designation),t.$set(o);const s={};512&n[0]&&(s.classId=e[9]),256&n[0]&&(s.list=e[12]),64&n[0]&&(s.eventId=e[6]),256&n[0]&&(s.schema=e[12].item),128&n[0]&&(s.record=e[7]),1&n[0]&&(s.disabled=e[0]),8&n[0]&&(s.currency=e[3]),!i&&4&n[0]&&(i=!0,s.notifyList=e[2],ce(()=>i=!1)),r.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(r.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(r.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(n),Ne(r,e)}}}function Yi(e){let t,n,r="array"!==e[12].type&&Xi(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&ye(r,1)):(r=Xi(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Zi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Ki(e){let t,n;return t=new Pi({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.item=e[4]),32&n[0]&&(r.className=e[5]),512&n[0]&&(r.classId=e[9]),4096&n[0]&&(r.list=e[12]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Qi(e){let t,n,r=e[11]&&Ki(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&ye(r,1)):(r=Ki(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Ji(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:Zi,then:Ui,catch:Vi,value:56,blocks:[,,,]};function l(t){e[32](t)}Ie(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Qi]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),te.push(()=>Ae(i,"open",l)),{c(){a.block.c(),t=B(),be(n.$$.fragment),r=B(),be(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,D(e,t,o),Se(n,e,o),D(e,r,o),Se(i,e,o),s=!0},p(t,n){$e(a,e=t,n);const r={};6704&n[0]|1073741824&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],ce(()=>o=!1)),i.$set(r)},i(e){s||(ye(a.block),ye(n.$$.fragment,e),ye(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){ve(a.blocks[e])}ve(n.$$.fragment,e),ve(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&x(t),Ne(n,e),e&&x(r),Ne(i,e)}}}function eo(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=Q();let l,d,u,f,h,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:I}=n,{currency:$}=n,{notifyList:_}=n,C={},E=[],A=[],b={},S=new Map,N=!1,T="";const R=y.checkOn,D=v,x=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");E.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},k=()=>{l.items.filter(e=>e.lookup).forEach(e=>{A.push({name:e.name,lookup:e.lookup})}),l.items.filter(e=>e.properties?.lookup).forEach(e=>{A.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})})},O=async e=>{const t=E.filter(t=>t.refObj===e);if(t?.length){r(10,b={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:s}=e;if(!n)break;let a,l,c=!i&&C[n];const u=C[n];u&&i&&(c=(await up(n,u))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${d} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${d} .form-field.${t} .field input`,l=document.querySelector(a)),l&&c&&l.setAttribute(s,""),l&&!c&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${d} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!c),c&&r(10,b[t]="",b))}}};Z(()=>{M()});const M=async()=>{const e=e=>new Promise(t=>setTimeout(t,e));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of E)e.add(t.refObj||u);Array.from(e).forEach(e=>O(e))})(),P())},P=()=>{setTimeout(()=>{Array.from(S).forEach(([e,t])=>{C[e]||r(7,C[e]=t._id,C)})},250)},B=async e=>{if(!e.value)return void F();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(26,I=""),a("setRefValue",I))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(26,I=v),r(7,C={}),a("setRefValue",I)};return e.$$set=e=>{"required"in e&&r(27,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(28,g=e.readonly),"id"in e&&r(29,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(26,I=e.refValue),"currency"in e&&r(3,$=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{268435457&e.$$.dirty[0]&&r(0,p=p||g),1073742048&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:f,taskId:h})},[p,v,_,$,y,u,f,C,l,d,b,N,T,i,s,R,D,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(30,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,u=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(x),k(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===R)return B(e);O(t)},async({detail:e})=>{if(!(l.input?.length&&l.input.length>1))return;if(prevSchema?.class!==l.input[0])return;const{value:n,lookup:i,view:o}=e,[s]=i.split(":"),a=(await t.getSectionView(s,{[o]:{$in:n}})).map(e=>e._id);for(const e of l.input.slice(1)){r(7,C[e]=[],C);const n=await t.getSchemaByClass(e);n.id;let i=await t.getTasks(n.id);if(i=i.data.filter(e=>"Ready"===e._task?.status&&a.includes(e[s])),i?.length){const n=i.map(e=>e._id),o=await t.getSectionView(e,{_id:{$in:n}});for(const t of o)t[e]=t._id;r(7,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(S.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===u)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&S.set(e,o[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(26,I=v),a("setRefValue",I),r(7,C=n[0])),L()},L,F,({detail:e})=>{r(7,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(7,C[e.listName][t.name]=t.value,C)},I,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class to extends Re{constructor(e){var t;super(),Bi.getElementById("svelte-16mo2c-style")||((t=O("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",R(Bi.head,t)),Te(this,e,eo,Ji,b,{required:27,disabled:0,readonly:28,id:29,item:4,value:1,refValue:26,currency:3,notifyList:2},[-1,-1])}}function no(e){let t,n;return{c(){t=O("span"),n=P(e[4]),W(t,"class","item")},m(e,r){D(e,t,r),R(t,n)},p(e,t){16&t[0]&&H(n,e[4])},d(e){e&&x(t)}}}function ro(e){let t,n,r,i=e[6]&&no(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","pointer feather svelte-1fuww0c")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[17]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=B(),o&&o.c(),n=L()},m(e,s){i&&i.m(e,s),D(e,t,s),o&&o.m(e,s),D(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=no(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||(ye(o),r=!0)},o(e){ve(o),r=!1},d(e){i&&i.d(e),e&&x(t),o&&o.d(e),e&&x(n)}}}function io(e){let t,n,r;return n=new e[10]({props:{withItem:!0,itemLeft:!0,lang:e[11].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[9],step:e[12],pattern:e[7],placeholder:e[13],readonly:e[8],disabled:e[3],required:e[5],$$slots:{default:[ro]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=O("div"),be(n.$$.fragment),j(t,"position","relative"),j(t,"max-width","10em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};6&t[0]&&(r.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(r.id=e[0]),1&t[0]&&(r.name=e[0]),512&t[0]&&(r.value=e[9]),128&t[0]&&(r.pattern=e[7]),256&t[0]&&(r.readonly=e[8]),8&t[0]&&(r.disabled=e[3]),32&t[0]&&(r.required=e[5]),80&t[0]|64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function oo(e,t,r){const i=Q(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:f}=t,{formnovalidate:h}=t,{currency:m}=t,{praefix:p}=t,{notifyList:g}=t;const w=JSON.parse(n.getItem("Locale"));let y=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&(y=!1);const v=Number("1.1").toLocaleString(w.id).substring(1,2),{properties:I={}}=a;let{min:$,max:_,step:C,pattern:E,decimals:A=0,unit:b="",placeholder:S,hint:N,readonly:T,negative:R,required:D=!1,transfer:x}=I,k="";l=l?Number(l.toString().replace(",",".")):0,T=!0===T||void 0;const O=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toString()}(Number(e.toString()),A).replace(".",v);E||(E=A?`[0-9]+([${v}][0-9]{1,${A}})?`:"[0-9]*"),R&&(E="-?"+E);return e.$$set=e=>{"id"in e&&r(0,s=e.id),"item"in e&&r(19,a=e.item),"value"in e&&r(18,l=e.value),"noForm"in e&&r(1,d=e.noForm),"classId"in e&&r(2,u=e.classId),"disabled"in e&&r(3,f=e.disabled),"formnovalidate"in e&&r(20,h=e.formnovalidate),"currency"in e&&r(4,m=e.currency),"praefix"in e&&r(21,p=e.praefix),"notifyList"in e&&r(22,g=e.notifyList)},e.$$.update=()=>{1048608&e.$$.dirty[0]&&r(5,D=D&&!h),262144&e.$$.dirty[0]&&(e=>{r(9,k=O((e||"0").toString().replace(",",".")))})(l),4194304&e.$$.dirty[0]&&(async()=>{const e=a.properties?.value?.formula;if(e)void 0!==p&&""!==p?e?.operator?.multiply&&i("formula",{item:a}):e?.operator&&i("formula",{item:a})})()},[s,d,u,f,m,D,y,E,T,k,o,w,C,S,x,({detail:e})=>{void 0!==p&&""!==p||i("formula",{item:a,value:e.value}),i("blur",{value:O(e.value)})},({detail:e})=>{T||+l||r(9,k="")},({detail:e})=>{const t=[].concat(x.target);if(void 0===p||""===p)for(const e of t)i("record",{itemName:e,value:l});else for(const e of t)i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,h,p,g]}class so extends Re{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=O("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",R(document.head,t)),Te(this,e,oo,io,b,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:ao}=_e;function lo(e){e[34]=e[36].list,e[35]=e[36].items}function co(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function uo(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function fo(e,t,n){const r=e.slice();return r[40]=t[n],r}function ho(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function mo(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;lo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[po]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let I=!e[2]&&go(e);function $(t){e[32](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),te.push(()=>Ae(a,"value",$)),a.$on("input",e[15]),u=new rt({props:{size:"18"}});let C=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&yo(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=vo(fo(e,s,t));return{c(){t=O("thead"),n=O("tr"),o&&o.c(),r=B();for(let e=0;e<a.length;e+=1)a[e].c();W(n,"class","svelte-1m010ne"),W(t,"class","svelte-1m010ne")},m(e,s){D(e,t,s),R(t,n),o&&o.m(n,null),R(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);i=!0},p(e,t){if(e[2]?o&&(ge(),ve(o,1,1,()=>{o=null}),we()):o?(o.p(e,t),4&t[0]&&ye(o,1)):(o=yo(e),o.c(),ye(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=fo(e,s,r);a[r]?a[r].p(i,t):(a[r]=vo(i),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=s.length}},i(e){i||(ye(o),i=!0)},o(e){ve(o),i=!1},d(e){e&&x(t),o&&o.d(),k(a,e)}}}(e),E=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=Eo(co(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[34],s=0;s<r.length;s+=1){const o=co(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Eo(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),I&&I.c(),i=B(),o=O("div"),s=P("Suchen: "),be(a.$$.fragment),c=B(),d=O("span"),be(u.$$.fragment),f=B(),h=O("div"),m=O("table"),C&&C.c(),p=B(),g=O("tbody"),E&&E.c(),W(t,"class","form--buttons svelte-1m010ne"),W(d,"class","feather pointer svelte-1m010ne"),j(o,"margin-bottom","1em"),j(o,"position","relative"),W(m,"striped",""),W(m,"class","svelte-1m010ne"),W(h,"class","eList svelte-1m010ne")},m(l,$){D(l,t,$),Se(n,t,null),R(t,r),I&&I.m(t,null),D(l,i,$),D(l,o,$),R(o,s),Se(a,o,null),R(o,c),R(o,d),Se(u,d,null),D(l,f,$),D(l,h,$),R(h,m),C&&C.m(m,null),R(m,p),R(m,g),E&&E.m(g,null),w=!0,y||(v=F(d,"click",e[17]),y=!0)},p(e,r){lo(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?I&&(ge(),ve(I,1,1,()=>{I=null}),we()):I?(I.p(e,r),4&r[0]&&ye(I,1)):(I=go(e),I.c(),ye(I,1),I.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],ce(()=>l=!1)),a.$set(o),e[35]?.length&&C.p(e,r),e[34]?.length&&E.p(e,r)},i(e){w||(ye(n.$$.fragment,e),ye(I),ye(a.$$.fragment,e),ye(u.$$.fragment,e),ye(C),ye(E),w=!0)},o(e){ve(n.$$.fragment,e),ve(I),ve(a.$$.fragment,e),ve(u.$$.fragment,e),ve(C),ve(E),w=!1},d(e){e&&x(t),Ne(n),I&&I.d(),e&&x(i),e&&x(o),Ne(a),Ne(u),e&&x(f),e&&x(h),C&&C.d(),E&&E.d(),y=!1,v()}}}function po(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function go(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[wo]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function wo(e){let t;return{c(){t=P("Bestätigen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function yo(e){let t,n,r,i,o;return n=new Xe({props:{size:"20"}}),{c(){t=O("th"),be(n.$$.fragment),W(t,"class","svelte-1m010ne")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function vo(e){let t,n,r=e[40]+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-1m010ne")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Io(e){let t,n,r,i,o,s,a,l=e[0],c=_o(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Co(uo(e,d,t));return{c(){t=O("tr"),c.c(),n=B();for(let e=0;e<u.length;e+=1)u[e].c();r=B(),W(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),W(t,"title","übernimmt den Wert direkt"),W(t,"class","svelte-1m010ne"),q(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){D(i,t,l),c.m(t,null),R(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,r),o=!0,s||(a=F(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&b(l,l=e[0])?(ge(),ve(c,1,1,$),we(),c=_o(e),c.c(),ye(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[35],n=0;n<d.length;n+=1){const i=uo(e,d,n);u[n]?u[n].p(i,a):(u[n]=Co(i),u[n].c(),u[n].m(t,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!o||4&a[0]&&i!==(i=e[2]?"cursor: default;":"cursor: zoom-in;"))&&W(t,"style",i),16385&a[0]&&q(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||(ye(c),o=!0)},o(e){ve(c),o=!1},d(e){e&&x(t),c.d(e),k(u,e),s=!1,a()}}}function $o(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[39],checked:e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]),round:!0}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"title","Wählt den Wert aus"),W(t,"class","svelte-1m010ne")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[37])?e[37][0]:e[37])),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function _o(e){let t,n,r=!e[2]&&$o(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[2]?r&&(ge(),ve(r,1,1,()=>{r=null}),we()):r?(r.p(e,n),4&n[0]&&ye(r,1)):(r=$o(e),r.c(),ye(r,1),r.m(t.parentNode,t))},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Co(e){let t,n,r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"";return{c(){t=O("td"),n=P(r),W(t,"class","svelte-1m010ne")},m(e,r){D(e,t,r),R(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"")&&H(n,r)},d(e){e&&x(t)}}}function Eo(e){let t,n,r=e[16](e[37],e[3]),i=r&&Io(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[37],e[3])),r?i?(i.p(e,n),8&n[0]&&ye(i,1)):(i=Io(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function Ao(e){let t,n;return t=new e[6]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function bo(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Ao,then:mo,catch:ho,value:36,blocks:[,,,]};return Ie(e[14](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function So(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[bo]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function No(e,n,r){const i=Q(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:f}=n,{id:h}=n,{designation:m}=n,{selection:p}=n,{refDoc:g}=n,{tableName:w}=n,{idName:y}=n,{target:v}=n,{view:I}=n,{unique:$}=n,{uniqueView:_}=n,{status:C}=n,{single:E}=n;p||=[];let A="",b=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const N=w+y+v+"checkbox",T=(e,t)=>e>t?1:t>e?-1:0;Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(b)?.focus()},200)});return e.$$set=e=>{"classId"in e&&r(22,f=e.classId),"id"in e&&r(23,h=e.id),"designation"in e&&r(1,m=e.designation),"selection"in e&&r(0,p=e.selection),"refDoc"in e&&r(24,g=e.refDoc),"tableName"in e&&r(25,w=e.tableName),"idName"in e&&r(26,y=e.idName),"target"in e&&r(21,v=e.target),"view"in e&&r(27,I=e.view),"unique"in e&&r(28,$=e.unique),"uniqueView"in e&&r(29,_=e.uniqueView),"status"in e&&r(30,C=e.status),"single"in e&&r(2,E=e.single)},[p,m,E,A,S,i,o,s,a,l,d,u,b,N,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if(I){if(h){const n=f.split("-")[1].slice(0,-4),r="input."+f+"[name='_id']",o=document.querySelector(r).value;i={[y]:h},C&&(i.$or=[{status:!0},{[n]:o}]),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const r=e=>(e[n]||"z").toString()+e[v];return T(r(e),r(t))})}}else _?h&&(i={[y]:h,status:!0},Object.entries(_).map(([e,t])=>{t?.length&&(i[e]={$in:t}),n.push(e)}),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}),r(4,S=e.map(e=>{const t=[e[v]];return n.map(n=>t.push(e[n])),t}))):$?(e=await t.getSection(w,y,h,$),e=e.sort((e,t)=>T(e,t))):(e=await t.getSection(w,y,h,!1,C),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}));else i={},h&&!Array.isArray(h)&&(i._id=h),e=await t.getSectionView(w,i);const o=await t.getSchemaByClass(w),s=[];if(g){const t=o.items[0].name,n=o.items[1].name,i=o.list[0].name,s=e.find(e=>e[t]===g);e=s?s[i]:[],r(21,v=n)}let a;return e.map(e=>{let t=e[v];if(t||w!==v||(r(21,v=o.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter(e=>!!e&&24!==e?.length).join(", ")),s.push(t||[])}else g&&(t=o.list[0].item.map(t=>e[t.name]||"")),s.push(t||[])}),a=g?o.list[0].item.map(e=>e.designation):[o.items.find(e=>e.name===v)?.designation],n=n.map(e=>o.items.find(t=>t.name===e)?.designation),{list:g?s:s.flat(),items:[...a,...n]}},({detail:{value:e}})=>{r(3,A=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,A="")},e=>()=>{const t=document.getElementsByName(N),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(N).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;E?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,f,h,g,w,y,I,$,_,C,()=>i("back"),function(e){A=e,r(3,A)}]}class To extends Re{constructor(e){var t;super(),ao.getElementById("svelte-1m010ne-style")||((t=O("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",R(ao.head,t)),Te(this,e,No,So,b,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:Ro}=_e;function Do(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=O("span"),n=P("("),r=P(s),i=P(")"),W(t,"class",o=N(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=N(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&W(t,"class",o)},d(e){e&&x(t)}}}function xo(e){let t;return{c(){t=O("div"),W(t,"class","load-more-options"),W(t,"slot","load-more-options-message")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function ko(e){let t,n,r,i;const o=[Po,Mo,Oo],s=[];function a(e,t){return!e[16].single&&e[7]?.length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=L()},m(e,n){~t&&s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ge(),ve(s[l],1,1,()=>{s[l]=null}),we()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){~t&&s[t].d(e),e&&x(r)}}}function Oo(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[26]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Mo(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title",e[17].title||"Generieren"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[25]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Po(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Löschen"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[27]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Bo(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Lo]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};53&r[0]|32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function Lo(e){let t,n;return t=new To({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],designation:e[4].designation,target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),1&n[0]&&(r.selection=e[0]),16&n[0]&&(r.unique=e[16].unique&&e[4].name),32&n[0]&&(r.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(r.id=e[5][e[21]||e[20]]),16&n[0]&&(r.designation=e[4].designation),16&n[0]&&(r.target=e[4].name),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Fo(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&Do(e);function u(t){e[35](t)}function f(t){e[36](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Vo,minSearchLength:"3",$$slots:{"load-more-options-message":[xo]},$$scope:{ctx:e}};void 0!==e[7]&&(h.selection=e[7]),void 0!==e[9]&&(h.maxOptions=e[9]),r=new e[12]({props:h}),te.push(()=>Ae(r,"selection",u)),te.push(()=>Ae(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&ko(e),p=e[10]&&Bo(e);return{c(){t=O("div"),d&&d.c(),n=B(),be(r.$$.fragment),s=B(),m&&m.c(),a=B(),p&&p.c(),l=L(),j(t,"position","relative")},m(e,i){D(e,t,i),d&&d.m(t,null),R(t,n),Se(r,t,null),R(t,s),m&&m.m(t,null),D(e,a,i),p&&p.m(e,i),D(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=Do(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const a={};8&s[0]&&(a.id=e[3]),8&s[0]&&(a.name=e[3]),8&s[0]&&(a.class=e[3]),2&s[0]&&(a.disabled=e[1]),64&s[0]&&(a.required=e[6]),256&s[0]&&(a.placeholder=e[8]),32768&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],ce(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],ce(()=>o=!1)),r.$set(a),e[1]?m&&(ge(),ve(m,1,1,()=>{m=null}),we()):m?(m.p(e,s),2&s[0]&&ye(m,1)):(m=ko(e),m.c(),ye(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&ye(p,1)):(p=Bo(e),p.c(),ye(p,1),p.m(l.parentNode,l)):p&&(ge(),ve(p,1,1,()=>{p=null}),we())},i(e){c||(ye(r.$$.fragment,e),ye(m),ye(p),c=!0)},o(e){ve(r.$$.fragment,e),ve(m),ve(p),c=!1},d(e){e&&x(t),d&&d.d(),Ne(r),m&&m.d(),e&&x(a),p&&p.d(e),e&&x(l)}}}async function*Vo(e){yield[{name:e}]}function Uo(e,n,r){const i=Q(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:f}=n,{noForm:h=!1}=n,{disabled:m}=n,{formnovalidate:p}=n,{numberInput:g}=n,{praefix:w}=n,{toDelete:y}=n,{reqQuantity:v}=n,{notifyList:I}=n;const{properties:$={}}=d;let{placeholder:_,hint:C,readonly:E,required:A=!1,lookup:b="",view:S=!1,multi:N,max:T=1e3,generate:R=!1,status:D=!0,refDoc:x}=$;const[k,O]=b.split(":");let M=!1,P=f.map&&f.map(e=>({name:e}))||[];m||=E,m&&(_="");const B=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,P=t.map(e=>({name:e.trim()})));const n=P.map(e=>e.name);i("blur",{value:n}),i("multi",{view:N.view,lookup:b,name:d.name,value:n})};Z(async()=>{i("multi",{view:N.view,lookup:b,name:d.name,value:f});const e=document.getElementById(l);e.classList.add(a),!E&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||T;(N.unique||P.length<e)&&r(10,M=!0)}},F=()=>{r(10,M&&=!1)},V=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,P=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:N.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[O]:u[O]},n=await t.getSectionView(k,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},W=(e=!1)=>{if(m||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;r(9,T=!1!==e?e:v||u[t]||0);const n=P?.length!=T,o=document.getElementById(l);o?.classList?.toggle("invalid",n),i("invalid",{idx:w,value:n})};return e.$$set=e=>{"classId"in e&&r(2,a=e.classId),"id"in e&&r(3,l=e.id),"item"in e&&r(4,d=e.item),"record"in e&&r(5,u=e.record),"value"in e&&r(0,f=e.value),"noForm"in e&&r(28,h=e.noForm),"disabled"in e&&r(1,m=e.disabled),"formnovalidate"in e&&r(29,p=e.formnovalidate),"numberInput"in e&&r(30,g=e.numberInput),"praefix"in e&&r(31,w=e.praefix),"toDelete"in e&&r(32,y=e.toDelete),"reqQuantity"in e&&r(33,v=e.reqQuantity),"notifyList"in e&&r(34,I=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&r(7,P=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&r(7,P=u[d.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===d.name&&r(7,P=[]),128&e.$$.dirty[0]&&P&&(r(0,f=P.map&&P.map(e=>e.name)||[]),W()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===N.maxItem&&W(n)})(g),536870976&e.$$.dirty[0]&&r(6,A=A&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(d.refItem&&d.refItem?.split(".")[0]===n){let[e,n]=d.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}if(d.refItem2&&d.refItem2?.split(".")[0]===n){let[e,n]=d.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}setTimeout(W,250)}})(I)},[f,m,a,l,d,u,A,P,_,T,M,o,s,E,b,S,N,R,D,x,k,O,B,F,V,()=>{const e=u[R.itemQuantity]||v;if(!e)return;const t=R.prefix||"",n=u[R.variable]||"",r=R.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));V({detail:{name:d.name,list:i}})},async()=>{if(!0===S)return U();const e=v||u[N.maxItem];if(!e)return;let n={};O&&(n={[O]:u[O]}),D&&(n.status=!0);const r=[].concat(u[N.view]||[]);r.length&&(n[N.view]={$in:r});const i=await t.getSectionView(k,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][d.name]);V({detail:{name:d.name,list:o}})},()=>{V({detail:{name:d.name,list:[]}})},h,p,g,w,y,v,I,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){T=e,r(9,T)},function(e){M=e,r(10,M)}]}class Wo extends Re{constructor(e){var t;super(),Ro.getElementById("svelte-1rbaejz-style")||((t=O("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",R(Ro.head,t)),Te(this,e,Uo,Fo,b,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}function Ho(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function zo(e){let t,n,r,i;return r=new $t({props:{size:"18"}}),{c(){t=O("span"),n=O("a"),be(r.$$.fragment),W(n,"href",Go),W(n,"target","_blank"),W(n,"rel","noopener"),W(t,"class","feather pointer svelte-9up2nn")},m(e,o){D(e,t,o),R(t,n),Se(r,n,null),i=!0},p:$,i(e){i||(ye(r.$$.fragment,e),i=!0)},o(e){ve(r.$$.fragment,e),i=!1},d(e){e&&x(t),Ne(r)}}}function jo(e){let t,n,r,i,o,s;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[11]);const a=[zo,Ho],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}const qo=e("getMapLink",async e=>{const{street:n,houseNo:r,postcode:i,location:o,country:s}=e,a=[n&&r?n+" "+r:n,i&&o?i+" "+o:i||o||"",s&&(await t.getTask("country",s)).designation].filter(e=>!!e).join(", ");return`https://www.google.ch/maps/search/?api=1&query=${encodeURIComponent(a)}`}),Go="https://www.google.ch/maps/search/?api=1&query=Haldenstrasse%201%2C%206340%20Baar%2C%20Schweiz";function Xo(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{record:h}=t,{item:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"record"in e&&n(9,h=e.record),"item"in e&&n(10,m=e.item)},[i,o,s,a,l,d,u,f,r,h,m,function(t){J(e,t)}]}class Yo extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Xo,jo,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:9,item:10})}}const{document:Zo}=_e;function Ko(e){let t;return{c(){t=O("div"),W(t,"class","load-more-options"),W(t,"slot","load-more-options-message")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Qo(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-wpjws5")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Jo(e){let t,n,r,i,o;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-wpjws5")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[8]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function es(e){let t,n,r,i,o,s,a;function l(t){e[17](t)}function c(t){e[18](t)}function d(t){e[19](t)}let u={id:e[1],name:e[1],class:e[1],minSearchLength:"1",maxOptions:"1",getOptions:e[7],$$slots:{"load-more-options-message":[Ko]},$$scope:{ctx:e}};void 0!==e[0]&&(u.value=e[0]),void 0!==e[2]&&(u.selection=e[2]),void 0!==e[3]&&(u.searchQuery=e[3]),n=new e[4]({props:u}),te.push(()=>Ae(n,"value",l)),te.push(()=>Ae(n,"selection",c)),te.push(()=>Ae(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[Jo,Qo],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),s=B(),f&&f.c(),j(t,"position","relative"),W(t,"class","inputAutoComplete")},m(e,r){D(e,t,r),Se(n,t,null),R(t,s),f&&f.m(t,null),a=!0},p(e,t){const s={};2&t[0]&&(s.id=e[1]),2&t[0]&&(s.name=e[1]),2&t[0]&&(s.class=e[1]),32&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],ce(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],ce(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],ce(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||(ye(n.$$.fragment,e),ye(f),a=!0)},o(e){ve(n.$$.fragment,e),ve(f),a=!1},d(e){e&&x(t),Ne(n),f&&f.d()}}}function ts(e,t,n){const{Autocomplete:r}=c,i=Q();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:f}=t,{noForm:h=!1}=t,{disabled:m}=t,{formnovalidate:p}=t,{autocomplete:{input:g,min:w,url:y,output:v},format:I}=a.properties;y="https://openplzapi.org/";const $=[].concat(g),{name:_}=v,C="map"===I;let E,A=f,b=!1;Z(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",T),e.addEventListener("keyup",N),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},N=e=>{8===e.keyCode&&""===A&&n(0,f="")},T=async()=>{if(w){const e=$[0].name;if((d?u[d][e]:u[e]).length<w)return}const e=await R();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),x(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},R=async(e="")=>{const t=await(async()=>{const e=d?u[d].country:u.country;if(e){const t=await up("country",e);if(t?.countryCode)return t.countryCode?.toLowerCase()}return"ch"})();let n="Streets";"postalCode"===$[0].refItem&&(n="Localities");const r=await fetch(y+t+"/"+n+"?"+D()+"&name=%5E"+e.trim());if(!r.ok)return;const i=r.headers.get("Content-Type").split(";")[0];let o=[];try{if("text/json"===i){const e=await r.text();o=JSON.parse(e||[])}else"application/json"===i&&(o=await r.json())}catch{}return o=o.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),o.map(e=>({name:e[_]}))},D=()=>$.map(({name:e,refItem:t})=>`${t}=${(d?u[d][e]:u[e]).split(" ")[0]}`).join("&"),x=e=>{i("blur",{value:e})};return e.$$set=e=>{"classId"in e&&n(9,o=e.classId),"id"in e&&n(1,s=e.id),"item"in e&&n(10,a=e.item),"name"in e&&n(11,l=e.name),"listName"in e&&n(12,d=e.listName),"record"in e&&n(13,u=e.record),"value"in e&&n(0,f=e.value),"noForm"in e&&n(14,h=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[f,s,E,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,E=[]),x(f)},async function*(e){if(b||f&&e.startsWith(f))return n(0,f=e),void x(f);const t=await R(e);if(!t?.length)return n(0,f=e),void x(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,E=[]),x(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await qo(e);window.open(t,"_blank")},o,a,l,d,u,h,m,p,function(e){f=e,n(0,f)},function(e){E=e,n(2,E)},function(e){A=e,n(3,A)}]}class ns extends Re{constructor(e){var t;super(),Zo.getElementById("svelte-wpjws5-style")||((t=O("style")).id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",R(Zo.head,t)),Te(this,e,ts,es,b,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:rs}=_e;function is(e){e[26]=e[28].list,e[27]=e[28].items}function os(e,t,n){const r=e.slice();return r[29]=t[n],r}function ss(e,t,n){const r=e.slice();return r[32]=t[n],r}function as(e,t,n){const r=e.slice();return r[32]=t[n],r}function ls(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function cs(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[23](t)}is(e),n=new e[7]({props:{outline:!0,$$slots:{default:[ds]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[27]?.length&&function(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=us(as(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[27],o=0;o<r.length;o+=1){const s=as(e,r,o);i[o]?i[o].p(s,t):(i[o]=us(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}(e),_=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=ms(os(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);D(e,t,n)},p(e,i){if(11779&i[0]){let o;for(n=e[26],o=0;o<n.length;o+=1){const s=os(e,n,o);r[o]?r[o].p(s,i):(r[o]=ms(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){k(r,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){is(e);const r={};64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ce(()=>a=!1)),s.$set(i),e[27]?.length&&$.p(e,t),e[26]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function ds(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function us(e){let t,n,r=e[32]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function fs(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=hs(ss(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=B(),W(t,"class","pointer svelte-14hcfjl"),q(t,"active",e[29]._id===e[0])},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=ss(e,r,s);i[s]?i[s].p(a,o):(i[s]=hs(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}2049&o[0]&&q(t,"active",e[29]._id===e[0])},d(e){e&&x(t),k(i,e)}}}function hs(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function ms(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&fs(e);return{c(){r&&r.c(),t=L()},m(e,n){r&&r.m(e,n),D(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[29],e[27],e[1])),n?r?r.p(e,i):(r=fs(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&x(t)}}}function ps(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function gs(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ps,then:cs,catch:ls,value:28,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function ws(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[gs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ys(e,n,i){const o=Q(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{className:h}=n,{classId:p}=n,{rowId:g}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:$}=n,_="",C=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const E=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(C)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await A;e.eventId===t.id&&fp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,f=e.item),"className"in e&&i(16,h=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,g=e.rowId),"viewName"in e&&i(18,y=e.viewName),"viewValue"in e&&i(19,v=e.viewValue),"recordId"in e&&i(20,I=e.recordId),"filter"in e&&i(21,$=e.filter)},[g,_,o,s,a,l,d,u,C,E,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+p+"#"+y;document.querySelector(n);let r={[y]:v},i=[];r[y]&&(i=await t.getSectionView(e.class,r,!0)),$&&(i=i.filter(e=>e._id!=$));const o=e.display;return{list:i,items:await Jt(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(E(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,p,y,v,I,$,()=>o("back"),function(e){_=e,i(1,_)}]}class vs extends Re{constructor(e){var t;super(),rs.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(rs.head,t)),Te(this,e,ys,ws,b,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Is(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function $s(e){let t,n,r,i,o;function s(t){e[21](t)}let a={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(a.value=e[0]),n=new e[10]({props:a}),te.push(()=>Ae(n,"value",s));let l=!e[6]&&_s(e);return{c(){t=O("div"),be(n.$$.fragment),i=B(),l&&l.c(),j(t,"position","relative")},m(e,r){D(e,t,r),Se(n,t,null),R(t,i),l&&l.m(t,null),o=!0},p(e,i){const o={};4&i&&(o.id=e[2]),8&i&&(o.name=e[3].name),34&i&&(o.inputClass=e[5]||e[1]),64&i&&(o.disabled=e[6]),128&i&&(o.formnovalidate=e[7]),!r&&1&i&&(r=!0,o.value=e[0],ce(()=>r=!1)),n.$set(o),e[6]?l&&(ge(),ve(l,1,1,()=>{l=null}),we()):l?(l.p(e,i),64&i&&ye(l,1)):(l=_s(e),l.c(),ye(l,1),l.m(t,null))},i(e){o||(ye(n.$$.fragment,e),ye(l),o=!0)},o(e){ve(n.$$.fragment,e),ve(l),o=!1},d(e){e&&x(t),Ne(n),l&&l.d()}}}function _s(e){let t,n,r,i,o;return n=new kt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-wbrqzu")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[17]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Cs(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Es(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[As]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};268435994&r&&(i.$$scope={dirty:r,ctx:e}),!n&&256&r&&(n=!0,i.open=e[8],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function As(e){let t,n;return t=new vs({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.item=e[3]),8&n&&(r.className=e[3].refClass),2&n&&(r.classId=e[1]),16&n&&(r.recordId=e[4]._id),512&n&&(r.viewValue=e[9]),16&n&&(r.filter=e[4]._id),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function bs(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Cs,then:$s,catch:Is,value:27,blocks:[,,,]};Ie(e[16](),i);let o=e[8]&&Es(e);return{c(){i.block.c(),t=B(),o&&o.c(),n=L()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,D(e,t,s),o&&o.m(e,s),D(e,n,s),r=!0},p(t,[r]){$e(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&ye(o,1)):(o=Es(e),o.c(),ye(o,1),o.m(n.parentNode,n)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){r||(ye(i.block),ye(o),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}ve(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&x(t),o&&o.d(e),e&&x(n)}}}function Ss(e,t,n){const{TextField:r,Modal:i}=c;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:f}=t,{formnovalidate:h}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:I=!1,view:$}=p,_=!1;const C=()=>{n(8,_=!1)};return e.$$set=e=>{"classId"in e&&n(1,o=e.classId),"id"in e&&n(2,s=e.id),"item"in e&&n(3,a=e.item),"record"in e&&n(4,l=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,f=e.disabled),"formnovalidate"in e&&n(7,h=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,f,h,_,g,r,i,w,v,I,$,async()=>(n(9,g=l[$.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,d=e.row[$.value?$.value:"_id"]),C()},C,m,function(e){d=e,n(0,d)},function(e){_=e,n(8,_)}]}class Ns extends Re{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=O("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",R(document.head,t)),Te(this,e,Ss,bs,b,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Ts(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Rs(e){let t;return{c(){t=O("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ds(e){let t;return{c(){t=O("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function xs(e){let t,n,r,i,o=e[12]+"";return{c(){t=O("option"),n=P(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){D(e,t,r),R(t,n)},p(e,s){64&s&&o!==(o=e[12]+"")&&H(n,o),64&s&&r!==(r=e[13])&&(t.__value=r,t.value=t.__value),65&s&&i!==(i=e[0]==e[13])&&(t.selected=i)},d(e){e&&x(t)}}}function ks(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Ds:Rs}let r=n(e),i=r(e);return{c(){i.c(),t=L()},m(e,n){i.m(e,n),D(e,t,n)},p(e,o){r!==(r=n(e))&&(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&x(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=xs(Ts(e,a,t));return{c(){t=O("select"),s&&s.c(),n=L();for(let e=0;e<l.length;e+=1)l[e].c();W(t,"class",r=N(e[3]||e[4])+" svelte-5xpzvo"),W(t,"id",e[2]),W(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){D(r,t,a),s&&s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=F(t,"change",e[9]),i=!0)},p(e,[n]){if(e[7]||s.p(e,n),65&n){let r;for(a=e[6],r=0;r<a.length;r+=1){const i=Ts(e,a,r);l[r]?l[r].p(i,n):(l[r]=xs(i),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=a.length}24&n&&r!==(r=N(e[3]||e[4])+" svelte-5xpzvo")&&W(t,"class",r),4&n&&W(t,"id",e[2]),4&n&&W(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:$,o:$,d(e){e&&x(t),s&&s.d(),k(l,e),i=!1,o()}}}function Os(e,t,n){const r=Q();let{id:i}=t,{item:o}=t,{value:s}=t,{noForm:a=!1}=t,{classId:l}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:f,readonly:h}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===f&&(s||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===f&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===f&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(10,o=e.item),"value"in e&&n(0,s=e.value),"noForm"in e&&n(3,a=e.noForm),"classId"in e&&n(4,l=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[s,c,i,a,l,d,u,f,h,e=>r("blur",{value:e.srcElement.value}),o]}class Ms extends Re{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=O("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",R(document.head,t)),Te(this,e,Os,ks,b,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Ps(e){let t,n,r,i,o,s,a,l,c;i=new e[8]({props:{id:"dp-"+e[1]+(e[2]?"-"+e[2]:""),value:e[0],readonly:e[5],required:e[7],disabled:e[6],noCalendar:e[9],closeOnSelection:!0}}),i.$on("change",e[11]);let d=e[10]&&function(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","pointer feather")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}(e);return{c(){t=O("input"),r=B(),be(i.$$.fragment),o=B(),d&&d.c(),s=L(),W(t,"type","string"),W(t,"class",n=e[3]||e[4]),W(t,"id",e[1]),W(t,"name",e[1]),t.hidden=!0},m(n,u){D(n,t,u),z(t,e[0]),D(n,r,u),Se(i,n,u),D(n,o,u),d&&d.m(n,u),D(n,s,u),a=!0,l||(c=F(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&W(t,"class",n),(!a||2&r)&&W(t,"id",e[1]),(!a||2&r)&&W(t,"name",e[1]),1&r&&z(t,e[0]);const o={};6&r&&(o.id="dp-"+e[1]+(e[2]?"-"+e[2]:"")),1&r&&(o.value=e[0]),32&r&&(o.readonly=e[5]),128&r&&(o.required=e[7]),64&r&&(o.disabled=e[6]),i.$set(o),e[10]&&d.p(e,r)},i(e){a||(ye(i.$$.fragment,e),ye(d),a=!0)},o(e){ve(i.$$.fragment,e),ve(d),a=!1},d(e){e&&x(t),e&&x(r),Ne(i,e),e&&x(o),d&&d.d(e),e&&x(s),l=!1,c()}}}let Bs=new Map;function Ls(e,n,r){const i=Q(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:f=!1}=n,{classId:h}=n,{eventId:m}=n,{readonly:p}=n,{disabled:g}=n,{required:w}=n,{notifyList:y}=n,{dateInput:v}=n;s||(s=void 0);let I=null;const $=(void 0===u?"":u.toString())+"-"+m+"-"+l.name,_=l.properties?.noCalendar||!1,C=l.properties?.transfer,E=({detail:e})=>{try{r(0,s=Gr(e.value,s)),void 0!==u&&""!==u&&Bs.set($,new Date(s.valueOf())),A(s)}catch{r(0,s=void 0)}},A=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==u&&!s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=Gr(t,s)}return e.$$set=e=>{"value"in e&&r(0,s=e.value),"id"in e&&r(1,a=e.id),"item"in e&&r(13,l=e.item),"record"in e&&r(14,d=e.record),"praefix"in e&&r(2,u=e.praefix),"noForm"in e&&r(3,f=e.noForm),"classId"in e&&r(4,h=e.classId),"eventId"in e&&r(15,m=e.eventId),"readonly"in e&&r(5,p=e.readonly),"disabled"in e&&r(6,g=e.disabled),"required"in e&&r(7,w=e.required),"notifyList"in e&&r(16,y=e.notifyList),"dateInput"in e&&r(17,v=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!C&&Bs.has($)&&r(0,s=Bs.get($)),65536&e.$$.dirty&&(async e=>{if(null===I){const e=(await t.getEvent(m)).output.class[0].item;I=e.find(e=>e.properties?.value?.formula)}I&&I.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!I.properties.value.formula.argument[1].value&&e.itemName!==I.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:I}))})(y),131072&e.$$.dirty&&((e={})=>{let{ref:t,val:n,t:r,l:i,n:o}=e;if(o&&(n=o),!n||isNaN(new Date(n)))return;if(r)return;if(!t)return;const[s,a]=t.split(".");s===i&&a===l.name&&null!=u&&E({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=Gr(d[l.name],s))}catch{}},[s,a,u,f,h,p,g,w,o,_,C,E,()=>{i("record",{target:C.target,value:s.toISOString()})},l,d,m,y,v,function(){s=this.value,r(0,s),r(14,d),r(13,l),r(6,g),r(5,p)}]}class Fs extends Re{constructor(e){super(),Te(this,e,Ls,Ps,b,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function Vs(e){let t;return{c(){t=P("Stunden")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Us(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Vs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Ws(e){let t;return{c(){t=P("Minuten")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Hs(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[Ws]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function zs(e){let t;return{c(){t=P("Jetzt")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function js(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[zs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function qs(e){let t,n,r,i,o,s,a,l,c;return i=new e[5]({props:{value:e[0],closeOnSelection:!0}}),i.$on("change",e[8]),s=new e[6]({props:{value:e[0],$$slots:{"now-label":[js],"minutes-label":[Hs],"hours-label":[Us]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=O("input"),r=B(),be(i.$$.fragment),o=B(),be(s.$$.fragment),W(t,"type","string"),W(t,"class",n=e[2]||e[3]),W(t,"id",e[1]),W(t,"name",e[1]),t.hidden=!0},m(n,d){D(n,t,d),z(t,e[0]),D(n,r,d),Se(i,n,d),D(n,o,d),Se(s,n,d),a=!0,l||(c=F(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&W(t,"class",n),(!a||2&r)&&W(t,"id",e[1]),(!a||2&r)&&W(t,"name",e[1]),1&r&&z(t,e[0]);const o={};1&r&&(o.value=e[0]),i.$set(o);const l={};1&r&&(l.value=e[0]),4096&r&&(l.$$scope={dirty:r,ctx:e}),s.$set(l)},i(e){a||(ye(i.$$.fragment,e),ye(s.$$.fragment,e),a=!0)},o(e){ve(i.$$.fragment,e),ve(s.$$.fragment,e),a=!1},d(e){e&&x(t),e&&x(r),Ne(i,e),e&&x(o),Ne(s,e),l=!1,c()}}}function Gs(e,t,n){const r=Q(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const f=e=>r("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,a=e.value),"id"in e&&n(1,l=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[a,l,d,u,i,o,s,({detail:e})=>{var t,r;n(0,(t=e.value,r=a,a=null==t||null==r?t:(r.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r))),f(a)},({detail:e})=>{n(0,a=Gr(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class Xs extends Re{constructor(e){super(),Te(this,e,Gs,qs,b,{value:0,id:1,noForm:2,classId:3})}}function Ys(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g;return u=new e[9]({props:{format:e[7],required:e[3],disabled:e[4],value:e[5],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),h=new e[9]({props:{format:e[8],required:e[3],disabled:e[4],value:e[6],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),h.$on("change",e[12]),{c(){t=O("input"),o=B(),s=O("input"),d=B(),be(u.$$.fragment),f=P(" /\n"),be(h.$$.fragment),W(t,"type","string"),W(t,"class",n=e[1]||e[2]),W(t,"id",r=e[0]+"_from"),W(t,"name",i=e[0]+"_from"),t.hidden=!0,W(s,"type","string"),W(s,"class",a=e[1]||e[2]),W(s,"id",l=e[0]+"_to"),W(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){D(n,t,r),z(t,e[5]),D(n,o,r),D(n,s,r),z(s,e[6]),D(n,d,r),Se(u,n,r),D(n,f,r),Se(h,n,r),m=!0,p||(g=[F(t,"input",e[15]),F(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&W(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&W(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&W(t,"name",i),32&o&&z(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&W(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&W(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&W(s,"name",c),64&o&&z(s,e[6]);const d={};128&o&&(d.format=e[7]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),32&o&&(d.value=e[5]),u.$set(d);const f={};256&o&&(f.format=e[8]),8&o&&(f.required=e[3]),16&o&&(f.disabled=e[4]),64&o&&(f.value=e[6]),h.$set(f)},i(e){m||(ye(u.$$.fragment,e),ye(h.$$.fragment,e),m=!0)},o(e){ve(u.$$.fragment,e),ve(h.$$.fragment,e),m=!1},d(e){e&&x(t),e&&x(o),e&&x(s),e&&x(d),Ne(u,e),e&&x(f),Ne(h,e),p=!1,E(g)}}}function Zs(e,t,n){const r=Q(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:f}=t;const{noCalendar:h,preset:m}=a.properties||{};let p,g,w="%d.%m.%Y",y="%d.%m.%Y";return e.$$set=e=>{"value"in e&&n(13,o=e.value),"id"in e&&n(0,s=e.id),"item"in e&&n(14,a=e.item),"noForm"in e&&n(1,l=e.noForm),"classId"in e&&n(2,d=e.classId),"required"in e&&n(3,u=e.required),"disabled"in e&&n(4,f=e.disabled)},e.$$.update=()=>{if(8304&e.$$.dirty&&o){if((o?.from||o?.to)&&(n(5,p=o?.from),n(6,g=o?.to)),m){const{first:e,last:t}=function(e){const t=new Date;let n=t.getFullYear();const r=t.getMonth();let i,o;switch(t.getDate(),e){case"currentMonth":i=o=r;break;case"currentYear":i=0,o=i+11;break;case"lastSemiYear":i=r<6?6:0,o=i+5,i>5&&--n;break;case"lastQuarter":i=r<3?9:r<6?0:r<9?3:6,o=i+2,i>8&&--n;break;case"lastMonth":i=o=0===r?11:r-1,11===i&&--n;break;default:i=0,o=i+11,--n}return{first:new Date(n,i,1),last:new Date(n,o+1,0)}}(m);e&&!p&&n(5,p=e),t&&!g&&n(6,g=t)}"Invalid Date"===p?.toString()&&n(5,p=void 0),"Invalid Date"===g?.toString()&&n(6,g=void 0),f&&(void 0===p&&n(7,w=""),void 0===g&&n(8,y=""))}},[s,l,d,u,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=Gr(e.value,p)),g&&p&&g.valueOf()-p.valueOf()<0&&n(5,p=void 0),n(13,o.from=p,o),r("change",{value:p,range:"_from"})},({detail:e})=>{n(6,g=Gr(e.value,g)),g&&p&&g.valueOf()-p.valueOf()<0&&n(6,g=void 0),n(13,o.to=g,o),r("change",{value:g,range:"_to"})},o,a,function(){p=this.value,n(5,p),n(13,o),n(6,g),n(4,f)},function(){g=this.value,n(6,g),n(13,o),n(5,p),n(4,f)}]}class Ks extends Re{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=O("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",R(document.head,t)),Te(this,e,Zs,Ys,b,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var Qs={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function ea(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ta(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ta(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var na={normalizePrecision:function(e){var t=e.reduce(function(e,t){return Math.max(e.getPrecision(),t.getPrecision())});return e.map(function(e){return e.getPrecision()!==t?e.convertPrecision(t):e})},minimum:function(e){var t=ea(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.lessThan(e)?i:e}),i},maximum:function(e){var t=ea(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function ra(e){return!isNaN(parseInt(e))&&isFinite(e)}function ia(e){return e%2==0}function oa(e){return ra(e)&&!Number.isInteger(e)}function sa(e){return Math.abs(e)%1==.5}function aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n])}(i,t.headers),i.send()})}function la(e){return void 0===e}function ca(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===Js(e[1])){var r=ca(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function da(){var e=function(e,t){var n=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)},t={HALF_ODD:function(e){var t=Math.round(e);return sa(e)&&ia(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return sa(e)?ia(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return sa(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return sa(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return sa(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(t,n){return oa(t)||oa(n)?e(t,n):t*n},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(e){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](e)}}}var ua=da();function fa(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,r){return(i=e.endpoint,!Boolean(i)||"object"!==Js(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return aa(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return ca(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function ha(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function ma(e){ha(function(e){return ra(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function pa(e){ha(Number.isInteger(e),"You must provide an integer.",TypeError)}var ga=da(),wa=Object.assign(function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;pa(r),pa(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},f=function(e){ha(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(e){return u.call(this,{locale:e})},getPrecision:function(){return o},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;pa(e);var n=this.getPrecision(),r=e>n,i=r?ga.multiply:ga.divide,o=r?[e,n]:[n,e],s=Math.pow(10,ga.subtract.apply(ga,o));return u.call(this,{amount:ga.round(i(this.getAmount(),s),t),precision:e})},add:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ga.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ga.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:ga.round(ga.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:ga.round(ga.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return ma(e),this.multiply(ga.divide(e,100),t)},allocate:function(e){var t=this;!function(e){ha(function(e){return e.length>0&&e.every(function(e){return e>=0})&&e.some(function(e){return e>0})}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce(function(e,t){return ga.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(ga.divide(ga.multiply(t.getAmount(),e),n));return r=ga.subtract(r,i),u.call(t,{amount:i})}),o=0;r>0;)e[o]>0&&(i[o]=i[o].add(u.call(this,{amount:1})),r=ga.subtract(r,1)),o+=1;return i},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,i=void 0===r?d.endpoint:r,o=n.propertyPath,s=void 0===o?d.propertyPath||"rates.{{to}}":o,a=n.headers,c=void 0===a?d.headers:a,f=n.roundingMode,h=void 0===f?l:f,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:h});return fa(m).getExchangeRate(this.getCurrency(),e).then(function(n){return ha(!la(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:ga.round(ga.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==ga.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==ga.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=function(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter(function(e){return!la(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return la(this.getMatches().find(e))?0:this.getMatches()[ua.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find(function(e){return"USD"===e||"dollar"===e||"$"===e})]},getStyle:function(){return la(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!la(this.getMatches().find(function(e){return","===e}))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:a);return this.toRoundedUnit(t.getMinimumFractionDigits(),e).toLocaleString(this.getLocale(),{currencyDisplay:t.getCurrencyDisplay(),useGrouping:t.getUseGrouping(),minimumFractionDigits:t.getMinimumFractionDigits(),style:t.getStyle(),currency:this.getCurrency()})},toUnit:function(){return ga.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,n=Math.pow(10,e);return ga.divide(ga.round(ga.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Qs,na),ya={},va={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+(t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+n+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let o=0;o<i;o++)e[r[o]]="strict"===n?[t[r[o]]]:t[r[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){const t=r.exec(e);return!(null==t)},e.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const i=[];i.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let e=0;e<o;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n},e.nameRegexp=n}(va);const Ia=va,$a={allowBooleanAttributes:!1,unpairedTags:[]};function _a(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ca(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return Da("InvalidXml","XML declaration allowed only at the start of the document.",Oa(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Ea(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}ya.validate=function(e,t){t=Object.assign({},$a,t);const n=[];let r=!1,i=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=Ca(e,o),o.err)return o}else{if("<"!==e[o]){if(_a(e[o]))continue;return Da("InvalidChar","char '"+e[o]+"' is not expected.",Oa(e,o))}{let s=o;if(o++,"!"===e[o]){o=Ea(e,o);continue}{let a=!1;"/"===e[o]&&(a=!0,o++);let l="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)l+=e[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!ka(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Da("InvalidTag",t,Oa(e,o))}const c=Sa(e,o);if(!1===c)return Da("InvalidAttr","Attributes for '"+l+"' have open quote.",Oa(e,o));let d=c.value;if(o=c.index,"/"===d[d.length-1]){const n=o-d.length;d=d.substring(0,d.length-1);const i=Ta(d,t);if(!0!==i)return Da(i.err.code,i.err.msg,Oa(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Da("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Oa(e,o));if(d.trim().length>0)return Da("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Oa(e,s));if(0===n.length)return Da("InvalidTag","Closing tag '"+l+"' has not been opened.",Oa(e,s));{const t=n.pop();if(l!==t.tagName){let n=Oa(e,t.tagStartPos);return Da("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Oa(e,s))}0==n.length&&(i=!0)}}else{const a=Ta(d,t);if(!0!==a)return Da(a.err.code,a.err.msg,Oa(e,o-d.length+a.err.line));if(!0===i)return Da("InvalidXml","Multiple possible root nodes found.",Oa(e,o));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:s}),r=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=Ea(e,o);continue}if("?"!==e[o+1])break;if(o=Ca(e,++o),o.err)return o}else if("&"===e[o]){const t=Ra(e,o);if(-1==t)return Da("InvalidChar","char '&' is not expected.",Oa(e,o));o=t}else if(!0===i&&!_a(e[o]))return Da("InvalidXml","Extra text at the end",Oa(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Da("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Oa(e,n[0].tagStartPos)):!(n.length>0)||Da("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Da("InvalidXml","Start tag expected.",1)};const Aa='"',ba="'";function Sa(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Aa||e[t]===ba)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const Na=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Ta(e,t){const n=Ia.getAllMatches(e,Na),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Da("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Ma(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Da("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Ma(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Da("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Ma(n[e]));const i=n[e][2];if(!xa(i))return Da("InvalidAttr","Attribute '"+i+"' is an invalid name.",Ma(n[e]));if(r.hasOwnProperty(i))return Da("InvalidAttr","Attribute '"+i+"' is repeated.",Ma(n[e]));r[i]=1}return!0}function Ra(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function Da(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xa(e){return Ia.isName(e)}function ka(e){return Ia.isName(e)}function Oa(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ma(e){return e.startIndex+e[1].length}var Pa={};const Ba={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};Pa.buildOptions=function(e){return Object.assign({},Ba,e)},Pa.defaultOptions=Ba;var La=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};const Fa=va;function Va(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const r=e[t++];let i="";for(;t<e.length&&e[t]!==r;t++)i+=e[t];return[n,i,t]}function Ua(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function Wa(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function Ha(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function za(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function ja(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function qa(e){if(Fa.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var Ga=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,i=!1,o=!1,s="";for(;t<e.length;t++)if("<"!==e[t]||o)if(">"===e[t]){if(o?"-"===e[t-1]&&"-"===e[t-2]&&(o=!1,r--):r--,0===r)break}else"["===e[t]?i=!0:s+=e[t];else{if(i&&Wa(e,t))t+=7,[entityName,val,t]=Va(e,t+1),-1===val.indexOf("&")&&(n[qa(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&Ha(e,t))t+=8;else if(i&&za(e,t))t+=8;else if(i&&ja(e,t))t+=9;else{if(!Ua)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const Xa=/^[-+]?0x[a-fA-F0-9]+$/,Ya=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Za={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var Ka=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1};const Qa=va,Ja=La,el=Ga,tl=function(e,t={}){if(t=Object.assign({},Za,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if(t.hex&&Xa.test(n))return Number.parseInt(n,16);{const r=Ya.exec(n);if(r){const i=r[1],o=r[2];let s=function(e){if(e&&-1!==e.indexOf("."))return"."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e;return e}(r[3]);const a=r[4]||r[6];if(!t.leadingZeros&&o.length>0&&i&&"."!==n[2])return e;if(!t.leadingZeros&&o.length>0&&!i&&"."!==n[1])return e;{const r=Number(n),l=""+r;return-1!==l.search(/[eE]/)||a?t.eNotation?r:e:-1!==n.indexOf(".")?"0"===l&&""===s||l===s||i&&l==="-"+s?r:e:o?s===l||i+s===l?r:e:n===l||n===i+l?r:e}}return e}},nl=Ka;function rl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function il(e,t,n,r,i,o,s){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,i,o);if(null==r)return e;if(typeof r!=typeof e||r!==e)return r;if(this.options.trimValues)return gl(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?gl(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function ol(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const sl=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function al(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=Qa.getAllMatches(e,sl),r=n.length,i={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let o=n[e][4],s=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[s]=null==e?o:typeof e!=typeof o||e!==o?e:gl(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[s]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const ll=function(e){e=e.replace(/\r\n?/g,"\n");const t=new Ja("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=hl(e,">",o,"Closing Tag is not closed.");let s=e.substring(o+2,t).trim();if(this.options.removeNSPrefix){const e=s.indexOf(":");-1!==e&&(s=s.substr(e+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(r=this.saveTextToParentTag(r,n,i));const a=i.substring(i.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=i.lastIndexOf("."),i=i.substring(0,l),n=this.tagsNodeStack.pop(),r="",o=t}else if("?"===e[o+1]){let t=ml(e,o,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,i),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new Ja(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i)}o=t.closeIndex+1}else if("!--"===e.substr(o+1,3)){const t=hl(e,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=e.substring(o+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=t}else if("!D"===e.substr(o+1,2)){const t=el(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=hl(e,"]]>",o,"CDATA is not closed.")-2,s=e.substring(o+9,t);r=this.saveTextToParentTag(r,n,i);let a=this.parseTextData(s,n.tagname,i,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=t+2}else{let s=ml(e,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let c=s.tagExp,d=s.attrExpPresent,u=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,i,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==t.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(e,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,t=n.tagContent}const r=new Ja(a);a!==c&&d&&(r[":@"]=this.buildAttributesMap(c,i,a)),t&&(t=this.parseTextData(t,a,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new Ja(a);a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),i=i.substr(0,i.lastIndexOf("."))}else{const e=new Ja(a);this.tagsNodeStack.push(n),a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),n=e}r="",o=u}}else r+=e[o]}return t.child};function cl(e,t,n){const r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const dl=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function ul(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function fl(e,t,n){const r="*."+n;for(const n in e){const i=e[n];if(r===i||t===i)return!0}return!1}function hl(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function ml(e,t,n,r=">"){const i=function(e,t,n=">"){let r,i="";for(let o=t;o<e.length;o++){let t=e[o];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:i,index:o};if(e[o+1]===n[1])return{data:i,index:o}}else"\t"===t&&(t=" ");i+=t}}(e,t+1,r);if(!i)return;let o=i.data;const s=i.index,a=o.search(/\s/);let l=o,c=!0;-1!==a&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const d=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==i.data.substr(e+1))}return{tagName:l,tagExp:o,closeIndex:s,attrExpPresent:c,rawTagName:d}}function pl(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=hl(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(i--,0===i))return{tagContent:e.substring(r,n),i:o};n=o}else if("?"===e[n+1]){n=hl(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=hl(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=hl(e,"]]>",n,"StopNode is not closed.")-2}else{const r=ml(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function gl(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:tl(e,n))}return Qa.isExist(e)?e:""}var wl=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=rl,this.parseXml=ll,this.parseTextData=il,this.resolveNameSpace=ol,this.buildAttributesMap=al,this.isItStopNode=fl,this.replaceEntitiesValue=dl,this.readStopNodeData=pl,this.saveTextToParentTag=ul,this.addChild=cl,this.ignoreAttributesFn=nl(this.options.ignoreAttributes)}},yl={};function vl(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Il(s);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=s[a]:r+=""+s[a];else{if(void 0===a)continue;if(s[a]){let e=vl(s[a],t,l);const n=_l(e,t);s[":@"]?$l(e,s[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==i[a]&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(e)):t.isArray(a,l,n)?i[a]=[e]:i[a]=e}}}return"string"==typeof r?r.length>0&&(i[t.textNodeName]=r):void 0!==r&&(i[t.textNodeName]=r),i}function Il(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function $l(e,t,n,r){if(t){const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];r.isArray(o,n+"."+o,!0,!0)?e[o]=[t[o]]:e[o]=t[o]}}}function _l(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}yl.prettify=function(e,t){return vl(e,t)};const{buildOptions:Cl}=Pa,El=wl,{prettify:Al}=yl,bl=ya;var Sl=class{constructor(e){this.externalEntities={},this.options=Cl(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=bl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new El(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Al(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Nl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Tl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Dl(c,t)||(e=t.tagValueProcessor(l,e),e=xl(e,t)),o&&(i+=r),i+=e,o=!1;continue}if(l===t.cdataPropName){o&&(i+=r),i+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,o=!1;continue}if(l===t.commentPropName){i+=r+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const e=Rl(a[":@"],t),n="?xml"===l?"":r;let s=a[l][0][t.textNodeName];s=0!==s.length?" "+s:"",i+=n+`<${l}${s}${e}?>`,o=!0;continue}let d=r;""!==d&&(d+=t.indentBy);const u=r+`<${l}${Rl(a[":@"],t)}`,f=Nl(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":f&&0!==f.length||!t.suppressEmptyNode?f&&f.endsWith(">")?i+=u+`>${f}${r}</${l}>`:(i+=u+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?i+=r+t.indentBy+f+r:i+=f,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function Tl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(e.hasOwnProperty(r)&&":@"!==r)return r}}function Rl(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=xl(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Dl(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function xl(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const kl=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Nl(e,t,"",n)},Ol=Ka,Ml={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Pl(e){this.options=Object.assign({},Ml,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ol(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Fl),this.processTextOrObjNode=Bl,this.options.format?(this.indentate=Ll,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Bl(e,t,n,r){const i=this.j2x(e,n+1,r.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function Ll(e){return this.options.indentBy.repeat(e)}function Fl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Pl.prototype.build=function(e){return this.options.preserveOrder?kl(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},Pl.prototype.j2x=function(e,t,n){let r="",i="";const o=n.join(".");for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(void 0===e[s])this.isAttribute(s)&&(i+="");else if(null===e[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,"",t);else if("object"!=typeof e[s]){const n=this.isAttribute(s);if(n&&!this.ignoreAttributesFn(n,o))r+=this.buildAttrPairStr(n,""+e[s]);else if(!n)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const r=e[s].length;let o="",a="";for(let l=0;l<r;l++){const r=e[s][l];if(void 0===r);else if(null===r)"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof r)if(this.options.oneListGroup){const e=this.j2x(r,t+1,n.concat(s));o+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else o+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),o+=e}else o+=this.buildTextValNode(r,s,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,a,t)),i+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],""+e[s][t[i]])}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Pl.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},Pl.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,o="";return"?"===t[0]&&(o="?",i=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===o.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+o+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+"<"+t+n+o+">"+e+i}},Pl.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},Pl.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+"</"+t+this.tagEndChar}},Pl.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};for(var Vl={XMLParser:Sl,XMLValidator:ya,XMLBuilder:Pl},Ul=[],Wl=0;Wl<256;++Wl)Ul.push((Wl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class Hl extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class zl extends Hl{constructor(e){super(e)}}class jl extends Hl{constructor(e){super(e)}}const ql=e=>e.Id.IBAN?{iban:e.Id.IBAN}:{...e.Id?.Othr?.Id&&{accountNumber:String(e.Id.Othr.Id)},...e.Nm&&{name:e.Nm},...e.Ccy&&{currency:e.Ccy}},Gl=e=>{if(e){if(e.FinInstnId?.BIC)return{bic:e.FinInstnId.BIC};if(e.FinInstnId?.BICFI)return{bic:e.FinInstnId.BICFI};if(e.FinInstnId){const t=e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId?.MmbId;if(t)return{abaRoutingNumber:t.toString()}}}},Xl=(e,t="USD")=>{const n=wa({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},Yl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},Zl=e=>{const t=e.Id.toString(),n=e.ElctrncSeqNb,r=e.LglSeqNb,i=new Date(e.CreDtTm);let o,s;e.FrToDt&&(o=new Date(e.FrToDt.FrDtTm),s=new Date(e.FrToDt.ToDtTm));const a=e.TxsSummry?.TtlNtries.NbOfNtries,l=e.TxsSummry?.TtlNtries.Sum,c=e.TxsSummry?.TtlNtries.TtlNetNtryAmt;let d;c&&(d=Xl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries.Sum,h=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=ql(e.Acct),g=Gl(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(Kl):e.Bal&&(w=[Kl(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(Ql):e.Ntry&&(y=[Ql(e.Ntry)]),{id:t,electronicSequenceNumber:n,legalSequenceNumber:r,creationDate:i,fromDate:o,toDate:s,account:p,agent:g,numOfEntries:a,sumOfEntries:l,netAmountOfEntries:d,numOfCredits:u,sumOfCredits:f,numOfDebits:h,sumOfDebits:m,balances:w,entries:y}},Kl=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=Xl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:Yl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},Ql=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=Yl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=Xl(o,s),l=e.BkTxCd.Prtry?.Cd,c=(e=>{if(e)return Array.isArray(e)?e.join("\n"):e})(e.AddtlNtryInf),d=e.AcctSvcrRef,u=ec(e.BkTxCd);let f=e.NtryDtls||[];Array.isArray(f)||(f=[f]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:f.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(Jl)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},Jl=e=>{const t=e.Refs?.MsgId,n=e.Refs?.AcctSvcrRef,r=e.Refs?.PmtInfId,i=e.RmtInf?.Ustrd,o=e.Purp?.Prtry,s=e.RtrInf?.Rsn,a=e.RtrInf?.AddtlInf,l=e.Refs?.EndToEndId,c=e.Amt["@_Ccy"],d=e.Amt["#text"],u=e.RmtInf?.Strd?.CdtrRefInf?.Ref?.toString(),f=e.RmtInf?.Strd?.AddtlRmtInf;let h,m,p,g,w,y,v,I;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm||e.RltdPties.Dbtr.Pty?.Nm),e.RltdPties?.DbtrAcct&&(p=ql(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=Gl(e.RltdAgts.DbtrAgt)),(m||p||g)&&(h={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm||e.RltdPties.Cdtr.Pty?.Nm),e.RltdPties?.CdtrAcct&&(v=ql(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&(I=Gl(e.RltdAgts.CdtrAgt)),(y||v||I)&&(w={name:y,account:v,agent:I}),{messageId:t,accountServicerReferenceId:n,endToEndId:l,currency:c,amount:d,paymentInformationId:r,remittanceInformation:i,proprietaryPurpose:o,returnReason:s,returnAdditionalInformation:a,debtor:h,creditor:w,invoiceRef:u,invoiceRefAdd:f}},ec=e=>{const t=e?.Domn?.Cd,n=e?.Domn?.Fmly?.Cd,r=e?.Domn?.Fmly?.SubFmlyCd,i=e.Prtry?.Cd,o=e.Prtry?.Issr;return{domainCode:t,domainFamilyCode:n,domainSubFamilyCode:r,proprietaryCode:i,proprietaryCodeIssuer:o}};class tc{_messageId;_creationDate;_recipient;_statements;constructor(e){this._messageId=e.messageId,this._creationDate=e.creationDate,this._recipient=e.recipient,this._statements=e.statements}static getParser(){return new Vl.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=tc.getParser().parse(e);if(!t.Document)throw new zl("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new jl("Invalid CAMT.053 namespace");const n=t.Document.BkToCstmrStmt,r=n.GrpHdr.CreDtTm,i=new Date(r);let o=[];o=Array.isArray(n.Stmt)?n.Stmt.map(e=>Zl(e)):[Zl(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new tc({messageId:n.GrpHdr.MsgId.toString(),creationDate:i,recipient:s?(a=s,{id:a.Id?.OrgId?.Othr?.Id,name:a.Nm}):void 0,statements:o});var a}get balances(){return this._statements.flatMap(e=>e.balances)}get transactions(){return this._statements.flatMap(e=>e.entries).flatMap(e=>e.transactions)}get entries(){return this._statements.flatMap(e=>e.entries)}get messageId(){return this._messageId}get recipient(){return this._recipient}get creationDate(){return this._creationDate}get statements(){return this._statements}}function nc(e){let t,n,r,i,o;function s(t){e[17](t)}let a={class:e[0],id:e[1],name:e[2],accept:"text/xml",max:"1",beforeChange:e[13]};return void 0!==e[3]&&(a.files=e[3]),t=new e[7]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[12]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function rc(e){let t,n;return t=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.inputClass=e[0]),2&n&&(r.id=e[1]),2&n&&(r.name=e[1]),16&n&&(r.value=e[4]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ic(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[oc]},$$scope:{ctx:e}}}),{c(){t=O("div"),be(n.$$.fragment),j(t,"margin-top","1em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};1073741888&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function oc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=P(e[6]),n=B(),be(r.$$.fragment)},m(e,o){D(e,t,o),D(e,n,o),Se(r,e,o),i=!0},p(e,n){(!i||64&n)&&H(t,e[6])},i(e){i||(ye(r.$$.fragment,e),i=!0)},o(e){ve(r.$$.fragment,e),i=!1},d(e){e&&x(t),e&&x(n),Ne(r,e)}}}function sc(e){let t,n,r,i,o;const s=[rc,nc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&ic(e);return{c(){n.c(),r=B(),l&&l.c(),i=L()},m(e,n){a[t].m(e,n),D(e,r,n),l&&l.m(e,n),D(e,i,n),o=!0},p(e,[t]){n.p(e,t),e[5]?l?(l.p(e,t),32&t&&ye(l,1)):(l=ic(e),l.c(),ye(l,1),l.m(i.parentNode,i)):l&&(ge(),ve(l,1,1,()=>{l=null}),we())},i(e){o||(ye(n),ye(l),o=!0)},o(e){ve(n),ve(l),o=!1},d(e){a[t].d(e),e&&x(r),l&&l.d(e),e&&x(i)}}}function ac(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=c,l=Q();let{classId:d}=n,{eventId:u}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n;const g="camt53"===h.properties?.type;let w=[],y=f[h.name]||"",v=!!f._id,I=!1,$="In Verarbeitung!";const _=async(e,n,r,i,o,s)=>{try{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a?.length){let e=a[0].listBill.find(e=>i&&e.reference.replaceAll(" ","")===i);if(!e&&s&&(e=a[0].listBill.find(e=>e.iban.replaceAll(" ","")===s&&+e.amount==+o)),e)return e.bill}}catch{}return""},C=async(e,n,r,i,o,s,a=[])=>{try{if("credit"!==e)return"";let i,o=N(n);if(o.startsWith("R-")||(o=""),!o&&r&&(r=r.toString(),o=N(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}const l=+Number.parseFloat(+s-.04).toFixed(2),c=+Number.parseFloat(+s+.04).toFixed(2);if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id)&&e.__total>=l&&e.__total<=c)return e._id}}catch{}return""},E=async(e,n,r)=>{try{if(!e)return;const n=await t.getSectionView("incomingPayment",{invoice:e});if(!n?.length)return;const i=n[0];return r===i._total&&i._id}catch{}},A=async e=>{try{if(!e)return;const n=await t.getSectionView("outgoingPayment",{bill:e});if(n?.length)return n[0]._id}catch{}},b=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},S=async(e,n)=>{try{const i=n.output.class[0].list,o=await(async e=>{if(!e.includes("xsd:camt.053"))return;let t;try{t=tc.fromXML(e)}catch(e){console.log("error",e)}return t})(e);if(!o||!o.messageId)return r(6,$="Das ist keine camt53 Datei!"),void r(5,I=!0);const s=await t.getSectionView("dailyJournal",{messageId:o.messageId});if(s?.length)return r(6,$="Bereits eingelesen!"),void r(5,I=!0);o._saldo=o.balances[1].amount/100,o._saldoDate_from=o.balances[0].date,o._saldoDate_to=o.balances[1].date;let a=!0;for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=o[e.properties.source];if(e.properties?.required&&!t){a=!1;break}if("dateRange"===e.type){const t=o[e.properties.source+"_from"],n=o[e.properties.source+"_to"];l("record",{itemName:e.name+"_from",value:t}),l("record",{itemName:e.name+"_to",value:n});continue}"[object Date]"===Object.prototype.toString.call(t)&&(t=new Date(t)),l("record",{itemName:e.name,value:t})}if(!a)return r(6,$="Ungültiger Inhalt!"),void r(5,I=!0);l("record",{itemName:"status",value:"offen"}),await Promise.all(i.map(async e=>await(async(e,t,n)=>{if(f._id)return;if(!e.process)return;n.output.class[0].name;const i=e.process.target;if(!i)return;r(6,$="In Verarbeitung!"),r(5,I=!0);const o=[],s=[],{refItem:a,value:c}=e.process.filter;for(const n of t[e.source]){const t=await b(n.account?.iban);for(const r of n.entries){if(r[a]!==c)continue;let l="SALA"===r.bankTransactionCode?.domainSubFamilyCode,d=!1;for(const a of r.transactions){let c=await C(r.creditDebitIndicator,a.invoiceRef,a.remittanceInformation,e.process.creditor,a.debtor,a.amount,s),u=await E(c,r.bookingDate,a.amount);!1===u&&(c=void 0,u=void 0);const f=await _(r.creditDebitIndicator,l,a.paymentInformationId,a.invoiceRef,a.amount,a.creditor?.account?.iban),h=await A(f),m="",p="",g={accountServicerReferenceId:a.accountServicerReferenceId,messageId:a.messageId,account:n.account.iban,accountDebit:t,creditDebitIndicator:r.creditDebitIndicator,bookingDate:r.bookingDate,amount:a.amount,currency:a.currency,debtor:a.debtor?.name||"",debtorAccount:a.debtor?.account?.iban||"",creditor:a.creditor?.name||"",creditorAccount:a.creditor?.account?.iban||"",paymentInformationId:a.paymentInformationId,invoiceRef:a.invoiceRef,invoiceRefAdd:a.invoiceRefAdd,remittanceInformation:a.remittanceInformation,returnAdditionalInformation:a.returnAdditionalInformation,additionalInformation:r.additionalInformation,invoice:c,incomingPayment:u,payDebtorAvis:p,isSalary:l,bill:f,outgoingPayment:h,journalFinAcc:m};if(l){if(d)continue;g.amount=r.amount/100,d=!0}g[i]?o.push(g):s.push(g)}}}o.length&&l("record",{itemName:e.name,value:o}),s.length&&l("record",{itemName:"open"+e.name,value:s})})(e,o,n))),setTimeout(()=>{l("saveFull"),r(5,I=!1)},2e3)}catch{r(6,$="Ungültiger Inhalt!"),r(5,I=!0)}},N=e=>{try{if(!e?.length)return"";if(e.length<14)return"";const t=e.replaceAll(" ","").slice(-14),n=t.slice(-8),r=t.slice(0,4);let i="";for(let e=0;e<r.length/2;e++){const t=2*e,n=r.substring(t,t+2);i+=String.fromCharCode(n)}return i+n}catch{}return""};return e.$$set=e=>{"classId"in e&&r(0,d=e.classId),"eventId"in e&&r(14,u=e.eventId),"record"in e&&r(15,f=e.record),"item"in e&&r(16,h=e.item),"id"in e&&r(1,m=e.id),"name"in e&&r(2,p=e.name)},e.$$.update=()=>{8&e.$$.dirty&&(w.length||r(5,I=!1))},[d,m,p,w,y,I,$,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(u);if(n){r(4,y=n.name);const t=await n.text();if(g)return S(t,i);const o=(e=>{var t={toObj:function(e){var n={};if(1==e.nodeType){if(e.attributes.length)for(var r=0;r<e.attributes.length;r++)n["@"+e.attributes[r].nodeName]=(e.attributes[r].nodeValue||"").toString();if(e.firstChild){for(var i=0,o=0,s=!1,a=e.firstChild;a;a=a.nextSibling)1==a.nodeType?s=!0:3==a.nodeType&&a.nodeValue.match(/[^ \f\n\r\t\v]/)?i++:4==a.nodeType&&o++;if(s)if(i<2&&o<2)for(t.removeWhite(e),a=e.firstChild;a;a=a.nextSibling)3==a.nodeType?n["#text"]=t.escape(a.nodeValue):4==a.nodeType?n["#cdata"]=t.escape(a.nodeValue):n[a.nodeName]?n[a.nodeName]instanceof Array?n[a.nodeName][n[a.nodeName].length]=t.toObj(a):n[a.nodeName]=[n[a.nodeName],t.toObj(a)]:n[a.nodeName]=t.toObj(a);else e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(i)e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(o)if(o>1)n=t.escape(t.innerXml(e));else for(a=e.firstChild;a;a=a.nextSibling)n["#cdata"]=t.escape(a.nodeValue)}e.attributes.length||e.firstChild||(n=null)}else 9==e.nodeType&&(n=t.toObj(e.documentElement));return n},toJson:function(e,n,r){var i=n?'"'+n+'"':"";if(e instanceof Array){for(var o=0,s=e.length;o<s;o++)e[o]=t.toJson(e[o],"",r+"\t");i+=(n?":[":"[")+(e.length>1?"\n"+r+"\t"+e.join(",\n"+r+"\t")+"\n"+r:e.join(""))+"]"}else if(null==e)i+=(n&&":")+"null";else if("object"==typeof e){var a=[];for(var l in e)a[a.length]=t.toJson(e[l],l,r+"\t");i+=(n?":{":"{")+(a.length>1?"\n"+r+"\t"+a.join(",\n"+r+"\t")+"\n"+r:a.join(""))+"}"}else i+="string"==typeof e?(n&&":")+'"'+e.toString()+'"':(n&&":")+e.toString();return i},innerXml:function(e){var t="";if("innerHTML"in e)t=e.innerHTML;else for(var n=function(e){var t="";if(1==e.nodeType){t+="<"+e.nodeName;for(var r=0;r<e.attributes.length;r++)t+=" "+e.attributes[r].nodeName+'="'+(e.attributes[r].nodeValue||"").toString()+'"';if(e.firstChild){t+=">";for(var i=e.firstChild;i;i=i.nextSibling)t+=n(i);t+="</"+e.nodeName+">"}else t+="/>"}else 3==e.nodeType?t+=e.nodeValue:4==e.nodeType&&(t+="<![CDATA["+e.nodeValue+"]]>");return t},r=e.firstChild;r;r=r.nextSibling)t+=n(r);return t},escape:function(e){return e.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(e){e.normalize();for(var n=e.firstChild;n;)if(3==n.nodeType)if(n.nodeValue.match(/[^ \f\n\r\t\v]/))n=n.nextSibling;else{var r=n.nextSibling;e.removeChild(n),n=r}else 1==n.nodeType?(t.removeWhite(n),n=n.nextSibling):n=n.nextSibling;return e}};return e=(new window.DOMParser).parseFromString(e,"text/xml"),t.toObj(t.removeWhite(e))})(t),s=[],a=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(a.Ntry);for(const e of c){let t=[].concat(e.NtryDtls.TxDtls);for(const n of t){const t=n.RmtInf?.Strd?.CdtrRefInf?.Ref||n.Refs.EndToEndId||"",r={date:e.ValDt.Dt,branchName:n.RltdPties?.Dbtr?.Nm||"",amount:n.AmtDtls?.TxAmt?.Amt["#text"]||n.Amt["#text"],reference:t,invoiceId:N(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},u,f,h,function(e){w=e,r(3,w)}]}class lc extends Re{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=O("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",R(document.head,t)),Te(this,e,ac,sc,b,{classId:0,eventId:14,record:15,item:16,id:1,name:2})}}const cc=e=>{const t={},n=e.replaceAll("\r","").split("\n");return n?(t.iban=n[3],t.supplierText=n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9],t.supplier={company:{}},t.supplier.company.companyName=n[5],t.supplier.company.postcode=n[8],t.amount=n[18],t.amountOrg=n[18],t.currency={},t.currency.designation=n[19],t.reference=n[28],t.additionalInfo=n[29],t.extReference=dc(10,n[31]),t.amountVat=uc(!0,dc(32,n[31]),t.amount)||uc(!1,dc(33,n[31]),t.amount),t):t},dc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},uc=(e,t,n)=>{if(!t)return"";let r=0;if(t.includes(":")){const n=t.split(";");for(const t of n){const[n,i]=t.split(":");r+=e?i/100*n:i}}else r=+n/(+t+100)*+t;return r},{document:fc}=_e;function hc(e){let t,n,r,i,o;function s(t){e[14](t)}let a={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[10]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[8]),i=new e[6]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function mc(e){let t,n,r,i;n=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&pc(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),16&r&&(i.value=e[4]),n.$set(i),e[4]?o?(o.p(e,r),16&r&&ye(o,1)):(o=pc(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function pc(e){let t,n,r,i,o;return n=new ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-o0hiko")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[9]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function gc(e){let t,n,r,i;const o=[mc,hc],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}let wc;function yc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=Q();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,m=[],p=d[u.name]||"",g=!!d._id;const w={scale:{once:!1,value:1,start:1,step:.2,stop:1.6},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}};var y=async function(e){if(!e.success)return;const n=await t.getSchema(l),i=e.codes?.filter(e=>!!e)?.at(0);if(!i?.length)return;if(!i.startsWith("SPC"))return;const o=cc(i);for(const e in o){if(n.items.find(t=>t.name===e)){if("object"==typeof o[e]){let n={};for(const i in o[e])if("object"==typeof o[e][i])for(const s in o[e][i]){o[e][i][s]&&(n[s]=o[e][i][s]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(11,d[e]=n[0]._id,d)}}else{o[e][i]&&(n[i]=o[e][i]);const s=await t.getSectionView(e,n);s?.length&&r(11,d[e]=s[0]._id,d)}}else o[e]&&r(11,d[e]=o[e],d);s("record",{itemName:e,value:d[e]})}}};return Z(()=>{if(wc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){wc=PDF_QR_JS}}),K(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(12,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(13,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name)},[a,f,h,m,p,i,o,g,async e=>{const n=m[0];if(!n){s("record",{itemName:"$file",value:!1});const e=await t.getSchema(l);for(const t of e.items)s("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,p=n.name),s("record",{itemName:"$file",value:{fileName:p,file:n}}),wc.decodeDocument(i,w,y)},async()=>{if(!d?._id)return;const e=await t.getTaskByDocId(d._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r="/viewer/doc/index.html?file="+("/api/userreport/"+n[0]._id)+"&type=pdf";window.open(r,"","popup=yes toolbar=no width=800 height=1024")},()=>{r(3,m)},d,l,u,function(e){m=e,r(3,m)}]}class vc extends Re{constructor(e){var t;super(),fc.getElementById("svelte-o0hiko-style")||((t=O("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(fc.head,t)),Te(this,e,yc,gc,b,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Ic}=_e;function $c(e){let t,n,r,i,o;function s(t){e[18](t)}let a={class:e[0],id:e[1],name:e[2],accept:e[3],max:"1",beforeChange:e[12]};return void 0!==e[4]&&(a.files=e[4]),t=new e[7]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[9]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[5]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),8&r&&(o.accept=e[3]),!n&&16&r&&(n=!0,o.files=e[4],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),32&r&&(s.value=e[5]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function _c(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[5]}});let o=e[5]&&Cc(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),32&r&&(i.value=e[5]),n.$set(i),e[5]?o?(o.p(e,r),32&r&&ye(o,1)):(o=Cc(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function Cc(e){let t,n,r,i,o;const s=[Ac,Ec],a=[];function l(e,n){return 32&n&&(t=!!e[5].endsWith(".mp4")),t?0:1}return n=l(e,-1),r=a[n]=s[n](e),{c(){r.c(),i=L()},m(e,t){a[n].m(e,t),D(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(ge(),ve(a[o],1,1,()=>{a[o]=null}),we(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),ye(r,1),r.m(i.parentNode,i))},i(e){o||(ye(r),o=!0)},o(e){ve(r),o=!1},d(e){a[n].d(e),e&&x(i)}}}function Ec(e){let t,n,r,i,o;return n=new ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-o0hiko")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[10]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Ac(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:Nc,then:Sc,catch:bc,value:23};return Ie(e[11](),n),{c(){t=L(),n.block.c()},m(e,r){D(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){$e(n,e=t,r)},i:$,o:$,d(e){e&&x(t),n.block.d(e),n.token=null,n=null}}}function bc(e){return{c:$,m:$,p:$,d:$}}function Sc(e){let t,n,r,i;return{c(){t=O("video"),n=O("source"),i=P("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&W(n,"src",r),W(n,"type","video/mp4"),W(t,"width","500"),t.controls=!0,j(t,"margin-top","1em")},m(e,r){D(e,t,r),R(t,n),R(t,i)},p:$,d(e){e&&x(t)}}}function Nc(e){return{c:$,m:$,p:$,d:$}}function Tc(e){let t,n,r,i;const o=[_c,$c],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Rc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=Q();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Z(()=>{(async()=>{if(!p)return;const e=await t.getTaskByDocId(p,!0);if(!e)return s("listRecord",{itemName:"fileName",value:"",string:!0});const n=d[u.name];if(!n)return s("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return s("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return s("listRecord",{itemName:"fileName",value:"",string:!0});r(5,y=o.fileName),r(6,v=void 0===m?!!p:!!y)})()}),K(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(13,l=e.eventId),"record"in e&&r(14,d=e.record),"item"in e&&r(15,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name),"praefix"in e&&r(16,m=e.praefix),"recordId"in e&&r(17,p=e.recordId),"fileType"in e&&r(3,g=e.fileType)},[a,f,h,g,w,y,v,i,o,async e=>{const t=w[0];URL.createObjectURL(t),r(5,y=t.name),s("record",{itemName:"$file",value:{fileName:y,file:t}}),void 0!==m&&s("listRecord",{itemName:"fileName",value:y,string:!0})},async()=>{if(!p)return;let e;const n=await t.getTaskByDocId(p,!0);if(!n)return;const r=await t.getUserReports(n._id);if(!r?.length)return;let i=r.find(e=>e.fileName===y);i||(i=r[0]);e="/viewer/doc/index.html?file="+("/api/userreport/"+i._id)+"&type=pdf",window.open(e,"","popup=yes toolbar=no width=800 height=1024")},async()=>{const e=await t.getTaskByDocId(p,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===y);return r||(r=n[0]),"/api/userreport/"+r._id},()=>{r(4,w)},l,d,u,m,p,function(e){w=e,r(4,w)}]}class Dc extends Re{constructor(e){var t;super(),Ic.getElementById("svelte-o0hiko-style")||((t=O("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(Ic.head,t)),Te(this,e,Rc,Tc,b,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function xc(e){let t,n,r;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:kc,placeholder:Oc,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=O("div"),be(n.$$.fragment),j(t,"max-width","4em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,[t]){const r={};4&t&&(r.inputClass=e[2]),1&t&&(r.id=e[0]),1&t&&(r.name=e[0]),2&t&&(r.value=e[1]),8&t&&(r.readonly=e[3]),16&t&&(r.disabled=e[4]),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}const kc="([01][0-9]|2[0-3]):([0-5][0-9])",Oc="";function Mc(e,t,n){const r=Q(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:f}=t;const h=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,o=e.id),"item"in e&&n(7,s=e.item),"value"in e&&n(1,a=e.value),"inputClass"in e&&n(2,l=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class Pc extends Re{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=O("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",R(document.head,t)),Te(this,e,Mc,xc,b,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Bc}=_e;function Lc(e,t,n){const r=e.slice();return r[22]=t[n],r}function Fc(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function Vc(e){let t,n,r=e[3](e[22],e[25])+"",i=e[27]&&function(){let e;return{c(){e=P(", ")},m(t,n){D(t,e,n)},d(t){t&&x(e)}}}();return{c(){t=O("span"),i&&i.c(),n=P(r),W(t,"class","lookupValue")},m(e,r){D(e,t,r),i&&i.m(t,null),R(t,n)},p(e,t){3&t&&r!==(r=e[3](e[22],e[25])+"")&&H(n,r)},d(e){e&&x(t),i&&i.d()}}}function Uc(e){let t,n,r,i,o,s,a,l,c,d=e[0],u=[];for(let t=0;t<d.length;t+=1)u[t]=Vc(Fc(e,d,t));i=new st({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new ke({props:{size:"18"}}),{c(){t=O("span"),t.textContent="  /  ",n=B(),r=O("span"),be(i.$$.fragment),o=B(),s=O("span"),s.textContent="Rechnung",W(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){D(d,t,u),D(d,n,u),D(d,r,u),Se(i,r,null),D(d,o,u),D(d,s,u),a=!0,l||(c=F(r,"click",function(){A(e[5](e[22]._id))&&e[5](e[22]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||(ye(i.$$.fragment,e),a=!0)},o(e){ve(i.$$.fragment,e),a=!1},d(e){e&&x(t),e&&x(n),e&&x(r),Ne(i),e&&x(o),e&&x(s),l=!1,c()}}}(e);return{c(){t=O("div");for(let e=0;e<u.length;e+=1)u[e].c();n=B(),r=O("span"),be(i.$$.fragment),o=B(),f&&f.c(),s=B(),W(r,"class","feather pointer svelte-1jurfpd"),W(t,"class","lookupItem svelte-1jurfpd")},m(d,h){D(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,n),R(t,r),Se(i,r,null),R(t,o),f&&f.m(t,null),R(t,s),a=!0,l||(c=F(r,"click",function(){A(e[4](e[22]._id))&&e[4](e[22]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=Fc(e,d,r);u[r]?u[r].p(o,i):(u[r]=Vc(o),u[r].c(),u[r].m(t,n))}for(;r<u.length;r+=1)u[r].d(1);u.length=d.length}e[2]&&f.p(e,i)},i(e){a||(ye(i.$$.fragment,e),ye(f),a=!0)},o(e){ve(i.$$.fragment,e),ve(f),a=!1},d(e){e&&x(t),k(u,e),Ne(i),f&&f.d(),l=!1,c()}}}function Wc(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Uc(Lc(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){t=O("div");for(let e=0;e<i.length;e+=1)i[e].c();W(t,"class","lookup svelte-1jurfpd")},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(63&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=Lc(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Uc(o),i[s].c(),ye(i[s],1),i[s].m(t,null))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){e&&x(t),k(i,e)}}}function Hc(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{notifyList:l}=n;const{refItem:c,view:d,beforeSave:u,_state:f,addAttachment:h}=o.properties;let p=d.split(","),[g,w]=c.split(":"),y=[];const[v,I]=w.split("."),$=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},_=(e=!0)=>{ae().then(()=>{const t=document.querySelector("div.form-field."+o.name);if(t&&(t.style.display=e?"none":"flex"),!e&&u){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return Z(_),e.$$set=e=>{"id"in e&&r(6,i=e.id),"item"in e&&r(7,o=e.item),"praefix"in e&&r(8,s=e.praefix),"record"in e&&r(9,a=e.record),"notifyList"in e&&r(10,l=e.notifyList)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==g)return;if(r(1,y=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[g])return _();const o=!p.some(e=>e.includes(":")),s=I?I+"."+g:g;let l={[s]:a[g]||a._id};f&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f}}]);let c=!1;if(!s.includes(".")){const e=(await t.getSchemaByClass(v)).items.find(e=>e.name===s);e?.properties?.multi&&(c=!0)}if(r(1,y=await t.getSectionView(v,l,o,!0,c)),!o&&y.length){const e=p.find(e=>e.includes(":")),t=e.split(":")[0];r(1,y=y.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,p=p.map(e=>e.split(":")[1]))}_(!y.length)})(l)},[p,y,h,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||$(e,t),e=>async()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=n._id,i=`/task/${n.event}/${r}/task?view=standalone`;window.open(i)},e=>async()=>{let n;const r=await t.getTaskByDocId(e,!0);if(!r)return;const i=await t.getUserReports(r._id);if(!i?.length)return;n="/viewer/doc/index.html?file="+("/api/userreport/"+i[0]._id)+"&type=pdf",window.open(n,"","popup=yes toolbar=no width=800 height=1024")},i,o,s,a,l]}class zc extends Re{constructor(e){var t;super(),Bc.getElementById("svelte-1jurfpd-style")||((t=O("style")).id="svelte-1jurfpd-style",t.textContent=".feather.svelte-1jurfpd{position:absolute;top:0;left:-1.5em;color:#4300b0}.feather2.svelte-1jurfpd{color:#4300b0}div.lookup.svelte-1jurfpd{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1jurfpd{position:relative;margin-left:2em;padding-bottom:0.75em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}div.field:has(div.lookup){margin-bottom:0.25em !important}",R(Bc.head,t)),Te(this,e,Hc,Wc,b,{id:6,item:7,praefix:8,record:9,notifyList:10})}}function jc(e){let t,n,r;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function qc(e){let t,n,r,i,o;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[9]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Gc(e){let t,n,r,i,o,s;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const a=[qc,jc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function Xc(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){J(e,t)}]}class Yc extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Xc,Gc,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Zc(e){let t,n,r;return n=new Et({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Kc(e){let t,n,r,i,o;return n=new Et({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Qc(e){let t,n,r,i,o,s;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[15]);const a=[Kc,Zc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};4&r&&(s.inputClass=e[2]),1&r&&(s.pattern=e[0]),2&r&&(s.placeholder=e[1]),8&r&&(s.disabled=e[3]),16&r&&(s.formnovalidate=e[4]),32&r&&(s.readonly=e[5]),64&r&&(s.required=e[6]),128&r&&(s.id=e[7]),256&r&&(s.name=e[8]),512&r&&(s.value=e[9]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function Jc(e,t,r){let i;const{TextField:o}=c,{environment:s}=u;S(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:d}=t,{formnovalidate:f}=t,{readonly:h}=t,{required:m}=t,{id:p}=t,{name:g}=t,{value:w}=t,{pattern:y}=t,{placeholder:v}=t,{notifyList:I}=t,{country:$}=t;y||="(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))?\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*(\\d{1,2})$",v||="+41 58 234 56 78";const _={ch:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",li:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",de:"^((\\+49|0049)\\s?)?(0|\\s?)?\\d{2,5}(\\s?\\d){4,9}$",at:"^((\\+43|0043)\\s?)?(0\\s?)?[1-9]\\d{1,4}(\\s?\\d){4,10}$",us:"^((\\+1|001)\\s?)?(\\d{3}\\s?){2}\\d{4}$",zh:"^((\\+86|0086)\\s?)?((1\\d{10})|(0\\d{2,3}\\s?\\d{7,8}))$"},C={ch:"+41 58 234 5678",li:"+41 58 234 5678",de:"+49 619 1234 5678",at:"+43 800 123 456",us:"+1 2345 678 901",zh:"+86 123 456 7589"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,d=e.disabled),"formnovalidate"in e&&r(4,f=e.formnovalidate),"readonly"in e&&r(5,h=e.readonly),"required"in e&&r(6,m=e.required),"id"in e&&r(7,p=e.id),"name"in e&&r(8,g=e.name),"value"in e&&r(9,w=e.value),"pattern"in e&&r(0,y=e.pattern),"placeholder"in e&&r(1,v=e.placeholder),"notifyList"in e&&r(13,I=e.notifyList),"country"in e&&r(14,$=e.country)},e.$$.update=()=>{8192&e.$$.dirty&&(async e=>{const{listName:t,itemName:n,value:o}=e||{},s=i?.country?.countryCode?.toLowerCase()||a.lang;$&&n===$&&o?up("country",o).then(e=>{if(e.phonePattern)r(0,y=e.phonePattern),r(1,v=e.phonePlaceholder||"");else{const t=e.countryCode.toLowerCase();_[t]&&(r(0,y=_[t]),r(1,v=C[t]))}}).catch(()=>{r(0,y=_[s]),r(1,v=C[s])}):$&&(r(0,y=_[s]),r(1,v=C[s]))})(I)},[y,v,l,d,f,h,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},I,$,function(t){J(e,t)}]}class ed extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Jc,Qc,b,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1,notifyList:13,country:14})}}function td(e){let t,n,r;return n=new yt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function nd(e){let t,n,r,i,o;return n=new yt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function rd(e){let t,n,r,i,o,s;n=new e[11]({props:{type:"email",inputClass:e[0],pattern:e[9],placeholder:e[10],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],multiple:e[8],value:e[7]}}),n.$on("change",e[13]);const a=[nd,td],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),512&r&&(s.pattern=e[9]),1024&r&&(s.placeholder=e[10]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),256&r&&(s.multiple=e[8]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function id(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{multiple:h}=t,{pattern:m}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"multiple"in e&&n(8,h=e.multiple),"pattern"in e&&n(9,m=e.pattern),"placeholder"in e&&n(10,p=e.placeholder)},[i,o,s,a,l,d,u,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){J(e,t)}]}class od extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,id,rd,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const sd=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","CommentChange","CompositionEnd","CompositionStart","CompositionUpdate","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","Input","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function ad(e){let t;return{c(){t=O("textarea"),W(t,"id",e[0]),j(t,"visibility","hidden")},m(n,r){D(n,t,r),e[20](t)},p(e,n){1&n&&W(t,"id",e[0])},d(n){n&&x(t),e[20](null)}}}function ld(e){let t;return{c(){t=O("div"),W(t,"id",e[0])},m(n,r){D(n,t,r),e[19](t)},p(e,n){1&n&&W(t,"id",e[0])},d(n){n&&x(t),e[19](null)}}}function cd(e){let t;function n(e,t){return e[1]?ld:ad}let r=n(e),i=r(e);return{c(){t=O("div"),i.c(),W(t,"class",e[2])},m(n,r){D(n,t,r),i.m(t,null),e[21](t)},p(e,[o]){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null))),4&o&&W(t,"class",e[2])},i:$,o:$,d(n){n&&x(t),i.d(),e[21](null)}}}const dd=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let ud=(()=>{let e={listeners:[],scriptId:dd("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,r)=>{e.scriptLoaded?r():(e.listeners.push(r),e.injected||((t,n,r,i)=>{e.injected=!0;const o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=r,o.onload=()=>{i()},n.head&&n.head.appendChild(o)})(e.scriptId,t,n,()=>{e.listeners.forEach(e=>e()),e.scriptLoaded=!0}))}}})();function fd(e,t,n){let r,i,o,{id:s=dd("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:f="7"}=t,{scriptSrc:h}=t,{conf:m={}}=t,{modelEvents:p="change input undo redo"}=t,{value:g=""}=t,{text:w=""}=t,{cssClass:y="tinymce-wrapper"}=t,v=g,I=l,$=c;const _=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},C=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},E=Q(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},b=()=>{var e;const t=Object.assign(Object.assign({},m),{target:i,inline:void 0!==a?a:void 0!==m.inline&&m.inline,license_key:u,setup:e=>{e.on("PreInit",()=>{C(e,l),_(e,c)}),n(15,o=e),e.on("init",()=>{e.setContent(g),e.on(p,()=>{n(16,v=e.getContent()),v!==g&&(n(5,g=v),n(6,w=e.getContent({format:"text"})))})}),((e,t)=>{sd.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,E),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return Z(()=>{if(null!==A())b();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;ud.load(r.ownerDocument,e,()=>{b()})}}),K(()=>{var e;o&&(null===(e=A())||void 0===e||e.remove(o))}),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,l=e.disabled),"readonly"in e&&n(8,c=e.readonly),"apiKey"in e&&n(9,d=e.apiKey),"licenseKey"in e&&n(10,u=e.licenseKey),"channel"in e&&n(11,f=e.channel),"scriptSrc"in e&&n(12,h=e.scriptSrc),"conf"in e&&n(13,m=e.conf),"modelEvents"in e&&n(14,p=e.modelEvents),"value"in e&&n(5,g=e.value),"text"in e&&n(6,w=e.text),"cssClass"in e&&n(2,y=e.cssClass)},e.$$.update=()=>{491936&e.$$.dirty&&(o&&v!==g&&(o.setContent(g),n(6,w=o.getContent({format:"text"}))),o&&c!==$&&(n(18,$=c),_(o,c)),o&&l!==I&&(n(17,I=l),C(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,f,h,m,p,o,v,I,$,function(e){te[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){te[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){te[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class hd extends Re{constructor(e){super(),Te(this,e,fd,cd,b,{id:0,inline:1,disabled:7,readonly:8,apiKey:9,licenseKey:10,channel:11,scriptSrc:12,conf:13,modelEvents:14,value:5,text:6,cssClass:2})}}function md(e){let t,n,r,i,o,s,a;function l(t){e[9](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",licenseKey:"gpl",conf:e[7],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new hd({props:c}),te.push(()=>Ae(n,"value",l)),{c(){t=O("div"),be(n.$$.fragment),i=B(),o=O("input"),W(o,"class",s=e[1]||e[2]),W(o,"id",e[3]),W(o,"name",e[3]),o.value=e[0],o.hidden=!0,j(t,"min-height","10em"),j(t,"margin-top","-1em")},m(e,r){D(e,t,r),Se(n,t,null),R(t,i),R(t,o),a=!0},p(e,t){const i={};16&t&&(i.disabled=e[4]),32&t&&(i.readonly=e[5]),!r&&1&t&&(r=!0,i.value=e[0],ce(()=>r=!1)),n.$set(i),(!a||6&t&&s!==(s=e[1]||e[2]))&&W(o,"class",s),(!a||8&t)&&W(o,"id",e[3]),(!a||8&t)&&W(o,"name",e[3]),(!a||1&t&&o.value!==e[0])&&(o.value=e[0])},i(e){a||(ye(n.$$.fragment,e),a=!0)},o(e){ve(n.$$.fragment,e),a=!1},d(e){e&&x(t),Ne(n)}}}function pd(e){let t,n,r=e[6]&&md(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,[n]){e[6]?r?(r.p(e,n),64&n&&ye(r,1)):(r=md(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}let gd=!1;function wd(e,t,r){const i=Q();let o=JSON.parse(n.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let s,{value:a=""}=t,{noForm:l}=t,{classId:c}=t,{id:d}=t,{record:u}=t,{disabled:f}=t,{readonly:h}=t;const m=(e,t)=>{if(!s)return;if(gd)return;if(!e)return;if(!e.includes("{{"))return;const n=p(a,u);n?.length&&(gd=!0,Promise.all(n.map(async(e,n)=>({table:await up(e.table,t[e.table]).catch(()=>{}),def:e}))).then(t=>{if(t?.length){for(const n of t)for(const t of n.def.attrs)e=e.replace(`{{${n.def.table}.${t}}}`,n.table[t]);i("blur",{value:e})}}).catch(e=>{console.log("error",e)}).finally(()=>{r(0,a=e),gd=!1}))},p=(e,t)=>{const n=e.split("{{").slice(1).map(e=>e.split("}}")[0]);if(n?.length)return n.reduce((e,n)=>{const[r,i]=n.split(".");if(!i)return e;if(!t[r])return e;const o=e.find(e=>e.table===r);return o?o.attrs=o.attrs.concat(i):e.push({table:r,attrs:[i]}),e},[])},g={plugins:"advlist link image lists table preview emoticons fullscreen",menu:{file:{title:"File",items:"preview"}},menubar:"edit view insert format table",toolbar:"undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | fullscreen",height:600,language:o};return Z(()=>setTimeout(()=>{r(6,s=!0),m(a,u)},300)),e.$$set=e=>{"value"in e&&r(0,a=e.value),"noForm"in e&&r(1,l=e.noForm),"classId"in e&&r(2,c=e.classId),"id"in e&&r(3,d=e.id),"record"in e&&r(8,u=e.record),"disabled"in e&&r(4,f=e.disabled),"readonly"in e&&r(5,h=e.readonly)},e.$$.update=()=>{257&e.$$.dirty&&m(a,u)},[a,l,c,d,f,h,s,g,u,function(e){a=e,r(0,a)}]}class yd extends Re{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=O("style")).id="svelte-yi7lpi-style",t.textContent="div.tox-statusbar__text-container, div.tox-promotion{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",R(document.head,t)),Te(this,e,wd,pd,b,{value:0,noForm:1,classId:2,id:3,record:8,disabled:4,readonly:5})}}
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(e){"use strict";var t,n,r,i,o,s,a,l,c,d,u,f;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.settings,s=e.TextArea,a=e.toasts,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){f=e.taskClipboard}],execute:function(){function h(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}e("version","0.3.187");const m=e("checkDate",(e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map(e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e).filter(e=>!!e).join(" · ")),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},g=(e,t)=>{let n,r;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=t[e+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(e=>""!==e).join(" - ").trim()},w=e=>!0===e?"(ja)":!1===e?"(nein)":"",y=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t};return(e.display?.reduce((t,r)=>{let[i,o]=r.split(".");if(e.list?.find(({name:e})=>e===i)&&o&&void 0!==n[i]){const e=`${i}_${o}`;n[e]=n[i][o],i=e}return t.find(e=>e===i)||t.push(i),t},[]).map(e=>"boolean"==typeof n[e]?w(n[e]):m(n["_"+e]||n[e]))||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&w(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!v(e)).join(" · ")).filter(e=>!!e).join(" • ")},v=e=>/^[0-9a-f]{24}/.test(e),I=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};function $(){}function _(e){return e()}function C(){return Object.create(null)}function E(e){e.forEach(_)}function A(e){return"function"==typeof e}function b(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function S(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return $;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function N(e){return null==e?"":e}function T(e,t,n=t){return e.set(n),t}function R(e,t){e.appendChild(t)}function D(e,t,n){e.insertBefore(t,n||null)}function x(e){e.parentNode.removeChild(e)}function k(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function O(e){return document.createElement(e)}function M(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function P(e){return document.createTextNode(e)}function B(){return P(" ")}function L(){return P("")}function F(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function V(e){return function(t){return t.preventDefault(),e.call(this,t)}}function U(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function W(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function H(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function z(e,t){e.value=null==t?"":t}function j(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function q(e,t,n){e.classList[n?"add":"remove"](t)}let G;function X(e){G=e}function Y(){if(!G)throw new Error("Function called outside component initialization");return G}function Z(e){Y().$$.on_mount.push(e)}function K(e){Y().$$.on_destroy.push(e)}function Q(){const e=Y();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const i=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}function J(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ee=[],te=[],ne=[],re=[],ie=Promise.resolve();let oe=!1;function se(){oe||(oe=!0,ie.then(fe))}function ae(){return se(),ie}function le(e){ne.push(e)}function ce(e){re.push(e)}let de=!1;const ue=new Set;function fe(){if(!de){de=!0;do{for(let e=0;e<ee.length;e+=1){const t=ee[e];X(t),he(t.$$)}for(X(null),ee.length=0;te.length;)te.pop()();for(let e=0;e<ne.length;e+=1){const t=ne[e];ue.has(t)||(ue.add(t),t())}ne.length=0}while(ee.length);for(;re.length;)re.pop()();oe=!1,de=!1,ue.clear()}}function he(e){if(null!==e.fragment){e.update(),E(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(le)}}const me=new Set;let pe;function ge(){pe={r:0,c:[],p:pe}}function we(){pe.r||E(pe.c),pe=pe.p}function ye(e,t){e&&e.i&&(me.delete(e),e.i(t))}function ve(e,t,n,r){if(e&&e.o){if(me.has(e))return;me.add(e),pe&&pe.c.push(()=>{me.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function Ie(e,t){const n=t.token={};function r(e,r,i,o){if(t.token!==n)return;t.resolved=o;let s=t.ctx;void 0!==i&&(s=s.slice(),s[i]=o);const a=e&&(t.current=e)(s);let l=!1;t.block&&(t.blocks?t.blocks.forEach((e,n)=>{n!==r&&e&&(ge(),ve(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),we())}):t.block.d(1),a.c(),ye(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&fe()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=Y();if(e.then(e=>{X(n),r(t.then,1,t.value,e),X(null)},e=>{if(X(n),r(t.catch,2,t.error,e),X(null),!t.hasCatch)throw e}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}var i}function $e(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}const _e="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Ce(e,t){ve(e,1,1,()=>{t.delete(e.key)})}function Ee(e,t,n,r,i,o,s,a,l,c,d,u){let f=e.length,h=o.length,m=f;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=h;m--;){const e=u(i,o,m),a=n(e);let l=s.get(a);l?r&&l.p(e,t):(l=c(a,e),l.c()),w.set(a,g[m]=l),a in p&&y.set(a,Math.abs(m-p[a]))}const v=new Set,I=new Set;function $(e){ye(e,1),e.m(a,d),s.set(e.key,e),d=e.first,h--}for(;f&&h;){const t=g[h-1],n=e[f-1],r=t.key,i=n.key;t===n?(d=t.first,f--,h--):w.has(i)?!s.has(r)||v.has(r)?$(t):I.has(i)?f--:y.get(r)>y.get(i)?(I.add(r),$(t)):(v.add(i),f--):(l(n,s),f--)}for(;f--;){const t=e[f];w.has(t.key)||l(t,s)}for(;h;)$(g[h-1]);return g}function Ae(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function be(e){e&&e.c()}function Se(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||le(()=>{const t=o.map(_).filter(A);s?s.push(...t):E(t),e.$$.on_mount=[]}),a.forEach(le)}function Ne(e,t){const n=e.$$;null!==n.fragment&&(E(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Te(e,t,n,r,i,o,s=[-1]){const a=G;X(e);const l=e.$$={fragment:null,ctx:null,props:o,update:$,not_equal:i,bound:C(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:t.context||[]),callbacks:C(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(e,t.props||{},(t,n,...r)=>{const o=r.length?r[0]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=o)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](o),c&&function(e,t){-1===e.$$.dirty[0]&&(ee.push(e),se(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,E(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);l.fragment&&l.fragment.l(e),e.forEach(x)}else l.fragment&&l.fragment.c();t.intro&&ye(e.$$.fragment),Se(e,t.target,t.anchor,t.customElement),fe()}X(a)}class Re{$destroy(){Ne(this,1),this.$destroy=$}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function De(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polygon"),W(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),W(r,"points","12 15 17 21 7 21 12 15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-airplay "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function xe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ke extends Re{constructor(e){super(),Te(this,e,xe,De,b,{size:0,strokeWidth:1,class:2})}}function Oe(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("line"),i=M("line"),W(n,"d","M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"),W(r,"x1","12"),W(r,"y1","9"),W(r,"x2","12"),W(r,"y2","13"),W(i,"x1","12"),W(i,"y1","17"),W(i,"x2","12.01"),W(i,"y2","17"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Me(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Pe extends Re{constructor(e){super(),Te(this,e,Me,Oe,b,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("circle"),r=M("polyline"),i=M("line"),W(n,"cx","12"),W(n,"cy","12"),W(n,"r","10"),W(r,"points","8 12 12 16 16 12"),W(i,"x1","12"),W(i,"y1","8"),W(i,"x2","12"),W(i,"y2","16"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Le(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Fe extends Re{constructor(e){super(),Te(this,e,Le,Be,b,{size:0,strokeWidth:1,class:2})}}function Ve(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("path"),W(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),W(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-book-open "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Ue(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class We extends Re{constructor(e){super(),Te(this,e,Ue,Ve,b,{size:0,strokeWidth:1,class:2})}}function He(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("circle"),W(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),W(r,"cx","12"),W(r,"cy","13"),W(r,"r","4"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-camera "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class je extends Re{constructor(e){super(),Te(this,e,ze,He,b,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),W(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),W(r,"points","22 4 12 14.01 9 11.01"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Ge(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Xe extends Re{constructor(e){super(),Te(this,e,Ge,qe,b,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,r;return{c(){t=M("svg"),n=M("path"),W(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",r="feather feather-command "+e[2])},m(e,r){D(e,t,r),R(t,n)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&W(t,"class",r)},i:$,o:$,d(e){e&&x(t)}}}function Ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ke extends Re{constructor(e){super(),Te(this,e,Ze,Ye,b,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,r,i;return{c(){t=M("svg"),n=M("polyline"),r=M("path"),W(n,"points","9 10 4 15 9 20"),W(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function Je(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class et extends Re{constructor(e){super(),Te(this,e,Je,Qe,b,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("line"),i=M("line"),W(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),W(r,"x1","18"),W(r,"y1","9"),W(r,"x2","12"),W(r,"y2","15"),W(i,"x1","12"),W(i,"y1","9"),W(i,"x2","18"),W(i,"y2","15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-delete "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function nt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class rt extends Re{constructor(e){super(),Te(this,e,nt,tt,b,{size:0,strokeWidth:1,class:2})}}function it(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),i=M("line"),W(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),W(r,"points","15 3 21 3 21 9"),W(i,"x1","10"),W(i,"y1","14"),W(i,"x2","21"),W(i,"y2","3"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-external-link "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function ot(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class st extends Re{constructor(e){super(),Te(this,e,ot,it,b,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,r,i,o,s;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),i=M("line"),o=M("line"),W(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),W(r,"points","14 2 14 8 20 8"),W(i,"x1","12"),W(i,"y1","18"),W(i,"x2","12"),W(i,"y2","12"),W(o,"x1","9"),W(o,"y1","15"),W(o,"x2","15"),W(o,"y2","15"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){D(e,t,s),R(t,n),R(t,r),R(t,i),R(t,o)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&W(t,"class",s)},i:$,o:$,d(e){e&&x(t)}}}function lt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ct extends Re{constructor(e){super(),Te(this,e,lt,at,b,{size:0,strokeWidth:1,class:2})}}function dt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("circle"),r=M("line"),i=M("path"),W(n,"cx","12"),W(n,"cy","12"),W(n,"r","10"),W(r,"x1","2"),W(r,"y1","12"),W(r,"x2","22"),W(r,"y2","12"),W(i,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-globe "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function ut(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ft extends Re{constructor(e){super(),Te(this,e,ut,dt,b,{size:0,strokeWidth:1,class:2})}}function ht(e){let t,n,r,i,o,s,a,l;return{c(){t=M("svg"),n=M("line"),r=M("line"),i=M("line"),o=M("line"),s=M("line"),a=M("line"),W(n,"x1","8"),W(n,"y1","6"),W(n,"x2","21"),W(n,"y2","6"),W(r,"x1","8"),W(r,"y1","12"),W(r,"x2","21"),W(r,"y2","12"),W(i,"x1","8"),W(i,"y1","18"),W(i,"x2","21"),W(i,"y2","18"),W(o,"x1","3"),W(o,"y1","6"),W(o,"x2","3.01"),W(o,"y2","6"),W(s,"x1","3"),W(s,"y1","12"),W(s,"x2","3.01"),W(s,"y2","12"),W(a,"x1","3"),W(a,"y1","18"),W(a,"x2","3.01"),W(a,"y2","18"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",l="feather feather-list "+e[2])},m(e,l){D(e,t,l),R(t,n),R(t,r),R(t,i),R(t,o),R(t,s),R(t,a)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&W(t,"class",l)},i:$,o:$,d(e){e&&x(t)}}}function mt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class pt extends Re{constructor(e){super(),Te(this,e,mt,ht,b,{size:0,strokeWidth:1,class:2})}}function gt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("polyline"),W(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),W(r,"points","22,6 12,13 2,6"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-mail "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function wt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class yt extends Re{constructor(e){super(),Te(this,e,wt,gt,b,{size:0,strokeWidth:1,class:2})}}function vt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("path"),r=M("circle"),W(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),W(r,"cx","12"),W(r,"cy","10"),W(r,"r","3"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function It(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class $t extends Re{constructor(e){super(),Te(this,e,It,vt,b,{size:0,strokeWidth:1,class:2})}}function _t(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("polyline"),r=M("line"),i=M("path"),W(n,"points","23 7 23 1 17 1"),W(r,"x1","16"),W(r,"y1","8"),W(r,"x2","23"),W(r,"y2","1"),W(i,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Ct(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Et extends Re{constructor(e){super(),Te(this,e,Ct,_t,b,{size:0,strokeWidth:1,class:2})}}function At(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("rect"),r=M("line"),i=M("line"),W(n,"x","3"),W(n,"y","3"),W(n,"width","18"),W(n,"height","18"),W(n,"rx","2"),W(n,"ry","2"),W(r,"x1","12"),W(r,"y1","8"),W(r,"x2","12"),W(r,"y2","16"),W(i,"x1","8"),W(i,"y1","12"),W(i,"x2","16"),W(i,"y2","12"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function bt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class St extends Re{constructor(e){super(),Te(this,e,bt,At,b,{size:0,strokeWidth:1,class:2})}}function Nt(e){let t,n,r,i,o;return{c(){t=M("svg"),n=M("polyline"),r=M("path"),i=M("rect"),W(n,"points","6 9 6 2 18 2 18 9"),W(r,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),W(i,"x","6"),W(i,"y","14"),W(i,"width","12"),W(i,"height","8"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",o="feather feather-printer "+e[2])},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&W(t,"class",o)},i:$,o:$,d(e){e&&x(t)}}}function Tt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Rt extends Re{constructor(e){super(),Te(this,e,Tt,Nt,b,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i;return{c(){t=M("svg"),n=M("circle"),r=M("line"),W(n,"cx","11"),W(n,"cy","11"),W(n,"r","8"),W(r,"x1","21"),W(r,"y1","21"),W(r,"x2","16.65"),W(r,"y2","16.65"),W(t,"xmlns","http://www.w3.org/2000/svg"),W(t,"width",e[0]),W(t,"height",e[0]),W(t,"fill","none"),W(t,"viewBox","0 0 24 24"),W(t,"stroke","currentColor"),W(t,"stroke-width",e[1]),W(t,"stroke-linecap","round"),W(t,"stroke-linejoin","round"),W(t,"class",i="feather feather-search "+e[2])},m(e,i){D(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&W(t,"width",e[0]),1&n&&W(t,"height",e[0]),2&n&&W(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&W(t,"class",i)},i:$,o:$,d(e){e&&x(t)}}}function xt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class kt extends Re{constructor(e){super(),Te(this,e,xt,Dt,b,{size:0,strokeWidth:1,class:2})}}const{document:Ot}=_e;function Mt(e){e[53]=e[54].items}function Pt(e,t,n){const r=e.slice();return r[55]=t[n],r[57]=n,r}function Bt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Lt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Ft(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Vt(e){let t,n,r,i,o,s;Mt(e);let a=e[5]?.length&&Ut(e),l=e[53]?.length&&Ht(e),c=e[5]?.length&&qt(e);return{c(){a&&a.c(),t=B(),n=O("div"),r=O("table"),l&&l.c(),i=B(),o=O("tbody"),c&&c.c(),W(r,"striped",""),W(r,"class","svelte-47aais"),W(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),D(e,t,d),D(e,n,d),R(n,r),l&&l.m(r,null),R(r,i),R(r,o),c&&c.m(o,null),s=!0},p(e,n){Mt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&ye(a,1)):(a=Ut(e),a.c(),ye(a,1),a.m(t.parentNode,t)):a&&(ge(),ve(a,1,1,()=>{a=null}),we()),e[53]?.length?l?l.p(e,n):(l=Ht(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&ye(c,1)):(c=qt(e),c.c(),ye(c,1),c.m(o,null)):c&&(ge(),ve(c,1,1,()=>{c=null}),we())},i(e){s||(ye(a),ye(c),s=!0)},o(e){ve(a),ve(c),s=!1},d(e){a&&a.d(e),e&&x(t),e&&x(n),l&&l.d(),c&&c.d()}}}function Ut(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&Wt(e);function h(t){e[34](t)}let m={id:e[11]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),te.push(()=>Ae(i,"value",h)),i.$on("input",e[15]),l=new rt({props:{size:"18"}}),{c(){f&&f.c(),t=B(),n=O("div"),r=P("Suchen: "),be(i.$$.fragment),s=B(),a=O("span"),be(l.$$.fragment),W(a,"class","feather pointer svelte-47aais"),j(n,"margin-bottom","1em"),j(n,"position","relative")},m(o,h){f&&f.m(o,h),D(o,t,h),D(o,n,h),R(n,r),Se(i,n,null),R(n,s),R(n,a),Se(l,a,null),c=!0,d||(u=F(a,"click",e[17]),d=!0)},p(e,n){e[6]?f?64&n[0]&&ye(f,1):(f=Wt(e),f.c(),ye(f,1),f.m(t.parentNode,t)):f&&(ge(),ve(f,1,1,()=>{f=null}),we());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],ce(()=>o=!1)),i.$set(r)},i(e){c||(ye(f),ye(i.$$.fragment,e),ye(l.$$.fragment,e),c=!0)},o(e){ve(f),ve(i.$$.fragment,e),ve(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&x(t),e&&x(n),Ne(i),Ne(l),d=!1,u()}}}function Wt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Ht(e){let t,n,r,i=e[4]&&e[0]&&zt(),o=e[53],s=[];for(let t=0;t<o.length;t+=1)s[t]=jt(Lt(e,o,t));return{c(){t=O("thead"),n=O("tr"),i&&i.c(),r=B();for(let e=0;e<s.length;e+=1)s[e].c();W(n,"class","svelte-47aais"),W(t,"class","svelte-47aais")},m(e,o){D(e,t,o),R(t,n),i&&i.m(n,null),R(n,r);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(e[4]&&e[0]?i||(i=zt(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),16388&t[0]){let r;for(o=e[53],r=0;r<o.length;r+=1){const i=Lt(e,o,r);s[r]?s[r].p(i,t):(s[r]=jt(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&x(t),i&&i.d(),k(s,e)}}}function zt(e){let t;return{c(){t=O("th"),W(t,"class","svelte-47aais")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function jt(e){let t,n,r=e[58]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-47aais")},m(e,r){D(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[58]?.designation+"")&&H(n,r)},d(e){e&&x(t)}}}function qt(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[55].index||e[55]?._id;for(let t=0;t<o.length;t+=1){let n=Pt(e,o,t),a=s(n);i.set(a,r[t]=Zt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);D(e,t,i),n=!0},p(e,n){356415&n[0]&&(o=e[5],ge(),r=Ee(r,n,s,1,e,o,i,t.parentNode,Ce,Zt,t,Pt),we())},i(e){if(!n){for(let e=0;e<o.length;e+=1)ye(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ve(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&x(t)}}}function Gt(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Xt(e),l=e[53],c=[];for(let t=0;t<l.length;t+=1)c[t]=Yt(Bt(e,l,t));return{c(){t=O("tr"),a&&a.c(),n=B();for(let e=0;e<c.length;e+=1)c[e].c();r=B(),W(t,"class","pointer svelte-47aais"),q(t,"active",e[55]._id===e[1]),q(t,"blocked",!!e[55].blocked),q(t,"undeliverable",!!e[55].undeliverable)},m(l,d){D(l,t,d),a&&a.m(t,null),R(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);R(t,r),i=!0,o||(s=F(t,"click",U(function(){A(e[13](e[55],e[57]))&&e[13](e[55],e[57]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&ye(a,1)):(a=Xt(e),a.c(),ye(a,1),a.m(t,n)):a&&(ge(),ve(a,1,1,()=>{a=null}),we()),20516&o[0]){let n;for(l=e[53],n=0;n<l.length;n+=1){const i=Bt(e,l,n);c[n]?c[n].p(i,o):(c[n]=Yt(i),c[n].c(),c[n].m(t,r))}for(;n<c.length;n+=1)c[n].d(1);c.length=l.length}34&o[0]&&q(t,"active",e[55]._id===e[1]),32&o[0]&&q(t,"blocked",!!e[55].blocked),32&o[0]&&q(t,"undeliverable",!!e[55].undeliverable)},i(e){i||(ye(a),i=!0)},o(e){ve(a),i=!1},d(e){e&&x(t),a&&a.d(),k(c,e),o=!1,s()}}}function Xt(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"class","editRow svelte-47aais"),j(t,"color","#326173")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",U(function(){A(e[18](e[55]))&&e[18](e[55]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Yt(e){let t,n,r,i=e[12](e[55],e[58])+"";return{c(){t=O("td"),n=P(i),W(t,"class",r=N(e[58].type)+" svelte-47aais")},m(e,r){D(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[12](e[55],e[58])+"")&&H(n,i),4&o[0]&&r!==(r=N(e[58].type)+" svelte-47aais")&&W(t,"class",r)},d(e){e&&x(t)}}}function Zt(e,t){let n,r,i,o=t[16](t[55],t[53],t[3]),s=o&&Gt(t);return{key:e,first:null,c(){n=L(),s&&s.c(),r=L(),this.first=n},m(e,t){D(e,n,t),s&&s.m(e,t),D(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[16](t[55],t[53],t[3])),o?s?(s.p(t,n),44&n[0]&&ye(s,1)):(s=Gt(t),s.c(),ye(s,1),s.m(r.parentNode,r)):s&&(ge(),ve(s,1,1,()=>{s=null}),we())},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(n),s&&s.d(e),e&&x(r)}}}function Kt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Qt(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Kt,then:Vt,catch:Ft,value:54,blocks:[,,,]};return Ie(n=e[2]&&e[14](),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[14]())&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}const Jt=e("getDisplayItems",async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function en(e,o,s){let a,l,d;S(e,i,e=>s(40,l=e));let f=JSON.parse(n.getItem("Locale")).id;const h=Q(),{Loading:p,TextField:g}=c,{currentTasks:y,loggedIn:v}=u;S(e,y,e=>s(39,a=e)),S(e,v,e=>s(41,d=e));let I,$,_,C,E,{inputList:A}=o,{eventId:b}=o,{prevEventId:N}=o,{record:T}=o,{className:R}=o,{rowId:D}=o,{filterForReady:x=!1}=o,{filter:k}=o,{query:O}=o,{refStatus:M}=o,{showEdit:P=!1}=o,{praefix:B=""}=o,{selectionFields:L=!1}=o,{deList:F}=o,{stopAggregation:V=!1}=o,{shouldBlock:U}=o,{inputSearch:W=""}=o,H=!0,z=W,j=R+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=!1,G=!0;const X=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(f,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?w(n):m(e[`_${t.name}`]||n||"")},Y=t.getSchemaByClass(R),K=async(e,n)=>{if(!e)return[];if(k){let n=k;const r=k.startsWith("!");r&&(n=k.replace("!",""));const i=k.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=k.replace("$","");const[r,i]=n.split(".");if(T[i]){const n=await t.getSectionView(r,{[i]:T[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(M&&!O)return s(19,M=[].concat(M)),e.filter(e=>!!M.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(N){const n=await t.getEvent(N);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===R)return"Information"===n.state.task?e.filter(e=>"Closed"!==e._task.status):e.filter(e=>"Ready"===e._task.status)}return e.filter(e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status)},J=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(f,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t},ee=async e=>{let n,r=0;G=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await Y;for(;r++<200&&!V&&!(n=await te(e,o.id));)await i(500);s(6,q=!1),V&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=J($.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),G=!0,document.getElementById(j)?.focus()},100))},te=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ne=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(B),c=l&&await up(s,l);if(!c)return e;const d=c[a];return d?.length?d.map(n=>{let r=e?.find(e=>e._id===n[t])||{};r={...r};for(const e in r)n[e]&&(r[e]=n[e]);for(const e in n)n[e]&&(r[e]=n[e]);return cp(o+r._id.toString(),r),r}):e};Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(j)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await Y;e.eventId===t.id&&(fp(t.class,e.eventId),s(2,H=!s(2,H=!1)))});return e.$$set=e=>{"inputList"in e&&s(21,A=e.inputList),"eventId"in e&&s(22,b=e.eventId),"prevEventId"in e&&s(23,N=e.prevEventId),"record"in e&&s(24,T=e.record),"className"in e&&s(25,R=e.className),"rowId"in e&&s(1,D=e.rowId),"filterForReady"in e&&s(26,x=e.filterForReady),"filter"in e&&s(27,k=e.filter),"query"in e&&s(28,O=e.query),"refStatus"in e&&s(19,M=e.refStatus),"showEdit"in e&&s(0,P=e.showEdit),"praefix"in e&&s(29,B=e.praefix),"selectionFields"in e&&s(30,L=e.selectionFields),"deList"in e&&s(31,F=e.deList),"stopAggregation"in e&&s(20,V=e.stopAggregation),"shouldBlock"in e&&s(32,U=e.shouldBlock),"inputSearch"in e&&s(33,W=e.inputSearch)},[P,D,H,z,I,_,q,p,g,y,v,j,X,(e,t)=>n=>{s(20,V=!0);const r=G?e:C[t];h("choose",{row:r})},async()=>{$=await Y,s(4,I=(e=>!a?.length||!!a.find(t=>t===e))($.id)),O&&s(5,_=C=await t.getTasksFiltered($.class,O)),_||s(5,_=C=J($.displaySort,await A||await ap($.class,$.id))),500!==_?.length||O||(s(6,q=!0),await t.getTasksList($.id,!1,!0).then(({aggregationId:e})=>ee(e)));let e,n=!1,r="";const i=L&&L?.find(e=>$.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(B);if(o){const[a,l]=i.refClass.split(":");$.class===a&&s(5,_=await ne(_,a,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],o,a,"quantity")}s(0,P&&=!i),!i&&(k||x||M)&&s(5,_=await K(_,$)),E=$.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>$.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:c}=$;let u=await Jt(c,$,_);if(!P&&n?(u=u.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),s(5,_=_.map((t,n)=>{const r=e.find(e=>e._id===t._id);return r&&(t.ist=r.quantity.$numberDecimal),t.index=n,t})),e.map(e=>{if(!_.find(t=>t._id===e._id)){const t=C.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),_.push(t)}}),h("init",_)):F&&s(5,_=_.filter(e=>!F.find(t=>t?._id===e._id))),U&&s(5,_=_.filter(e=>!e[U])),E){const e={businessEmail:d.user},n=await t.getSectionView("employee",e);s(5,_=n?.length?_.filter(e=>e.employee===n[0]._id):[])}return{items:u}},({detail:{value:e}})=>{s(3,z=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=X(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,z="")},async e=>{let t=e._task;t||(t=await lp(R,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},M,V,A,b,N,T,R,x,k,O,B,L,F,U,W,function(e){z=e,s(3,z)}]}class tn extends Re{constructor(e){var t;super(),Ot.getElementById("svelte-47aais-style")||((t=O("style")).id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",R(Ot.head,t)),Te(this,e,en,Qt,b,{inputList:21,eventId:22,prevEventId:23,record:24,className:25,rowId:1,filterForReady:26,filter:27,query:28,refStatus:19,showEdit:0,praefix:29,selectionFields:30,deList:31,stopAggregation:20,shouldBlock:32,inputSearch:33},[-1,-1,-1])}}function nn(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function rn(e){let t,n,r=e[45]&&on(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&ye(r,1)):(r=on(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function on(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[pn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1048577&n[0]&&(r.title=e[20]?"Auswahl":e[0]),262144&n[0]&&(r.class="eList "+(e[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function sn(e){let t,n;return t=new yp({props:{schema:e[2],recID:e[1],readonly:e[19]}}),t.$on("choose",function(){A(e[34](e[45]))&&e[34](e[45]).apply(this,arguments)}),t.$on("back",e[31]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(n,r){e=n;const i={};4&r[0]&&(i.schema=e[2]),2&r[0]&&(i.recID=e[1]),524288&r[0]&&(i.readonly=e[19]),t.$set(i)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function an(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[cn,ln],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new tn({props:{inputSearch:e[15],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[14],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],praefix:e[9],selectionFields:e[10],rowId:e[1],shouldBlock:e[16],deList:e[12],stopAggregation:e[24],showEdit:e[11]}}),s.$on("edit",e[35]),s.$on("choose",e[38]),s.$on("init",e[36]),{c(){be(t.$$.fragment),n=B(),i.c(),o=B(),be(s.$$.fragment)},m(e,i){Se(t,e,i),D(e,n,i),c[r].m(e,i),D(e,o,i),Se(s,e,i),a=!0},p(e,n){const a={};1048576&n[0]&&(a.text=e[20]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):(ge(),ve(c[u],1,1,()=>{c[u]=null}),we(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),ye(i,1),i.m(o.parentNode,o));const f={};32768&n[0]&&(f.inputSearch=e[15]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),16384&n[0]&&(f.prevEventId=e[14]),32&n[0]&&(f.filterForReady=e[5]),64&n[0]&&(f.filter=e[6]),128&n[0]&&(f.query=e[7]),256&n[0]&&(f.refStatus=e[8]),512&n[0]&&(f.praefix=e[9]),1024&n[0]&&(f.selectionFields=e[10]),2&n[0]&&(f.rowId=e[1]),65536&n[0]&&(f.shouldBlock=e[16]),4096&n[0]&&(f.deList=e[12]),16777216&n[0]&&(f.stopAggregation=e[24]),2048&n[0]&&(f.showEdit=e[11]),s.$set(f)},i(e){a||(ye(t.$$.fragment,e),ye(i),ye(s.$$.fragment,e),a=!0)},o(e){ve(t.$$.fragment,e),ve(i),ve(s.$$.fragment,e),a=!1},d(e){Ne(t,e),e&&x(n),c[r].d(e),e&&x(o),Ne(s,e)}}}function ln(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[dn]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&un(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),W(t,"class","form--buttons svelte-jb5mrh")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[29]&&e[13]?o?(o.p(e,r),8192&r[0]&&ye(o,1)):(o=un(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function cn(e){let t,n,r,i,o,s,a=e[23]&&hn(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[mn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=B(),n=O("div"),be(r.$$.fragment),i=B(),be(o.$$.fragment),W(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),D(e,t,l),D(e,n,l),Se(r,n,null),D(e,i,l),Se(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&ye(a,1)):(a=hn(e),a.c(),ye(a,1),a.m(t.parentNode,t)):a&&(ge(),ve(a,1,1,()=>{a=null}),we());const i={};32768&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};131072&n[0]&&(s.text="Liste aus "+e[17]),o.$set(s)},i(e){s||(ye(a),ye(r.$$.fragment,e),ye(o.$$.fragment,e),s=!0)},o(e){ve(a),ve(r.$$.fragment,e),ve(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&x(t),e&&x(n),Ne(r),e&&x(i),Ne(o,e)}}}function dn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function un(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[fn]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function fn(e){let t;return{c(){t=P("Neu")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function hn(e){let t,n;return t=new Su({props:{item:e[21],record:{_id:"",[e[21].name]:""},noForm:"true",classId:"sel_"+e[21].name,eventId:e[22],required:!1,hidden:!1,readonly:!1,deList:e[23]}}),t.$on("notify",e[37]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.item=e[21]),2097152&n[0]&&(r.record={_id:"",[e[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+e[21].name),4194304&n[0]&&(r.eventId=e[22]),8388608&n[0]&&(r.deList=e[23]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function mn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function pn(e){let t,n,r,i;const o=[an,sn],s=[];function a(e,t){return e[45].length&&!e[18]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function gn(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function wn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:gn,then:rn,catch:nn,value:45,blocks:[,,,]};return Ie(n=e[30](e[4]),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,16&r[0]&&n!==(n=e[30](e[4]))&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}function yn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=Q(),{currentTasks:d}=u;S(e,d,e=>r(41,i=e));let{title:f}=n,{schema:h}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:I}=n,{praefix:$=""}=n,{selectionFields:_=!1}=n,{showEdit:C=!0}=n,{deList:E}=n,{newAllowed:A=!0}=n,{prevEventId:b}=n,{inputSearch:N}=n,{shouldBlock:T}=n,R=h.id;h.class;let D,x,k,O,M,P,B,L="",F=!1,V=!1;f??=h.identity.designation;const U=!i?.length||i.find(e=>e===R);return e.$$set=e=>{"title"in e&&r(0,f=e.title),"schema"in e&&r(2,h=e.schema),"record"in e&&r(3,m=e.record),"recID"in e&&r(1,p=e.recID),"isOpening"in e&&r(4,g=e.isOpening),"filterForReady"in e&&r(5,w=e.filterForReady),"filter"in e&&r(6,y=e.filter),"query"in e&&r(7,v=e.query),"refStatus"in e&&r(8,I=e.refStatus),"praefix"in e&&r(9,$=e.praefix),"selectionFields"in e&&r(10,_=e.selectionFields),"showEdit"in e&&r(11,C=e.showEdit),"deList"in e&&r(12,E=e.deList),"newAllowed"in e&&r(13,A=e.newAllowed),"prevEventId"in e&&r(14,b=e.prevEventId),"inputSearch"in e&&r(15,N=e.inputSearch),"shouldBlock"in e&&r(16,T=e.shouldBlock)},[f,p,h,m,g,w,y,v,I,$,_,C,E,A,b,N,T,L,F,D,k,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await ap(h.class,h.id);if(x=_&&_?.find(e=>h.class===e.refClass.split(":")[0]),r(20,k=x?.value?.get&&x.value.get($)),k){O=x.refClass;const[e,n]=O.split(":"),[i]=n.split(".");r(21,M=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(M.refClass);r(22,P=o.id),r(17,L=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(18,F=!1),p||l("back"),C||l("back")},()=>{r(24,V=!0),r(18,F=!1),l("back")},()=>{r(24,V=!0),r(1,p=!1),r(19,D=!1),r(18,F=!0)},e=>({detail:{row:e}})=>{let t=h.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=h.list?.find(e=>e.name===n)?.item.find(e=>e.name===r);if(i){e[`${n}_${r}`]=e[n][r]}}),l("choose",{row:e})},({detail:e})=>{r(19,D=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(18,F=!0)},({detail:e})=>{k&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){J(e,t)}]}class vn extends Re{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=O("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",R(document.head,t)),Te(this,e,yn,wn,b,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:In}=_e;function $n(e){e[28]=e[30].list,e[29]=e[30].items}function _n(e,t,n){const r=e.slice();return r[31]=t[n],r}function Cn(e,t,n){const r=e.slice();return r[34]=t[n],r}function En(e,t,n){const r=e.slice();return r[34]=t[n],r}function An(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function bn(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[25](t)}$n(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Sn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let I={id:e[8]};void 0!==e[0]&&(I.value=e[0]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[29]?.length&&function(e){let t,n,r,i,o=e[29],s=[];for(let t=0;t<o.length;t+=1)s[t]=Nn(En(e,o,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),i=B();for(let e=0;e<s.length;e+=1)s[e].c();W(r,"class","svelte-14hcfjl"),W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,o){D(e,t,o),R(t,n),R(n,r),R(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(o=e[29],r=0;r<o.length;r+=1){const i=En(e,o,r);s[r]?s[r].p(i,t):(s[r]=Nn(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&x(t),k(s,e)}}}(e),_=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=Dn(_n(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(44547&n[0]){let s;for(r=e[28],s=0;s<r.length;s+=1){const o=_n(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Dn(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){$n(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&1&t[0]&&(a=!0,i.value=e[0],ce(()=>a=!1)),s.$set(i),e[29]?.length&&$.p(e,t),e[28]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),ye(_),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),ve(_),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function Sn(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Nn(e){let t,n,r=e[34]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Tn(e){let t,n,r,i,o,s,a,l;r=new st({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=Rn(Cn(e,c,t));return{c(){t=O("tr"),n=O("td"),be(r.$$.fragment),i=B();for(let e=0;e<d.length;e+=1)d[e].c();o=B(),W(n,"class","editRow svelte-14hcfjl"),W(t,"class","pointer svelte-14hcfjl"),q(t,"active",e[31]._id===e[1])},m(c,u){D(c,t,u),R(t,n),Se(r,n,null),R(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);R(t,o),s=!0,a||(l=F(n,"click",e[15](e[31])),a=!0)},p(n,r){if(e=n,3584&r[0]){let n;for(c=e[29],n=0;n<c.length;n+=1){const i=Cn(e,c,n);d[n]?d[n].p(i,r):(d[n]=Rn(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2050&r[0]&&q(t,"active",e[31]._id===e[1])},i(e){s||(ye(r.$$.fragment,e),s=!0)},o(e){ve(r.$$.fragment,e),s=!1},d(e){e&&x(t),Ne(r),k(d,e),a=!1,l()}}}function Rn(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function Dn(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&Tn(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){1&n[0]&&(r=e[13](e[31],e[29],e[0])),r?i?(i.p(e,n),1&n[0]&&ye(i,1)):(i=Tn(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function xn(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function kn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:xn,then:bn,catch:An,value:30,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function On(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[kn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Mn(e,n,i){const o=Q(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{classId:h}=n,{className:p}=n,{rowId:g}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:$}=n,{multiValues:_}=n,{searchValue:C=""}=n,E=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(E)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&fp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,f=e.item),"classId"in e&&i(17,h=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(1,g=e.rowId),"viewName"in e&&i(19,y=e.viewName),"viewValue"in e&&i(20,v=e.viewValue),"recordId"in e&&i(21,I=e.recordId),"filter"in e&&i(22,$=e.filter),"multiValues"in e&&i(23,_=e.multiValues),"searchValue"in e&&i(0,C=e.searchValue)},[C,g,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(f.lookup){let r,i,o;if("string"==typeof f.lookup){if(r="."+h+"#"+f.lookup,i=document.querySelector(r),o=i?.value||I,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await ap(f.name,e.id)}else if(o&&24===o.toString().length){const e=await up(f.lookup,o);if(e&&e[f.name]&&e[f.name].length){const r=e[f.name]?.map(e=>e[f.name]);r?.length&&(n=await t.getSectionView(f.name,{_id:{$in:r}},!0)),n?.length||(n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0))}else n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0)}}else{const{refItem:e,refList:s}=f.lookup,[a,l]=e.split(".");if(r="."+h+"#"+a,i=document.querySelector(r),o=i?.value||I,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0)}}}}else{const r="."+h+"#"+y.split(":")[0],i=document.querySelector(r);let o={[y]:i?.value||I};if(f.refItem){const e="."+h+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};o={...o,...e}}}catch{}}o[y]&&(n=await t.getSectionView(e.class,o,!0)),$&&(n=n.filter(e=>e._id!=$))}const r=e.display;return{list:n,items:await Jt(r,e,n)}},({detail:{value:e}})=>{i(0,C=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(A(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(0,C="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},f,h,p,y,v,I,$,_,()=>o("back"),function(e){C=e,i(0,C)}]}class Pn extends Re{constructor(e){var t;super(),In.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(In.head,t)),Te(this,e,Mn,On,b,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:Bn}=_e;function Ln(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Fn(e){let t,n,r=e[83]&&function(e){let t,n,r,i,o,a,l,c,d,u,f,h,m,p,g,w,y,v,I,$;function _(t){e[63](t)}function C(t){e[64](t)}let E={class:"full-width",id:e[34],name:e[34],rows:"1",required:e[2],disabled:e[3]||e[36],placeholder:e[36]?"":e[37],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[1]&&(E.value=e[1]);void 0!==e[27]&&(E.overwrite=e[27]);n=new s({props:E}),te.push(()=>Ae(n,"value",_)),te.push(()=>Ae(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[Wn,Un,Vn],b=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=b[a]=A[a](e));let T=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&qn(e);function k(t){e[65](t)}let M={class:"tModal",noClickaway:!0,$$slots:{default:[Zn]},$$scope:{ctx:e}};void 0!==e[19]&&(M.open=e[19]);m=new e[30]({props:M}),te.push(()=>Ae(m,"open",k));let P=e[20]&&Kn(e),V=e[24]&&er(e);return{c(){t=O("div"),be(n.$$.fragment),o=B(),l&&l.c(),c=B(),d=O("input"),f=B(),T&&T.c(),h=B(),be(m.$$.fragment),g=B(),P&&P.c(),w=B(),V&&V.c(),y=L(),W(d,"class",u=N(e[9]||e[10])+" svelte-10ggg6v"),W(d,"id",e[5]),W(d,"name",e[5]),d.value=e[0],d.hidden=!0,j(t,"position","relative")},m(r,i){D(r,t,i),Se(n,t,null),R(t,o),~a&&b[a].m(t,null),R(t,c),R(t,d),R(t,f),T&&T.m(t,null),D(r,h,i),Se(m,r,i),D(r,g,i),P&&P.m(r,i),D(r,w,i),V&&V.m(r,i),D(r,y,i),v=!0,I||($=F(t,"keydown",e[41]),I=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]||e[36]),!r&&2&o[0]&&(r=!0,s.value=e[1],ce(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],ce(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&b[a].p(e,o):(l&&(ge(),ve(b[f],1,1,()=>{b[f]=null}),we()),~a?(l=b[a],l?l.p(e,o):(l=b[a]=A[a](e),l.c()),ye(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=N(e[9]||e[10])+" svelte-10ggg6v"))&&W(d,"class",u),(!v||32&o[0])&&W(d,"id",e[5]),(!v||32&o[0])&&W(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?T&&(ge(),ve(T,1,1,()=>{T=null}),we()):T?(T.p(e,o),196617&o[0]&&ye(T,1)):(T=qn(e),T.c(),ye(T,1),T.m(t,null));const h={};344784337&o[0]|4194304&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],ce(()=>p=!1)),m.$set(h),e[20]?P?(P.p(e,o),1048576&o[0]&&ye(P,1)):(P=Kn(e),P.c(),ye(P,1),P.m(w.parentNode,w)):P&&(ge(),ve(P,1,1,()=>{P=null}),we()),e[24]?V?(V.p(e,o),16777216&o[0]&&ye(V,1)):(V=er(e),V.c(),ye(V,1),V.m(y.parentNode,y)):V&&(ge(),ve(V,1,1,()=>{V=null}),we())},i(e){v||(ye(n.$$.fragment,e),ye(l),ye(T),ye(m.$$.fragment,e),ye(P),ye(V),v=!0)},o(e){ve(n.$$.fragment,e),ve(l),ve(T),ve(m.$$.fragment,e),ve(P),ve(V),v=!1},d(e){e&&x(t),Ne(n),~a&&b[a].d(),T&&T.d(),e&&x(h),Ne(m,e),e&&x(g),P&&P.d(e),e&&x(w),V&&V.d(e),e&&x(y),I=!1,$()}}}(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,t){e[83]&&r.p(e,t)},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Vn(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[48]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Un(e){let t,n,r,i,o;return n=new kt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=[F(t,"click",e[40](!0)),F(t,"choose",e[44])],i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,E(o)}}}function Wn(e){let t,n,r,i;const o=[jn,zn,Hn],s=[];function a(e,t){return e[0]?0:!e[3]&&e[12]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Hn(e){let t,n,r;return n=new St({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather3 svelte-10ggg6v")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function zn(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[50]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function jn(e){let t,n,r,i,o;return n=new st({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[48]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function qn(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[47]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Gn(e){let t,n,r,i;const o=[Yn,Xn],s=[];function a(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Xn(e){let t,n;return t=new vn({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[35],query:e[38](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[26],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[28],inputSearch:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.title=e[6].designation),8388608&n[0]&&(r.newAllowed=e[23]),2048&n[0]&&(r.prevEventId=e[11]),262144&n[0]&&(r.schema=e[18]),128&n[0]&&(r.record=e[7]),1&n[0]&&(r.recID=e[0]),524288&n[0]&&(r.isOpening=e[19]),67108864&n[0]&&(r.filterForReady=e[26]),64&n[0]&&(r.refStatus=e[6].refStatus),16384&n[0]&&(r.selectionFields=e[14]),32768&n[0]&&(r.deList=e[15]),8192&n[0]&&(r.praefix=e[13]),268435456&n[0]&&(r.shouldBlock=e[28]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Yn(e){let t,n;return t=new Pn({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8],searchValue:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.item=e[6]),262144&n[0]&&(r.className=e[18].class),1024&n[0]&&(r.classId=e[10]),1&n[0]&&(r.rowId=e[0]),4096&n[0]&&(r.recordId=e[12]),16&n[0]&&(r.viewName=e[4]),256&n[0]&&(r.multiValues=e[8]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Zn(e){let t,n,r=e[19]&&Gn(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&ye(r,1)):(r=Gn(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Kn(e){let t,n,r;function i(t){e[66](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Jn]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[30]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function Qn(e){let t,n;return t=new yp({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),1&n[0]&&(r.recID=e[0]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Jn(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Qn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function er(e){let t,n,r;function i(t){e[67](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[nr]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function tr(e){let t,n;return t=new yp({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),33554432&n[0]&&(r.dialogAttr=e[25]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function nr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[tr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function rr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function ir(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:rr,then:Fn,catch:Ln,value:83,blocks:[,,,]};return Ie(e[39](),r),{c(){t=L(),r.block.c()},m(e,i){D(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){$e(r,e=t,n)},i(e){n||(ye(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ve(r.blocks[e])}n=!1},d(e){e&&x(t),r.block.d(e),r.token=null,r=null}}}function or(e,n,r){let s,a,l,d,f;S(e,i,e=>r(62,s=e)),S(e,o,e=>r(73,f=e));const h=Q(),{Dialog:m,Modal:p}=c,{currentTasks:g,environment:w,loggedIn:v}=u;S(e,g,e=>r(70,a=e)),S(e,w,e=>r(72,d=e)),S(e,v,e=>r(71,l=e));let{id:I}=n,{item:$}=n,{record:_}=n,{fullRecord:C}=n,{value:E=""}=n,{multiValues:A}=n,{desc:b=""}=n,{noForm:N=!1}=n,{classId:T}=n,{eventId:R}=n,{recordId:D}=n,{withRefValue:x=!1}=n,{refValue:k=""}=n,{shortEdit:O}=n,{required:M}=n,{disabled:P}=n,{readonly:B}=n,{praefix:L}=n,{selectionFields:F}=n,{formnovalidate:V}=n,{selection:U}=n,{deList:W}=n,{isTemplate:H}=n,{noList:z=!1}=n,{multi:j=!1}=n,{initFinished:q}=n,{listName:G=""}=n;const X="comment_"+I,Y=$.filter,Z=$.properties?.startDialog;let K,J,ee,te,ne,re,ie,oe,se=!1,ae=!0,le=!1,ce=!0,de=!0,ue=!1,fe="";!U&&$.selection&&1===$.selection.split(":").length&&(U=$.selection);const he=B||P||$.lookup||U&&!$.constraint?"":"Suchbegriff ⏎",me=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},pe=()=>{$.refItem&&$.refItem.startsWith("owner")&&(r(52,k=d.owner[$.refClass]),k||r(52,k=me($.refItem,d)),k&&(r(51,x=!0),h("change",{value:k})))},ge=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{h("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},we=async e=>{const n=()=>{r(19,se=!0)};if(9==e.which)return;if(E)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),$.lookup)return n();const i=te.items.find(e=>e.properties?.search);if(!i)return n();const o=e.srcElement.value,{name:s,checkOn:a,refClass:l,properties:c}=i;let{search:d}=c;!0===d&&(d={}),"number"==typeof d&&(d={min:d});const{min:u=3,start:f=!1,end:h=!1}=d;if(o.length<u)return n();const m=(f?"^":"")+o+(h?"$":"");let p={[s]:{$regex:m,$options:"i"}};a&&(p=[{$lookup:{from:l,localField:s,foreignField:"_id",as:l}},{$match:{[l+"."+a]:{$regex:m,$options:"i"}}}]);const g=await t.getSectionView(te.class,p);1!==g?.length?n():r(0,E=g[0]._id)},ye=e=>{e&&(r(61,fe=r(1,b=y(te,e))),h("setRefDesc",b.split(" •")[0]),h("change",{value:E,description:b}),h("task",{row:e,eventId:te.id}))},ve=()=>{r(19,se=!1),r(20,J=!1)},Ie=()=>{r(24,le=!1)};return e.$$set=e=>{"id"in e&&r(5,I=e.id),"item"in e&&r(6,$=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,E=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,b=e.desc),"noForm"in e&&r(9,N=e.noForm),"classId"in e&&r(10,T=e.classId),"eventId"in e&&r(11,R=e.eventId),"recordId"in e&&r(12,D=e.recordId),"withRefValue"in e&&r(51,x=e.withRefValue),"refValue"in e&&r(52,k=e.refValue),"shortEdit"in e&&r(56,O=e.shortEdit),"required"in e&&r(2,M=e.required),"disabled"in e&&r(3,P=e.disabled),"readonly"in e&&r(53,B=e.readonly),"praefix"in e&&r(13,L=e.praefix),"selectionFields"in e&&r(14,F=e.selectionFields),"formnovalidate"in e&&r(57,V=e.formnovalidate),"selection"in e&&r(4,U=e.selection),"deList"in e&&r(15,W=e.deList),"isTemplate"in e&&r(16,H=e.isTemplate),"noList"in e&&r(58,z=e.noList),"multi"in e&&r(17,j=e.multi),"initFinished"in e&&r(54,q=e.initFinished),"listName"in e&&r(59,G=e.listName)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),4160&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(53,B||=D&&$.asInput),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&x&&r(0,E=k),3&e.$$.dirty[0]|1073741824&e.$$.dirty[1]&&!b&&E&&fe&&r(1,b=fe),399425&e.$$.dirty[0]|411041792&e.$$.dirty[1]&&E&&te){let e=!1;if(!Array.isArray(E)){if(D||$.asInput||$.upate||!1!==$.refItem||!0===j||!1===$.refItem&&q){const t="p$"+G+"$"+$.refClass+"$"+R,n=sp(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===E);t?ye(t):lp($.refClass,te.id,E,!!$.lookup||z).then(ye)}):e=!0}e&&lp($.refClass,te.id,E,!!$.lookup||z).then(ye),r(54,q=!0)}}if(65&e.$$.dirty[0]|536870912&e.$$.dirty[1]|1&e.$$.dirty[2]&&E&&ne&&$.name===ne.input?.at(0)&&ne.inputLookup?.length){const{domain:e}=ne.inputLookup[0]||{};"user"===e&&(s.some(e=>ne.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!E&&te&&ye({})},[E,b,M,P,U,I,$,C,A,N,T,R,D,L,F,W,H,j,te,se,J,ee,re,ae,le,ie,ce,de,ue,m,p,g,w,v,X,Y,Z,he,()=>{if(!$.query)return;const[e,t]=$.query.split(".");let n;return n=C[t]?[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:C[t]}}]:[{$match:{[e]:C[e]}}],$.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":$.refStatus}}])),n},async()=>{try{if(K=await t.getEvent(R),oe="report"===K.output.type,r(26,ce=!$.asInput),r(23,ae=K.output?.class[0].name!==$.refClass),r(18,te=await t.getSchemaByClass($.refClass)),te?.blocked)return h("initFail",!0),!1;if(oe||r(28,ue=((e,t)=>{let n=t.items.find(e=>!!e.properties?.blocking);if(!n)return!1;if(e.input?.class?.find(e=>e.name===t.class))return n.name;const r=e.output?.class.at(0)?.list||[];for(const e of r){const t=e.item.find(e=>e.name===$.name);if(t?.properties?.blocking)return n.name}return!1})(K,te)),r(22,re=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(60,ne=await t.getSchema(R)),R&&D&&E&&!P&&ne.input?.find(e=>e===$.refClass)&&r(3,P=!0),K.input?.class&&K.input.class[0]&&(K.input.class[0].name===$.refClass&&K.input.class[0].readonly&&r(3,P=!0),D&&K.input.class[0].name===$.refClass&&K.input.class[0].writeState)){(await t.getTaskByDocId(D,!0)).status===K.input.class[0].writeState&&r(3,P=r(53,B=!1))}if($.properties?.query?.lookup){const{domain:e,value:n}=$.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},o=await t.getSectionView($.refClass,i);if(o?.length){const[{_id:e}]=o;e&&(r(52,k=e),r(51,x=!0),h("change",{value:k}))}s.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else pe();if(!P&&!k&&$.filter&&(""===L||void 0===L)){const e=$.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly($.refClass,{[$.filter]:n});i&&(r(52,k=i._id),r(51,x=!0),h("change",{value:k}))}return r(21,ee=te.identity.designation),E||ge(te),!0}catch{return h("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!Z){if(!0===e&&r(19,se=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}($.lookup||U&&!$.constraint||E)&&r(19,se=!0)}},we,()=>{if(E)return"";r(1,b="");const e=document.querySelectorAll("#"+T+" #"+X)[0];return e?.value?e.value:""},async({detail:e})=>{if(e.className=te.class,r(0,E=e.row._id),""===L||void 0===L?h("saveDialog",{itemName:$.name,value:E,closeTask:$.properties?.closeTask}):h("listChange",e),$.properties?.closeTask&&K.output?.approval){const e=await t.getTaskByDocId(_._id),n=K.output.approval.flatMap(({refRole:e})=>e),r={eventId:R,eventDesignation:K.identity.designation,docId:_._id,role:n.filter(e=>s.find(t=>t===e)).join(", "),user:f.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}Ie()},({detail:e})=>{r(0,E=e.row._id),ve()},ve,Ie,()=>{(oe||re)&&(j?h("change",{value:E,delete:!0}):(r(0,E=""),r(1,b=""),r(27,de=!0),h("change",{value:E,description:b}),h("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id})))},async()=>{if(!E)return;let e=await lp($.refClass,te.id,E);e._task||(e={_task:await t.getTaskByDocId(E,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{E||b&&we({which:13,preventDefault:()=>{},srcElement:{value:b}})},async e=>{r(25,ie={});for(const e in Z){let n=Z[e],i="";if(n.startsWith("owner"))i=me(n,d);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await ap("",o.id);if(a?.length){a=a.sort((e,t)=>e[r]>t[r]?1:e[r]<t[r]?-1:0);const e=a.findIndex(e=>e._id===s);i=a[+e+1]._id||""}}else if(n.includes("|"))for(const e of n.split("|"))i||(i=_[e]);else i=_[n]||C&&C[n];r(25,ie[e]=i,ie)}r(24,le=!0)},x,k,B,q,_,O,V,z,G,ne,fe,s,function(e){b=e,r(1,b),r(0,E),r(61,fe),r(51,x),r(52,k)},function(e){de=e,r(27,de)},function(e){se=e,r(19,se)},function(e){J=e,r(20,J)},function(e){le=e,r(24,le)}]}class sr extends Re{constructor(e){var t;super(),Bn.getElementById("svelte-10ggg6v-style")||((t=O("style")).id="svelte-10ggg6v-style",t.textContent=".feather.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-10ggg6v{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.feather3.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:gray}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}.modal-overlay.tModal2 > .dialog{margin-top:0 !important}",R(Bn.head,t)),Te(this,e,or,ir,b,{id:5,item:6,record:55,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:51,refValue:52,shortEdit:56,required:2,disabled:3,readonly:53,praefix:13,selectionFields:14,formnovalidate:57,selection:4,deList:15,isTemplate:16,noList:58,multi:17,initFinished:54,listName:59},[-1,-1,-1])}}const{document:ar}=_e;function lr(e){e[45]=e[46].items}function cr(e,t,n){const r=e.slice();return r[47]=t[n],r[49]=n,r}function dr(e,t,n){const r=e.slice();return r[50]=t[n],r[52]=n,r}function ur(e,t,n){const r=e.slice();return r[50]=t[n],r}function fr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function hr(e){let t,n,r,i;lr(e);const o=[pr,mr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){lr(e);let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function mr(e){let t,n;return t=new yp({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.schema=e[4]),128&n[0]&&(r.recID=e[7]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function pr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v,I,$,_;n=new e[12]({props:{outline:!0,$$slots:{default:[gr]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let C=e[1]&&wr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[vr]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let E=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}(e);function A(t){e[34](t)}let b={id:e[13]};void 0!==e[3]&&(b.value=e[3]),d=new e[10]({props:b}),te.push(()=>Ae(d,"value",A)),d.$on("input",e[19]),m=new rt({props:{size:"18"}});let S=e[45]?.length&&Ir(e),N=e[5]?.length&&_r(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),C&&C.c(),i=B(),be(o.$$.fragment),s=B(),E&&E.c(),a=B(),l=O("div"),c=P("Suchen: "),be(d.$$.fragment),f=B(),h=O("span"),be(m.$$.fragment),p=B(),g=O("div"),w=O("table"),S&&S.c(),y=B(),v=O("tbody"),N&&N.c(),W(t,"class","form--buttons svelte-4visk8"),W(h,"class","feather pointer svelte-4visk8"),j(l,"margin-bottom","1em"),j(l,"position","relative"),W(w,"striped",""),W(w,"class","svelte-4visk8"),W(g,"class","eList svelte-4visk8")},m(u,A){D(u,t,A),Se(n,t,null),R(t,r),C&&C.m(t,null),R(t,i),Se(o,t,null),D(u,s,A),E&&E.m(u,A),D(u,a,A),D(u,l,A),R(l,c),Se(d,l,null),R(l,f),R(l,h),Se(m,h,null),D(u,p,A),D(u,g,A),R(g,w),S&&S.m(w,null),R(w,y),R(w,v),N&&N.m(v,null),I=!0,$||(_=F(h,"click",e[21]),$=!0)},p(e,r){const s={};16777216&r[1]&&(s.$$scope={dirty:r,ctx:e}),n.$set(s),e[1]?C?(C.p(e,r),2&r[0]&&ye(C,1)):(C=wr(e),C.c(),ye(C,1),C.m(t,i)):C&&(ge(),ve(C,1,1,()=>{C=null}),we());const a={};32&r[0]&&(a.disabled=!e[5].length),16777216&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],ce(()=>u=!1)),d.$set(l),e[45]?.length?S?(S.p(e,r),4&r[0]&&ye(S,1)):(S=Ir(e),S.c(),ye(S,1),S.m(w,y)):S&&(ge(),ve(S,1,1,()=>{S=null}),we()),e[5]?.length?N?(N.p(e,r),32&r[0]&&ye(N,1)):(N=_r(e),N.c(),ye(N,1),N.m(v,null)):N&&(ge(),ve(N,1,1,()=>{N=null}),we())},i(e){I||(ye(n.$$.fragment,e),ye(C),ye(o.$$.fragment,e),ye(E),ye(d.$$.fragment,e),ye(m.$$.fragment,e),ye(S),ye(N),I=!0)},o(e){ve(n.$$.fragment,e),ve(C),ve(o.$$.fragment,e),ve(E),ve(d.$$.fragment,e),ve(m.$$.fragment,e),ve(S),ve(N),I=!1},d(e){e&&x(t),Ne(n),C&&C.d(),Ne(o),e&&x(s),E&&E.d(e),e&&x(a),e&&x(l),Ne(d),Ne(m),e&&x(p),e&&x(g),S&&S.d(),N&&N.d(),$=!1,_()}}}function gr(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function wr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[yr]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16777216&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function yr(e){let t;return{c(){t=P("Neu")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function vr(e){let t;return{c(){t=P("Bestätigen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ir(e){let t,n,r,i,o,s,a,l;i=new Xe({props:{size:"20",style:"color: #326173;"}});let c=e[45],d=[];for(let t=0;t<c.length;t+=1)d[t]=$r(ur(e,c,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),be(i.$$.fragment),o=B();for(let e=0;e<d.length;e+=1)d[e].c();W(r,"class","svelte-4visk8"),W(n,"class","svelte-4visk8"),W(t,"class","svelte-4visk8")},m(c,u){D(c,t,u),R(t,n),R(n,r),Se(i,r,null),R(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=F(r,"click",function(){A(e[22](e[5]))&&e[22](e[5]).apply(this,arguments)}),a=!0)},p(t,r){if(e=t,262148&r[0]){let t;for(c=e[45],t=0;t<c.length;t+=1){const i=ur(e,c,t);d[t]?d[t].p(i,r):(d[t]=$r(i),d[t].c(),d[t].m(n,null))}for(;t<d.length;t+=1)d[t].d(1);d.length=c.length}},i(e){s||(ye(i.$$.fragment,e),s=!0)},o(e){ve(i.$$.fragment,e),s=!1},d(e){e&&x(t),Ne(i),k(d,e),a=!1,l()}}}function $r(e){let t,n,r=e[50]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-4visk8")},m(e,r){D(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[50]?.designation+"")&&H(n,r)},d(e){e&&x(t)}}}function _r(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[47]._id;for(let t=0;t<o.length;t+=1){let n=cr(e,o,t),a=s(n);i.set(a,r[t]=br(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);D(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],ge(),r=Ee(r,n,s,1,e,o,i,t.parentNode,Ce,br,t,cr),we())},i(e){if(!n){for(let e=0;e<o.length;e+=1)ye(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ve(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&x(t)}}}function Cr(e){let t,n,r,i,o=e[0],s=Er(e),a=e[45],l=[];for(let t=0;t<a.length;t+=1)l[t]=Ar(dr(e,a,t));return{c(){t=O("tr"),s.c(),n=B();for(let e=0;e<l.length;e+=1)l[e].c();r=B(),W(t,"class","svelte-4visk8"),q(t,"active",e[0].includes(e[47]._id))},m(e,o){D(e,t,o),s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);R(t,r),i=!0},p(e,i){if(1&i[0]&&b(o,o=e[0])?(ge(),ve(s,1,1,$),we(),s=Er(e),s.c(),ye(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=dr(e,a,n);l[n]?l[n].p(o,i):(l[n]=Ar(o),l[n].c(),l[n].m(t,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=a.length}33&i[0]&&q(t,"active",e[0].includes(e[47]._id))},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(t),s.d(e),k(l,e)}}}function Er(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[47]._id,checked:e[0].includes(e[47]._id),round:!0}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"title","Wählt den Wert aus"),W(t,"class","svelte-4visk8")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[47]._id),33&t[0]&&(r.checked=e[0].includes(e[47]._id)),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Ar(e){let t,n,r,i=e[16](e[47],e[50])+"";return{c(){t=O("td"),n=P(i),W(t,"class",r=N(e[50].type)+" svelte-4visk8")},m(e,r){D(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[47],e[50])+"")&&H(n,i),4&o[0]&&r!==(r=N(e[50].type)+" svelte-4visk8")&&W(t,"class",r)},d(e){e&&x(t)}}}function br(e,t){let n,r,i,o=t[20](t[47],t[45],t[3]),s=o&&Cr(t);return{key:e,first:null,c(){n=L(),s&&s.c(),r=L(),this.first=n},m(e,t){D(e,n,t),s&&s.m(e,t),D(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[47],t[45],t[3])),o?s?(s.p(t,n),44&n[0]&&ye(s,1)):(s=Cr(t),s.c(),ye(s,1),s.m(r.parentNode,r)):s&&(ge(),ve(s,1,1,()=>{s=null}),we())},i(e){i||(ye(s),i=!0)},o(e){ve(s),i=!1},d(e){e&&x(n),s&&s.d(e),e&&x(r)}}}function Sr(e){let t,n;return t=new e[9]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Nr(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Sr,then:hr,catch:fr,value:46,blocks:[,,,]};return Ie(n=e[2]&&e[18](),i),{c(){t=L(),i.block.c()},m(e,n){D(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[18]())&&Ie(n,i)||$e(i,e,r)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),i.block.d(e),i.token=null,i=null}}}function Tr(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=Q(),{Loading:l,TextField:d,Checkbox:u,Button:f}=c;let h,p,g,y,{inputList:v}=i,{selection:I}=i,{item:$}=i,{target:_}=i,{className:C}=i,{classId:E}=i,{recordId:A}=i,{stopAggregation:b=!1}=i,{shouldNew:S}=i,N=!0,T=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",R=!1;I||=[];let D=I;const x=C+_+"checkbox",k=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?w(n):m(e[`_${t.name}`]||n||"")},O=t.getSchemaByClass(C),M=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(s,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t};Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(T)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(fp(t.class,e.eventId),o(2,N=!o(2,N=!1)))});const P=()=>{o(6,R=!1)};return e.$$set=e=>{"inputList"in e&&o(26,v=e.inputList),"selection"in e&&o(0,I=e.selection),"item"in e&&o(27,$=e.item),"target"in e&&o(28,_=e.target),"className"in e&&o(29,C=e.className),"classId"in e&&o(30,E=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,b=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew)},[I,S,N,h,p,g,R,y,a,l,d,u,f,T,!1,x,k,()=>{const e=document.getElementsByName(x),t=Array.from(e).filter(e=>e.checked).map(e=>e.attributes.data.value);if(h){const e=D.filter(e=>!t.find(t=>t==e));o(0,I=t.concat(e)),D=[...I]}else o(0,I=t),D=[];a("choose",{list:I})},async()=>{o(4,p=await O),g||o(5,g=M(p.displaySort,await v||await ap(p.class,p.id)));const{display:e}=p;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items})(e,p,g);return{items:n}},({detail:{value:e}})=>{o(3,h=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=k(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,h="")},e=>()=>{document.getElementsByName(x).forEach((e,t)=>{e.checked=!e.checked})},()=>{o(7,y=!1),o(6,R=!0)},async e=>{o(5,g=M(p.displaySort,await ap(p.class,p.id))),e.detail?.row?._id&&I.push(e.detail.row._id),P()},P,v,$,_,C,E,A,b,()=>a("back"),function(e){h=e,o(3,h)}]}class Rr extends Re{constructor(e){var t;super(),ar.getElementById("svelte-4visk8-style")||((t=O("style")).id="svelte-4visk8-style",t.textContent=".feather.svelte-4visk8.svelte-4visk8{position:absolute;top:2em;right:0.5em;color:#326173}td .checkbox .selector{border:0.125em solid #326173 !important}.eList.svelte-4visk8.svelte-4visk8{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-4visk8 .editRow.svelte-4visk8{width:1em}.eList.svelte-4visk8 table.svelte-4visk8{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-4visk8 table thead.svelte-4visk8{position:sticky;top:0;background:#326173;color:white}.eList.svelte-4visk8 table thead tr.svelte-4visk8{height:2.3em}.eList.svelte-4visk8 table tbody tr.svelte-4visk8{height:2.75em !important}th.svelte-4visk8.svelte-4visk8,td.svelte-4visk8.svelte-4visk8{padding-left:0.4em;padding-right:0.4em}td.number.svelte-4visk8.svelte-4visk8{text-align:end}tr.active.svelte-4visk8.svelte-4visk8{color:#326173;background-color:#fcebd5}.form--buttons.svelte-4visk8.svelte-4visk8{display:flex;gap:1em;padding:0.5em 0}",R(ar.head,t)),Te(this,e,Tr,Nr,b,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1},[-1,-1])}}function Dr(e,t,n){const r=e.slice();return r[12]=t[n],r[42]=n,r}function xr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function kr(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[Pr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};36863&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Or(e){let t,n,r,i,o;return n=new pt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[23]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Mr(e){let t,n;return t=new sr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[42],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0+"}"}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};32&n[0]&&(r.classId=e[5]),64&n[0]&&(r.eventId=e[6]),256&n[0]&&(r.required=e[8]),1&n[0]&&(r.disabled=e[0]),2048&n[0]&&(r.formnovalidate=e[11]),512&n[0]&&(r.readonly=e[9]),2&n[0]&&(r.id=e[1]+"."+e[42]),4&n[0]&&(r.item=e[2]),8&n[0]&&(r.desc=e[3]),32768&n[0]&&(r.value=e[12]),16&n[0]&&(r.noForm=e[4]),1024&n[0]&&(r.praefix=e[10]),128&n[0]&&(r.recordId=e[7]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Pr(e){let t,n,r,i=!e[9]&&Or(e),o=e[15],s=[];for(let t=0;t<o.length;t+=1)s[t]=Mr(Dr(e,o,t));const a=e=>ve(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=B();for(let e=0;e<s.length;e+=1)s[e].c();n=L()},m(e,o){i&&i.m(e,o),D(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);D(e,n,o),r=!0},p(e,r){if(e[9]?i&&(ge(),ve(i,1,1,()=>{i=null}),we()):i?(i.p(e,r),512&r[0]&&ye(i,1)):(i=Or(e),i.c(),ye(i,1),i.m(t.parentNode,t)),36863&r[0]){let t;for(o=e[15],t=0;t<o.length;t+=1){const i=Dr(e,o,t);s[t]?(s[t].p(i,r),ye(s[t],1)):(s[t]=Mr(i),s[t].c(),ye(s[t],1),s[t].m(n.parentNode,n))}for(ge(),t=o.length;t<s.length;t+=1)a(t);we()}},i(e){if(!r){ye(i);for(let e=0;e<o.length;e+=1)ye(s[e]);r=!0}},o(e){ve(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ve(s[e]);r=!1},d(e){i&&i.d(e),e&&x(t),k(s,e),e&&x(n)}}}function Br(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Lr(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Fr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Fr(e){let t,n;return t=new Rr({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[22](),target:e[2].name,shouldNew:!e[20]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};65536&n[0]&&(r.selection=e[16]),4&n[0]&&(r.item=e[2]),16384&n[0]&&(r.className=e[14].class),32&n[0]&&(r.classId=e[5]),128&n[0]&&(r.recordId=e[7]),4&n[0]&&(r.target=e[2].name),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Vr(e){let t,n,r=e[13]&&Lr(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&ye(r,1)):(r=Lr(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Ur(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Br,then:kr,catch:xr,value:40,blocks:[,,,]};function s(t){e[34](t)}Ie(e[21](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[Vr]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),te.push(()=>Ae(n,"open",s)),{c(){o.block.c(),t=B(),be(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,D(e,t,r),Se(n,e,r),i=!0},p(t,i){$e(o,e=t,i);const s={};90276&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],ce(()=>r=!1)),n.$set(s)},i(e){i||(ye(o.block),ye(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){ve(o.blocks[e])}ve(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&x(t),Ne(n,e)}}}function Wr(e,n,r){const i=Q(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,f,{id:h}=n,{item:m}=n,{record:p}=n,{value:g=[]}=n,{desc:w=""}=n,{noForm:y=!1}=n,{classId:v}=n,{eventId:I}=n,{recordId:$}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:b}=n,{praefix:S}=n,{selectionFields:N}=n,{formnovalidate:T}=n,{selection:R}=n,{deList:D}=n,{isTemplate:x}=n,{noList:k=!1}=n,O=!1;const{lookup:M,refStatus:P,filter:B,constraint:L}=m.properties.multi;A=!0;const F=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(1,h=e.id),"item"in e&&r(2,m=e.item),"record"in e&&r(26,p=e.record),"value"in e&&r(12,g=e.value),"desc"in e&&r(3,w=e.desc),"noForm"in e&&r(4,y=e.noForm),"classId"in e&&r(5,v=e.classId),"eventId"in e&&r(6,I=e.eventId),"recordId"in e&&r(7,$=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(8,E=e.required),"disabled"in e&&r(0,A=e.disabled),"readonly"in e&&r(9,b=e.readonly),"praefix"in e&&r(10,S=e.praefix),"selectionFields"in e&&r(29,N=e.selectionFields),"formnovalidate"in e&&r(11,T=e.formnovalidate),"selection"in e&&r(30,R=e.selection),"deList"in e&&r(31,D=e.deList),"isTemplate"in e&&r(32,x=e.isTemplate),"noList"in e&&r(33,k=e.noList)},[A,h,m,w,y,v,I,$,E,b,S,T,g,O,d,u,f,o,s,a,M,async()=>{r(15,u=[].concat(g)),r(14,d=await t.getSchemaByClass(m.refClass))},async()=>{let e,n;if(M)if(M.refClass){if(p[M.refClass]){const r=await up(M.refClass,p[M.refClass]);r&&Array.isArray(r[M.refItem])&&(n=[{$match:{_id:{$in:r[M.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[M]:p[M]}}],P&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":P}}])),e=await t.getSectionView(d.class,n,!0);else e=await ap("",d.id);if(!e?.length)return[];if(L&&e?.length){const{refClass:r,refStatus:i}=L,o=d.class===r?"_id":d.class;n=[{$match:{[o]:{$in:e.map(({_id:e})=>e)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":i}}];const s=await t.getSectionView(r,n,!0);"project"!==r&&(e=e.filter(e=>!!s.find(t=>t.project==e._id)))}if(B)for(const t in B)e=e.filter(e=>{let[n,r]=t.split(".");if(r||(r=n,n=""),n){if(e[n][0]&&e[n][0][r].length)return!0}else if(e[r])return!0;return!1});return e},()=>{b||(r(13,O=!0),r(16,f=u))},({detail:e})=>{p.__id||(r(15,u=e.list),i("change",{value:u}),i("multi",{lookup:M,filter:B,name:m.name,value:u})),F()},F,p,_,C,N,R,D,x,k,function(e){O=e,r(13,O)}]}class Hr extends Re{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=O("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",R(document.head,t)),Te(this,e,Wr,Ur,b,{id:1,item:2,record:26,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:27,refValue:28,required:8,disabled:0,readonly:9,praefix:10,selectionFields:29,formnovalidate:11,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const zr=/\d+/g,jr=/%[HMSpPdmyY%]/g;function qr(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(jr);let s=0,a=0;const l=new Date(0);for(const c of o){if(!e.startsWith(c,s))return n;if(s+=c.length,s===e.length){if(a!==t.length)return n;break}if("%"!==t[a+c.length])break;if(a+=c.length+1,"%"===t[a]){if("%"!==e[s])return n;s++}else if("p"===t[a].toLowerCase()){const t=e.substr(s,2).toUpperCase();if("AM"===t)i=!1,l.getHours()>=12&&l.setHours(l.getHours()-12);else{if("PM"!==t)return n;i=!0,l.getHours()<12&&l.setHours(l.getHours()+12)}}else{zr.lastIndex=s;const o=zr.exec(e);if(null==o)return n;switch(t[a]){case"H":l.setHours(parseInt(o[0])+12*i);break;case"M":l.setMinutes(o[0]);break;case"S":l.setSeconds(o[0]);break;case"d":l.setDate(o[0]);break;case"m":l.setMonth(o[0]-1);break;case"y":l.setFullYear(100*r+parseInt(o[0]));break;case"Y":l.setFullYear(o[0])}s+=o[0].length}a++}return isNaN(l.valueOf())?n:l}function Gr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Xr}=_e;function Yr(e,t,n){const r=e.slice();return r[17]=t[n],r}function Zr(e,t,n){const r=e.slice();return r[20]=t[n],r}function Kr(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Qr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=ei(Zr(e,m,t));const g=e=>ve(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ti(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[ri]},$$scope:{ctx:e}}}),l.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[ii]},$$scope:{ctx:e}}}),{c(){t=O("form"),n=O("input"),i=B();for(let e=0;e<p.length;e+=1)p[e].c();o=B(),w&&w.c(),s=B(),a=O("div"),be(l.$$.fragment),c=B(),be(d.$$.fragment),W(n,"class",N(e[6])+" svelte-1phofh5"),W(n,"name","_id"),W(n,"type","hidden"),n.value=r=e[1]._id||"",W(t,"class","fTask svelte-1phofh5"),W(t,"id",e[6]),W(a,"class","form--buttons svelte-1phofh5")},m(r,m){D(r,t,m),R(t,n),R(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);R(t,o),w&&w.m(t,null),D(r,s,m),D(r,a,m),Se(l,a,null),R(a,c),Se(d,a,null),u=!0,f||(h=[F(t,"keydown",e[8]),F(t,"submit",V(e[10]))],f=!0)},p(e,i){if((!u||2&i&&r!==(r=e[1]._id||""))&&(n.value=r),75&i){let n;for(m=e[0].items,n=0;n<m.length;n+=1){const r=Zr(e,m,n);p[n]?(p[n].p(r,i),ye(p[n],1)):(p[n]=ei(r),p[n].c(),ye(p[n],1),p[n].m(t,o))}for(ge(),n=m.length;n<p.length;n+=1)g(n);we()}e[0].list?w?(w.p(e,i),1&i&&ye(w,1)):(w=ti(e),w.c(),ye(w,1),w.m(t,null)):w&&(ge(),ve(w,1,1,()=>{w=null}),we());const s={};8388608&i&&(s.$$scope={dirty:i,ctx:e}),l.$set(s);const a={};4&i&&(a.disabled=e[2]),8388608&i&&(a.$$scope={dirty:i,ctx:e}),d.$set(a)},i(e){if(!u){for(let e=0;e<m.length;e+=1)ye(p[e]);ye(w),ye(l.$$.fragment,e),ye(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)ve(p[e]);ve(w),ve(l.$$.fragment,e),ve(d.$$.fragment,e),u=!1},d(e){e&&x(t),k(p,e),w&&w.d(),e&&x(s),e&&x(a),Ne(l),Ne(d),f=!1,E(h)}}}function Jr(e){let t,n;return t=new Su({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.item=e[20]),1&n&&(r.selection=e[20].selection),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),1&n&&(r.eventId=e[0].id),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ei(e){let t,n,r=ai(!0,e[20]),i=r&&Jr(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){1&n&&(r=ai(!0,e[20])),r?i?(i.p(e,n),1&n&&ye(i,1)):(i=Jr(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function ti(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=ni(Yr(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(75&n){let s;for(r=e[0].list,s=0;s<r.length;s+=1){const o=Yr(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=ni(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}function ni(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new vi({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=B(),be(r.$$.fragment)},m(e,o){Se(t,e,o),D(e,n,o),Se(r,e,o),i=!0},p(e,n){const i={};1&n&&(i.text=e[17].designation),t.$set(i);const o={};1&n&&(o.list=e[17]),1&n&&(o.eventId=e[0].id),1&n&&(o.schema=e[17].item),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),r.$set(o)},i(e){i||(ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!0)},o(e){ve(t.$$.fragment,e),ve(r.$$.fragment,e),i=!1},d(e){Ne(t,e),e&&x(n),Ne(r,e)}}}function ri(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function ii(e){let t;return{c(){t=P("Speichern")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function oi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function si(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:oi,then:Qr,catch:Kr,value:16,blocks:[,,,]};return Ie(e[7](),i),{c(){t=B(),n=O("section"),i.block.c(),Xr.title="Vorgaben",W(n,"class","sTask svelte-1phofh5")},m(e,o){D(e,t,o),D(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){$e(i,e=t,n)},i(e){r||(ye(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}r=!1},d(e){e&&x(t),e&&x(n),i.block.d(),i.token=null,i=null}}}const ai=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function li(e,r,s){let l,d,u;S(e,o,e=>s(11,d=e)),S(e,i,e=>s(12,u=e));const{Divider:f,Button:h,FormField:m}=c,p=JSON.parse(n.getItem("Locale"));let{schema:g}=r,{record:w}=r,y="template-"+g.class+Math.floor(9e3*Math.random()+1e3).toString(),v=!1;const I=()=>window.history.back(),$=(e,t,n=!1)=>{const r=t.id,i=e.find(e=>e.name===r);let o=t.value;if(!n&&i&&i.properties?.multi&&(o=w[r]),o&&i&&i.type.startsWith("date"))try{return qr(o,"%d.%m.%Y").toISOString()}catch{return new Date(o).toISOString()}if(i&&"boolean"===i.type&&(o=!!t.checked),i&&"number"===i.type){const e=Number("1.1").toLocaleString(p.id).substring(1,2);try{o=Number(o.replace(e,".")).toString()}catch{}}return o};return e.$$set=e=>{"schema"in e&&s(0,g=e.schema),"record"in e&&s(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&s(3,l=v)},[g,w,v,l,f,h,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&s(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));s(2,v||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},I,async e=>{const n={};Array.from(document.querySelectorAll("form#"+y+" ."+y)).map(e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[r,i]=t.split("."),o=g.list.find(e=>e.name===r);n[t]=$(o.item,e)}else n[t]=$(g.items,e)}),await t.saveTemplate(g.class,n),a.success("Die Vorgaben wurden gespeichert.",2e3),I()}]}const{document:ci}=_e;function di(e,t,n){const r=e.slice();return r[35]=t[n],r}function ui(e){let t,n;return t=new Su({props:{classId:e[3],item:e[35],listName:e[2].name,eventId:e[4],record:e[0],disabled:e[5],required:e[6],currency:e[9],notifyList:e[1]}}),t.$on("notify",e[15]),t.$on("defPrep",e[17]),t.$on("formula",e[19]),t.$on("task",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.classId=e[3]),4&n[0]&&(r.item=e[35]),4&n[0]&&(r.listName=e[2].name),16&n[0]&&(r.eventId=e[4]),1&n[0]&&(r.record=e[0]),32&n[0]&&(r.disabled=e[5]),64&n[0]&&(r.required=e[6]),512&n[0]&&(r.currency=e[9]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function fi(e){let t,n,r=ai(e[8],e[35]),i=r&&ui(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){260&n[0]&&(r=ai(e[8],e[35])),r?i?(i.p(e,n),260&n[0]&&ye(i,1)):(i=ui(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function hi(e){let t,n,r,i=e[2].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=fi(di(e,i,t));const s=e=>ve(o[e],1,1,()=>{o[e]=null});return{c(){t=O("div");for(let e=0;e<o.length;e+=1)o[e].c();W(t,"id",n=`accordion-content-${e[3]}-${e[2].name}`)},m(e,n){D(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(689023&a[0]){let n;for(i=e[2].item,n=0;n<i.length;n+=1){const r=di(e,i,n);o[n]?(o[n].p(r,a),ye(o[n],1)):(o[n]=fi(r),o[n].c(),ye(o[n],1),o[n].m(t,null))}for(ge(),n=i.length;n<o.length;n+=1)s(n);we()}(!r||12&a[0]&&n!==(n=`accordion-content-${e[3]}-${e[2].name}`))&&W(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)ye(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ve(o[e]);r=!1},d(e){e&&x(t),k(o,e)}}}function mi(e){let t,n,r=e[14](e[10])+"";return{c(){t=O("span"),n=P(r)},m(e,r){D(e,t,r),R(t,n)},p(e,t){1024&t[0]&&r!==(r=e[14](e[10])+"")&&H(n,r)},d(e){e&&x(t)}}}function pi(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[mi]},$$scope:{ctx:e}}}),n.$on("click",function(){A(e[16](e[34]))&&e[16](e[34]).apply(this,arguments)}),{c(){t=O("div"),be(n.$$.fragment),W(t,"class","accordion svelte-148ktt9"),W(t,"slot","handle")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(t,r){e=t;const i={};1024&r[0]|128&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function gi(e){let t,n;return t=new e[13]({props:{open:e[7],$$slots:{handle:[pi,({toggle:e})=>({34:e}),({toggle:e})=>[0,e?8:0]],default:[hi,({toggle:e})=>({34:e}),({toggle:e})=>[0,e?8:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[18]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};128&n[0]&&(r.open=e[7]),1919&n[0]|136&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function wi(e){let t,n,r;return n=new e[12]({props:{$$slots:{default:[gi]},$$scope:{ctx:e}}}),{c(){t=O("div"),be(n.$$.fragment),W(t,"class","formList")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};2047&t[0]|128&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function yi(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=c;let{list:a}=n,{schema:l}=n,{record:d}=n,{classId:u}=n,{eventId:f}=n,{disabled:h}=n,{required:y}=n,{open:v=!1}=n,{template:I={}}=n,{isTemplate:$=!1}=n,{currency:_}=n,{update:C=!1}=n,{notifyList:E}=n,A=new Map;const b={};let S=d[a.name]||{};d[a.name]=S;const N=(e,t)=>""===t[e.name]?"":e._attr?T(e,t[e.name]):"object"===e.type?D(t[e.name]):Array.isArray(t[e.name])?R(t[e.name]):"boolean"===e.type?w(t[e.name]):"number"===e.type?x(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?g(e.name,t):"date"===e.type?m(gDate(t[e.name])):"datetime"===e.type?p(t[e.name]):e.properties?.multi?"":t[e.name],T=(e,t)=>b[t]?.split(" • ").at(e._attr),R=e=>e.slice(0,3).join(", "),D=e=>b[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),x=(e,t)=>("number"==typeof e&&e||(e=Number(e||0)),e.toFixed(t||0)),k=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},O=async({item:e,value:t})=>{const n=l.find(t=>t.properties?.value?.formula?.argument?.find(t=>t.refItem===e.name));if(!n)return;const i=n.properties.value.formula,{operator:o,argument:s}=i,c=s.map(n=>n.refItem===e.name?t:S[n.refItem]||d[n.refItem]);let u=0;"$add"===o&&(u=c.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,d[a.name][n.name]=x(u,n.properties?.decimals),d)};return e.$$set=e=>{"list"in e&&r(2,a=e.list),"schema"in e&&r(20,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(3,u=e.classId),"eventId"in e&&r(4,f=e.eventId),"disabled"in e&&r(5,h=e.disabled),"required"in e&&r(6,y=e.required),"open"in e&&r(7,v=e.open),"template"in e&&r(21,I=e.template),"isTemplate"in e&&r(8,$=e.isTemplate),"currency"in e&&r(9,_=e.currency),"update"in e&&r(22,C=e.update),"notifyList"in e&&r(1,E=e.notifyList)},e.$$.update=()=>{4194309&e.$$.dirty[0]&&C&&d&&r(10,S=d[a.name]||{})},[d,E,a,u,f,h,y,v,$,_,S,i,o,s,e=>{let t=l;return a.display?.refItem&&(t=a.display.refItem.map(e=>{const[t,n]=e.split("."),r=l.find(e=>e.name===t);if(r)return r._attr=n,r}).filter(e=>!!e)),e&&t.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==e[t.name])&&"html"!==t.properties?.format&&"textarea"!==t.properties?.format).map(t=>N(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;r(1,E={listName:a.name,itemName:e.itemName,value:e.value}),e.desc&&(b[n]=e.desc);const i=d[t];r(0,d[t]={...i,[n]:e.value},d),r(10,S=d[t])},e=>t=>{(()=>{const e=I[a.name]||{};for(const t in e)I[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=I[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`;document.querySelector(n),ae().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(k)})},async({detail:{className:e,itemName:n,value:r}})=>{if(A.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+a.name)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&A.set(e,o[0])},()=>{setTimeout(()=>{Array.from(A).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},({detail:e})=>{O(e)},l,I,C,function(t){J(e,t)}]}class vi extends Re{constructor(e){var t;super(),ci.getElementById("svelte-148ktt9-style")||((t=O("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",R(ci.head,t)),Te(this,e,yi,wi,b,{list:2,schema:20,record:0,classId:3,eventId:4,disabled:5,required:6,open:7,template:21,isTemplate:8,currency:9,update:22,notifyList:1},[-1,-1])}}const{document:Ii}=_e;function $i(e){e[0]=e[23].list,e[22]=e[23].items}function _i(e,t,n){const r=e.slice();return r[24]=t[n],r}function Ci(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ei(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ai(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function bi(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[19](t)}$i(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Si]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[22]?.length&&function(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ni(Ei(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[22],o=0;o<r.length;o+=1){const s=Ei(e,r,o);i[o]?i[o].p(s,t):(i[o]=Ni(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}(e),_=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=Di(_i(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);D(e,t,n)},p(e,i){if(11778&i[0]){let o;for(n=e[0],o=0;o<n.length;o+=1){const s=_i(e,n,o);r[o]?r[o].p(s,i):(r[o]=Di(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){k(r,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){$i(e);const r={};2&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ce(()=>a=!1)),s.$set(i),e[22]?.length&&$.p(e,t),e[0]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function Si(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ni(e){let t,n,r=e[27]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Ti(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ri(Ci(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=B(),W(t,"class","pointer svelte-14hcfjl")},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Ci(e,r,s);i[s]?i[s].p(a,o):(i[s]=Ri(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}function Ri(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function Di(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Ti(e);return{c(){r&&r.c(),t=L()},m(e,n){r&&r.m(e,n),D(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[24],e[22],e[1])),n?r?r.p(e,i):(r=Ti(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&x(t)}}}function xi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ki(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:xi,then:bi,catch:Ai,value:23,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function Oi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ki]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Mi(e,n,r){const i=Q(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:h}=n,{list:p}=n,g="",y=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},I=t.getSchemaByClass(f);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(y)?.focus()},200)});return e.$$set=e=>{"item"in e&&r(15,u=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,p=e.list)},[p,g,i,o,s,a,l,d,y,v,e=>()=>i("choose",{row:e}),async()=>{const e=await I,t=e.display;let n=await Jt(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(v(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,g="")},u,f,h,()=>i("back"),function(e){g=e,r(1,g)}]}class Pi extends Re{constructor(e){var t;super(),Ii.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(Ii.head,t)),Te(this,e,Mi,Oi,b,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Bi}=_e;function Li(e,t,n){const r=e.slice();return r[12]=t[n],r}function Fi(e,t,n){const r=e.slice();return r[4]=t[n],r}function Vi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Ui(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=qi(Fi(e,i,t));const s=e=>ve(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&Gi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=B(),a&&a.c(),n=L()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);D(e,t,i),a&&a.m(e,i),D(e,n,i),r=!0},p(e,r){if(60655567&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=Fi(e,i,n);o[n]?(o[n].p(s,r),ye(o[n],1)):(o[n]=qi(s),o[n].c(),ye(o[n],1),o[n].m(t.parentNode,t))}for(ge(),n=i.length;n<o.length;n+=1)s(n);we()}e[8].list?a?(a.p(e,r),256&r[0]&&ye(a,1)):(a=Gi(e),a.c(),ye(a,1),a.m(n.parentNode,n)):a&&(ge(),ve(a,1,1,()=>{a=null}),we())},i(e){if(!r){for(let e=0;e<i.length;e+=1)ye(o[e]);ye(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ve(o[e]);ve(a),r=!1},d(e){k(o,e),e&&x(t),a&&a.d(e),e&&x(n)}}}function Wi(e){let t,n,r,i;const o=[zi,Hi],s=[];function a(e,t){return e[4].name!==e[15]||e[16]?"lookup"!==e[4].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=L()},m(e,n){~t&&s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ge(),ve(s[l],1,1,()=>{s[l]=null}),we()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){~t&&s[t].d(e),e&&x(r)}}}function Hi(e){let t,n;return t=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[4].name===e[15]&&e[16]||e[0],eventId:e[6],notifyList:e[2],currency:e[3],changeValue:e[10]}}),t.$on("notify",e[18]),t.$on("multi",e[19]),t.$on("defPrep",e[20]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};512&n[0]&&(r.classId=e[9]),256&n[0]&&(r.item=e[4]),128&n[0]&&(r.record=e[7]),257&n[0]&&(r.disabled=e[4].name===e[15]&&e[16]||e[0]),64&n[0]&&(r.eventId=e[6]),4&n[0]&&(r.notifyList=e[2]),8&n[0]&&(r.currency=e[3]),1024&n[0]&&(r.changeValue=e[10]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function zi(e){let t,n,r,i;n=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[0]||!!e[1],required:!0,eventId:e[6],notifyList:!0,currency:e[3],changeValue:e[10]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]),n.$on("record",e[24]),n.$on("objRecord",e[25]);let o=e[1]&&ji(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"padding-top",".25em"),j(t,"background-color","lightyellow"),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};512&r[0]&&(i.classId=e[9]),256&r[0]&&(i.item=e[4]),128&r[0]&&(i.record=e[7]),3&r[0]&&(i.disabled=e[0]||!!e[1]),64&r[0]&&(i.eventId=e[6]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&ye(o,1)):(o=ji(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function ji(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[23]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function qi(e){let t,n,r="list"!==e[4].type&&Wi(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&ye(r,1)):(r=Wi(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Gi(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Yi(Li(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(973&n[0]){let s;for(r=e[8].list,s=0;s<r.length;s+=1){const o=Li(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Yi(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}function Xi(e){let t,n,r,i,o;function s(t){e[31](t)}t=new e[13]({props:{text:e[12].designation}});let a={classId:e[9],list:e[12],eventId:e[6],schema:e[12].item,record:e[7],disabled:e[0],currency:e[3],update:!0};return void 0!==e[2]&&(a.notifyList=e[2]),r=new vi({props:a}),te.push(()=>Ae(r,"notifyList",s)),{c(){be(t.$$.fragment),n=B(),be(r.$$.fragment)},m(e,i){Se(t,e,i),D(e,n,i),Se(r,e,i),o=!0},p(e,n){const o={};256&n[0]&&(o.text=e[12].designation),t.$set(o);const s={};512&n[0]&&(s.classId=e[9]),256&n[0]&&(s.list=e[12]),64&n[0]&&(s.eventId=e[6]),256&n[0]&&(s.schema=e[12].item),128&n[0]&&(s.record=e[7]),1&n[0]&&(s.disabled=e[0]),8&n[0]&&(s.currency=e[3]),!i&&4&n[0]&&(i=!0,s.notifyList=e[2],ce(()=>i=!1)),r.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(r.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(r.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(n),Ne(r,e)}}}function Yi(e){let t,n,r="array"!==e[12].type&&Xi(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&ye(r,1)):(r=Xi(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Zi(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Ki(e){let t,n;return t=new Pi({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.item=e[4]),32&n[0]&&(r.className=e[5]),512&n[0]&&(r.classId=e[9]),4096&n[0]&&(r.list=e[12]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Qi(e){let t,n,r=e[11]&&Ki(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&ye(r,1)):(r=Ki(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Ji(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:Zi,then:Ui,catch:Vi,value:56,blocks:[,,,]};function l(t){e[32](t)}Ie(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Qi]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),te.push(()=>Ae(i,"open",l)),{c(){a.block.c(),t=B(),be(n.$$.fragment),r=B(),be(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,D(e,t,o),Se(n,e,o),D(e,r,o),Se(i,e,o),s=!0},p(t,n){$e(a,e=t,n);const r={};6704&n[0]|1073741824&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],ce(()=>o=!1)),i.$set(r)},i(e){s||(ye(a.block),ye(n.$$.fragment,e),ye(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){ve(a.blocks[e])}ve(n.$$.fragment,e),ve(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&x(t),Ne(n,e),e&&x(r),Ne(i,e)}}}function eo(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=Q();let l,d,u,f,h,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:I}=n,{currency:$}=n,{notifyList:_}=n,C={},E=[],A=[],b={},S=new Map,N=!1,T="";const R=y.checkOn,D=v,x=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");E.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},k=()=>{l.items.filter(e=>e.lookup).forEach(e=>{A.push({name:e.name,lookup:e.lookup})}),l.items.filter(e=>e.properties?.lookup).forEach(e=>{A.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})})},O=async e=>{const t=E.filter(t=>t.refObj===e);if(t?.length){r(10,b={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:s}=e;if(!n)break;let a,l,c=!i&&C[n];const u=C[n];u&&i&&(c=(await up(n,u))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${d} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${d} .form-field.${t} .field input`,l=document.querySelector(a)),l&&c&&l.setAttribute(s,""),l&&!c&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${d} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!c),c&&r(10,b[t]="",b))}}};Z(()=>{M()});const M=async()=>{const e=e=>new Promise(t=>setTimeout(t,e));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of E)e.add(t.refObj||u);Array.from(e).forEach(e=>O(e))})(),P())},P=()=>{setTimeout(()=>{Array.from(S).forEach(([e,t])=>{C[e]||r(7,C[e]=t._id,C)})},250)},B=async e=>{if(!e.value)return void F();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(26,I=""),a("setRefValue",I))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(26,I=v),r(7,C={}),a("setRefValue",I)};return e.$$set=e=>{"required"in e&&r(27,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(28,g=e.readonly),"id"in e&&r(29,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(26,I=e.refValue),"currency"in e&&r(3,$=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{268435457&e.$$.dirty[0]&&r(0,p=p||g),1073742048&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:f,taskId:h})},[p,v,_,$,y,u,f,C,l,d,b,N,T,i,s,R,D,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(30,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,u=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(x),k(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===R)return B(e);O(t)},async({detail:e})=>{if(!(l.input?.length&&l.input.length>1))return;if(prevSchema?.class!==l.input[0])return;const{value:n,lookup:i,view:o}=e,[s]=i.split(":"),a=(await t.getSectionView(s,{[o]:{$in:n}})).map(e=>e._id);for(const e of l.input.slice(1)){r(7,C[e]=[],C);const n=await t.getSchemaByClass(e);n.id;let i=await t.getTasks(n.id);if(i=i.data.filter(e=>"Ready"===e._task?.status&&a.includes(e[s])),i?.length){const n=i.map(e=>e._id),o=await t.getSectionView(e,{_id:{$in:n}});for(const t of o)t[e]=t._id;r(7,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(S.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===u)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&S.set(e,o[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(26,I=v),a("setRefValue",I),r(7,C=n[0])),L()},L,F,({detail:e})=>{r(7,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(7,C[e.listName][t.name]=t.value,C)},I,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class to extends Re{constructor(e){var t;super(),Bi.getElementById("svelte-16mo2c-style")||((t=O("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",R(Bi.head,t)),Te(this,e,eo,Ji,b,{required:27,disabled:0,readonly:28,id:29,item:4,value:1,refValue:26,currency:3,notifyList:2},[-1,-1])}}function no(e){let t,n;return{c(){t=O("span"),n=P(e[4]),W(t,"class","item")},m(e,r){D(e,t,r),R(t,n)},p(e,t){16&t[0]&&H(n,e[4])},d(e){e&&x(t)}}}function ro(e){let t,n,r,i=e[6]&&no(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","pointer feather svelte-1fuww0c")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[17]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=B(),o&&o.c(),n=L()},m(e,s){i&&i.m(e,s),D(e,t,s),o&&o.m(e,s),D(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=no(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||(ye(o),r=!0)},o(e){ve(o),r=!1},d(e){i&&i.d(e),e&&x(t),o&&o.d(e),e&&x(n)}}}function io(e){let t,n,r;return n=new e[10]({props:{withItem:!0,itemLeft:!0,lang:e[11].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[9],step:e[12],pattern:e[7],placeholder:e[13],readonly:e[8],disabled:e[3],required:e[5],$$slots:{default:[ro]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=O("div"),be(n.$$.fragment),j(t,"position","relative"),j(t,"max-width","10em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};6&t[0]&&(r.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(r.id=e[0]),1&t[0]&&(r.name=e[0]),512&t[0]&&(r.value=e[9]),128&t[0]&&(r.pattern=e[7]),256&t[0]&&(r.readonly=e[8]),8&t[0]&&(r.disabled=e[3]),32&t[0]&&(r.required=e[5]),80&t[0]|64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function oo(e,t,r){const i=Q(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:f}=t,{formnovalidate:h}=t,{currency:m}=t,{praefix:p}=t,{notifyList:g}=t;const w=JSON.parse(n.getItem("Locale"));let y=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&(y=!1);const v=Number("1.1").toLocaleString(w.id).substring(1,2),{properties:I={}}=a;let{min:$,max:_,step:C,pattern:E,decimals:A=0,unit:b="",placeholder:S,hint:N,readonly:T,negative:R,required:D=!1,transfer:x}=I,k="";l=l?Number(l.toString().replace(",",".")):0,T=!0===T||void 0;const O=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toString()}(Number(e.toString()),A).replace(".",v);E||(E=A?`[0-9]+([${v}][0-9]{1,${A}})?`:"[0-9]*"),R&&(E="-?"+E);return e.$$set=e=>{"id"in e&&r(0,s=e.id),"item"in e&&r(19,a=e.item),"value"in e&&r(18,l=e.value),"noForm"in e&&r(1,d=e.noForm),"classId"in e&&r(2,u=e.classId),"disabled"in e&&r(3,f=e.disabled),"formnovalidate"in e&&r(20,h=e.formnovalidate),"currency"in e&&r(4,m=e.currency),"praefix"in e&&r(21,p=e.praefix),"notifyList"in e&&r(22,g=e.notifyList)},e.$$.update=()=>{1048608&e.$$.dirty[0]&&r(5,D=D&&!h),262144&e.$$.dirty[0]&&(e=>{r(9,k=O((e||"0").toString().replace(",",".")))})(l),4194304&e.$$.dirty[0]&&(async()=>{const e=a.properties?.value?.formula;if(e)void 0!==p&&""!==p?e?.operator?.multiply&&i("formula",{item:a}):e?.operator&&i("formula",{item:a})})()},[s,d,u,f,m,D,y,E,T,k,o,w,C,S,x,({detail:e})=>{void 0!==p&&""!==p||i("formula",{item:a,value:e.value}),i("blur",{value:O(e.value)})},({detail:e})=>{T||+l||r(9,k="")},({detail:e})=>{const t=[].concat(x.target);if(void 0===p||""===p)for(const e of t)i("record",{itemName:e,value:l});else for(const e of t)i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,h,p,g]}class so extends Re{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=O("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",R(document.head,t)),Te(this,e,oo,io,b,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:ao}=_e;function lo(e){e[34]=e[36].list,e[35]=e[36].items}function co(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function uo(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function fo(e,t,n){const r=e.slice();return r[40]=t[n],r}function ho(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function mo(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;lo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[po]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let I=!e[2]&&go(e);function $(t){e[32](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),te.push(()=>Ae(a,"value",$)),a.$on("input",e[15]),u=new rt({props:{size:"18"}});let C=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&yo(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=vo(fo(e,s,t));return{c(){t=O("thead"),n=O("tr"),o&&o.c(),r=B();for(let e=0;e<a.length;e+=1)a[e].c();W(n,"class","svelte-1m010ne"),W(t,"class","svelte-1m010ne")},m(e,s){D(e,t,s),R(t,n),o&&o.m(n,null),R(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);i=!0},p(e,t){if(e[2]?o&&(ge(),ve(o,1,1,()=>{o=null}),we()):o?(o.p(e,t),4&t[0]&&ye(o,1)):(o=yo(e),o.c(),ye(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=fo(e,s,r);a[r]?a[r].p(i,t):(a[r]=vo(i),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=s.length}},i(e){i||(ye(o),i=!0)},o(e){ve(o),i=!1},d(e){e&&x(t),o&&o.d(),k(a,e)}}}(e),E=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=Eo(co(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);D(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[34],s=0;s<r.length;s+=1){const o=co(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Eo(o),i[s].c(),ye(i[s],1),i[s].m(t.parentNode,t))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){k(i,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),I&&I.c(),i=B(),o=O("div"),s=P("Suchen: "),be(a.$$.fragment),c=B(),d=O("span"),be(u.$$.fragment),f=B(),h=O("div"),m=O("table"),C&&C.c(),p=B(),g=O("tbody"),E&&E.c(),W(t,"class","form--buttons svelte-1m010ne"),W(d,"class","feather pointer svelte-1m010ne"),j(o,"margin-bottom","1em"),j(o,"position","relative"),W(m,"striped",""),W(m,"class","svelte-1m010ne"),W(h,"class","eList svelte-1m010ne")},m(l,$){D(l,t,$),Se(n,t,null),R(t,r),I&&I.m(t,null),D(l,i,$),D(l,o,$),R(o,s),Se(a,o,null),R(o,c),R(o,d),Se(u,d,null),D(l,f,$),D(l,h,$),R(h,m),C&&C.m(m,null),R(m,p),R(m,g),E&&E.m(g,null),w=!0,y||(v=F(d,"click",e[17]),y=!0)},p(e,r){lo(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?I&&(ge(),ve(I,1,1,()=>{I=null}),we()):I?(I.p(e,r),4&r[0]&&ye(I,1)):(I=go(e),I.c(),ye(I,1),I.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],ce(()=>l=!1)),a.$set(o),e[35]?.length&&C.p(e,r),e[34]?.length&&E.p(e,r)},i(e){w||(ye(n.$$.fragment,e),ye(I),ye(a.$$.fragment,e),ye(u.$$.fragment,e),ye(C),ye(E),w=!0)},o(e){ve(n.$$.fragment,e),ve(I),ve(a.$$.fragment,e),ve(u.$$.fragment,e),ve(C),ve(E),w=!1},d(e){e&&x(t),Ne(n),I&&I.d(),e&&x(i),e&&x(o),Ne(a),Ne(u),e&&x(f),e&&x(h),C&&C.d(),E&&E.d(),y=!1,v()}}}function po(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function go(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[wo]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function wo(e){let t;return{c(){t=P("Bestätigen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function yo(e){let t,n,r,i,o;return n=new Xe({props:{size:"20"}}),{c(){t=O("th"),be(n.$$.fragment),W(t,"class","svelte-1m010ne")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function vo(e){let t,n,r=e[40]+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-1m010ne")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function Io(e){let t,n,r,i,o,s,a,l=e[0],c=_o(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Co(uo(e,d,t));return{c(){t=O("tr"),c.c(),n=B();for(let e=0;e<u.length;e+=1)u[e].c();r=B(),W(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),W(t,"title","übernimmt den Wert direkt"),W(t,"class","svelte-1m010ne"),q(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){D(i,t,l),c.m(t,null),R(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,r),o=!0,s||(a=F(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&b(l,l=e[0])?(ge(),ve(c,1,1,$),we(),c=_o(e),c.c(),ye(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[35],n=0;n<d.length;n+=1){const i=uo(e,d,n);u[n]?u[n].p(i,a):(u[n]=Co(i),u[n].c(),u[n].m(t,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!o||4&a[0]&&i!==(i=e[2]?"cursor: default;":"cursor: zoom-in;"))&&W(t,"style",i),16385&a[0]&&q(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||(ye(c),o=!0)},o(e){ve(c),o=!1},d(e){e&&x(t),c.d(e),k(u,e),s=!1,a()}}}function $o(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[39],checked:e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]),round:!0}}),{c(){t=O("td"),be(n.$$.fragment),W(t,"title","Wählt den Wert aus"),W(t,"class","svelte-1m010ne")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[37])?e[37][0]:e[37])),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function _o(e){let t,n,r=!e[2]&&$o(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,n){e[2]?r&&(ge(),ve(r,1,1,()=>{r=null}),we()):r?(r.p(e,n),4&n[0]&&ye(r,1)):(r=$o(e),r.c(),ye(r,1),r.m(t.parentNode,t))},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Co(e){let t,n,r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"";return{c(){t=O("td"),n=P(r),W(t,"class","svelte-1m010ne")},m(e,r){D(e,t,r),R(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"")&&H(n,r)},d(e){e&&x(t)}}}function Eo(e){let t,n,r=e[16](e[37],e[3]),i=r&&Io(e);return{c(){i&&i.c(),t=L()},m(e,r){i&&i.m(e,r),D(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[37],e[3])),r?i?(i.p(e,n),8&n[0]&&ye(i,1)):(i=Io(e),i.c(),ye(i,1),i.m(t.parentNode,t)):i&&(ge(),ve(i,1,1,()=>{i=null}),we())},i(e){n||(ye(i),n=!0)},o(e){ve(i),n=!1},d(e){i&&i.d(e),e&&x(t)}}}function Ao(e){let t,n;return t=new e[6]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function bo(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Ao,then:mo,catch:ho,value:36,blocks:[,,,]};return Ie(e[14](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function So(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[bo]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function No(e,n,r){const i=Q(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:f}=n,{id:h}=n,{designation:m}=n,{selection:p}=n,{refDoc:g}=n,{tableName:w}=n,{idName:y}=n,{target:v}=n,{view:I}=n,{unique:$}=n,{uniqueView:_}=n,{status:C}=n,{single:E}=n;p||=[];let A="",b=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const N=w+y+v+"checkbox",T=(e,t)=>e>t?1:t>e?-1:0;Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(b)?.focus()},200)});return e.$$set=e=>{"classId"in e&&r(22,f=e.classId),"id"in e&&r(23,h=e.id),"designation"in e&&r(1,m=e.designation),"selection"in e&&r(0,p=e.selection),"refDoc"in e&&r(24,g=e.refDoc),"tableName"in e&&r(25,w=e.tableName),"idName"in e&&r(26,y=e.idName),"target"in e&&r(21,v=e.target),"view"in e&&r(27,I=e.view),"unique"in e&&r(28,$=e.unique),"uniqueView"in e&&r(29,_=e.uniqueView),"status"in e&&r(30,C=e.status),"single"in e&&r(2,E=e.single)},[p,m,E,A,S,i,o,s,a,l,d,u,b,N,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if(I){if(h){const n=f.split("-")[1].slice(0,-4),r="input."+f+"[name='_id']",o=document.querySelector(r).value;i={[y]:h},C&&(i.$or=[{status:!0},{[n]:o}]),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const r=e=>(e[n]||"z").toString()+e[v];return T(r(e),r(t))})}}else _?h&&(i={[y]:h,status:!0},Object.entries(_).map(([e,t])=>{t?.length&&(i[e]={$in:t}),n.push(e)}),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}),r(4,S=e.map(e=>{const t=[e[v]];return n.map(n=>t.push(e[n])),t}))):$?(e=await t.getSection(w,y,h,$),e=e.sort((e,t)=>T(e,t))):(e=await t.getSection(w,y,h,!1,C),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}));else i={},h&&!Array.isArray(h)&&(i._id=h),e=await t.getSectionView(w,i);const o=await t.getSchemaByClass(w),s=[];if(g){const t=o.items[0].name,n=o.items[1].name,i=o.list[0].name,s=e.find(e=>e[t]===g);e=s?s[i]:[],r(21,v=n)}let a;return e.map(e=>{let t=e[v];if(t||w!==v||(r(21,v=o.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter(e=>!!e&&24!==e?.length).join(", ")),s.push(t||[])}else g&&(t=o.list[0].item.map(t=>e[t.name]||"")),s.push(t||[])}),a=g?o.list[0].item.map(e=>e.designation):[o.items.find(e=>e.name===v)?.designation],n=n.map(e=>o.items.find(t=>t.name===e)?.designation),{list:g?s:s.flat(),items:[...a,...n]}},({detail:{value:e}})=>{r(3,A=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,A="")},e=>()=>{const t=document.getElementsByName(N),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(N).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;E?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,f,h,g,w,y,I,$,_,C,()=>i("back"),function(e){A=e,r(3,A)}]}class To extends Re{constructor(e){var t;super(),ao.getElementById("svelte-1m010ne-style")||((t=O("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",R(ao.head,t)),Te(this,e,No,So,b,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:Ro}=_e;function Do(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=O("span"),n=P("("),r=P(s),i=P(")"),W(t,"class",o=N(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){D(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=N(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&W(t,"class",o)},d(e){e&&x(t)}}}function xo(e){let t;return{c(){t=O("div"),W(t,"class","load-more-options"),W(t,"slot","load-more-options-message")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function ko(e){let t,n,r,i;const o=[Po,Mo,Oo],s=[];function a(e,t){return!e[16].single&&e[7]?.length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=L()},m(e,n){~t&&s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ge(),ve(s[l],1,1,()=>{s[l]=null}),we()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){~t&&s[t].d(e),e&&x(r)}}}function Oo(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[26]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Mo(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title",e[17].title||"Generieren"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[25]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Po(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Löschen"),W(t,"class","feather pointer svelte-1rbaejz")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[27]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Bo(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Lo]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};53&r[0]|32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function Lo(e){let t,n;return t=new To({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],designation:e[4].designation,target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),1&n[0]&&(r.selection=e[0]),16&n[0]&&(r.unique=e[16].unique&&e[4].name),32&n[0]&&(r.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(r.id=e[5][e[21]||e[20]]),16&n[0]&&(r.designation=e[4].designation),16&n[0]&&(r.target=e[4].name),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Fo(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&Do(e);function u(t){e[35](t)}function f(t){e[36](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Vo,minSearchLength:"3",$$slots:{"load-more-options-message":[xo]},$$scope:{ctx:e}};void 0!==e[7]&&(h.selection=e[7]),void 0!==e[9]&&(h.maxOptions=e[9]),r=new e[12]({props:h}),te.push(()=>Ae(r,"selection",u)),te.push(()=>Ae(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&ko(e),p=e[10]&&Bo(e);return{c(){t=O("div"),d&&d.c(),n=B(),be(r.$$.fragment),s=B(),m&&m.c(),a=B(),p&&p.c(),l=L(),j(t,"position","relative")},m(e,i){D(e,t,i),d&&d.m(t,null),R(t,n),Se(r,t,null),R(t,s),m&&m.m(t,null),D(e,a,i),p&&p.m(e,i),D(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=Do(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const a={};8&s[0]&&(a.id=e[3]),8&s[0]&&(a.name=e[3]),8&s[0]&&(a.class=e[3]),2&s[0]&&(a.disabled=e[1]),64&s[0]&&(a.required=e[6]),256&s[0]&&(a.placeholder=e[8]),32768&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],ce(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],ce(()=>o=!1)),r.$set(a),e[1]?m&&(ge(),ve(m,1,1,()=>{m=null}),we()):m?(m.p(e,s),2&s[0]&&ye(m,1)):(m=ko(e),m.c(),ye(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&ye(p,1)):(p=Bo(e),p.c(),ye(p,1),p.m(l.parentNode,l)):p&&(ge(),ve(p,1,1,()=>{p=null}),we())},i(e){c||(ye(r.$$.fragment,e),ye(m),ye(p),c=!0)},o(e){ve(r.$$.fragment,e),ve(m),ve(p),c=!1},d(e){e&&x(t),d&&d.d(),Ne(r),m&&m.d(),e&&x(a),p&&p.d(e),e&&x(l)}}}async function*Vo(e){yield[{name:e}]}function Uo(e,n,r){const i=Q(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:f}=n,{noForm:h=!1}=n,{disabled:m}=n,{formnovalidate:p}=n,{numberInput:g}=n,{praefix:w}=n,{toDelete:y}=n,{reqQuantity:v}=n,{notifyList:I}=n;const{properties:$={}}=d;let{placeholder:_,hint:C,readonly:E,required:A=!1,lookup:b="",view:S=!1,multi:N,max:T=1e3,generate:R=!1,status:D=!0,refDoc:x}=$;const[k,O]=b.split(":");let M=!1,P=f.map&&f.map(e=>({name:e}))||[];m||=E,m&&(_="");const B=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,P=t.map(e=>({name:e.trim()})));const n=P.map(e=>e.name);i("blur",{value:n}),i("multi",{view:N.view,lookup:b,name:d.name,value:n})};Z(async()=>{i("multi",{view:N.view,lookup:b,name:d.name,value:f});const e=document.getElementById(l);e.classList.add(a),!E&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||T;(N.unique||P.length<e)&&r(10,M=!0)}},F=()=>{r(10,M&&=!1)},V=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,P=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:N.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[O]:u[O]},n=await t.getSectionView(k,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},W=(e=!1)=>{if(m||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;r(9,T=!1!==e?e:v||u[t]||0);const n=P?.length!=T,o=document.getElementById(l);o?.classList?.toggle("invalid",n),i("invalid",{idx:w,value:n})};return e.$$set=e=>{"classId"in e&&r(2,a=e.classId),"id"in e&&r(3,l=e.id),"item"in e&&r(4,d=e.item),"record"in e&&r(5,u=e.record),"value"in e&&r(0,f=e.value),"noForm"in e&&r(28,h=e.noForm),"disabled"in e&&r(1,m=e.disabled),"formnovalidate"in e&&r(29,p=e.formnovalidate),"numberInput"in e&&r(30,g=e.numberInput),"praefix"in e&&r(31,w=e.praefix),"toDelete"in e&&r(32,y=e.toDelete),"reqQuantity"in e&&r(33,v=e.reqQuantity),"notifyList"in e&&r(34,I=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&r(7,P=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&r(7,P=u[d.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===d.name&&r(7,P=[]),128&e.$$.dirty[0]&&P&&(r(0,f=P.map&&P.map(e=>e.name)||[]),W()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===N.maxItem&&W(n)})(g),536870976&e.$$.dirty[0]&&r(6,A=A&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(d.refItem&&d.refItem?.split(".")[0]===n){let[e,n]=d.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}if(d.refItem2&&d.refItem2?.split(".")[0]===n){let[e,n]=d.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}setTimeout(W,250)}})(I)},[f,m,a,l,d,u,A,P,_,T,M,o,s,E,b,S,N,R,D,x,k,O,B,F,V,()=>{const e=u[R.itemQuantity]||v;if(!e)return;const t=R.prefix||"",n=u[R.variable]||"",r=R.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));V({detail:{name:d.name,list:i}})},async()=>{if(!0===S)return U();const e=v||u[N.maxItem];if(!e)return;let n={};O&&(n={[O]:u[O]}),D&&(n.status=!0);const r=[].concat(u[N.view]||[]);r.length&&(n[N.view]={$in:r});const i=await t.getSectionView(k,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][d.name]);V({detail:{name:d.name,list:o}})},()=>{V({detail:{name:d.name,list:[]}})},h,p,g,w,y,v,I,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){T=e,r(9,T)},function(e){M=e,r(10,M)}]}class Wo extends Re{constructor(e){var t;super(),Ro.getElementById("svelte-1rbaejz-style")||((t=O("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",R(Ro.head,t)),Te(this,e,Uo,Fo,b,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}function Ho(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function zo(e){let t,n,r;return{c(){t=O("span"),n=O("a"),r=P("Test"),W(n,"href",Go),W(n,"target","_blank"),W(n,"rel","noopener"),W(t,"class","feather pointer svelte-9up2nn")},m(e,i){D(e,t,i),R(t,n),R(n,r)},p:$,i:$,o:$,d(e){e&&x(t)}}}function jo(e){let t,n,r,i,o,s;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[11]);const a=[zo,Ho],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}const qo=e("getMapLink",async e=>{const{street:n,houseNo:r,postcode:i,location:o,country:s}=e,a=[n&&r?n+" "+r:n,i&&o?i+" "+o:i||o||"",s&&(await t.getTask("country",s)).designation].filter(e=>!!e).join(", ");return"https://bing.com/maps/default.aspx?where1="+encodeURIComponent(a)}),Go="https://www.google.ch/maps/search/?api=1&query=Farman-Strasse%2046%2C%206340%20Glattpark%2C%20Schweiz";function Xo(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{record:h}=t,{item:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"record"in e&&n(9,h=e.record),"item"in e&&n(10,m=e.item)},[i,o,s,a,l,d,u,f,r,h,m,function(t){J(e,t)}]}class Yo extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Xo,jo,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:9,item:10})}}const{document:Zo}=_e;function Ko(e){let t;return{c(){t=O("div"),W(t,"class","load-more-options"),W(t,"slot","load-more-options-message")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Qo(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-wpjws5")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Jo(e){let t,n,r,i,o;return n=new $t({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-wpjws5")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[8]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function es(e){let t,n,r,i,o,s,a;function l(t){e[17](t)}function c(t){e[18](t)}function d(t){e[19](t)}let u={id:e[1],name:e[1],class:e[1],minSearchLength:"1",maxOptions:"1",getOptions:e[7],$$slots:{"load-more-options-message":[Ko]},$$scope:{ctx:e}};void 0!==e[0]&&(u.value=e[0]),void 0!==e[2]&&(u.selection=e[2]),void 0!==e[3]&&(u.searchQuery=e[3]),n=new e[4]({props:u}),te.push(()=>Ae(n,"value",l)),te.push(()=>Ae(n,"selection",c)),te.push(()=>Ae(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[Jo,Qo],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),s=B(),f&&f.c(),j(t,"position","relative"),W(t,"class","inputAutoComplete")},m(e,r){D(e,t,r),Se(n,t,null),R(t,s),f&&f.m(t,null),a=!0},p(e,t){const s={};2&t[0]&&(s.id=e[1]),2&t[0]&&(s.name=e[1]),2&t[0]&&(s.class=e[1]),32&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],ce(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],ce(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],ce(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||(ye(n.$$.fragment,e),ye(f),a=!0)},o(e){ve(n.$$.fragment,e),ve(f),a=!1},d(e){e&&x(t),Ne(n),f&&f.d()}}}function ts(e,t,n){const{Autocomplete:r}=c,i=Q();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:f}=t,{noForm:h=!1}=t,{disabled:m}=t,{formnovalidate:p}=t,{autocomplete:{input:g,min:w,url:y,output:v},format:I}=a.properties;y="https://openplzapi.org/";const $=[].concat(g),{name:_}=v,C="map"===I;let E,A=f,b=!1;Z(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",T),e.addEventListener("keyup",N),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},N=e=>{8===e.keyCode&&""===A&&n(0,f="")},T=async()=>{if(w){const e=$[0].name;if((d?u[d][e]:u[e]).length<w)return}const e=await R();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),x(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},R=async(e="")=>{const t=await(async()=>{const e=d?u[d].country:u.country;if(e){const t=await up("country",e);if(t?.countryCode)return t.countryCode?.toLowerCase()}return"ch"})();let n="Streets";"postalCode"===$[0].refItem&&(n="Localities");const r=await fetch(y+t+"/"+n+"?"+D()+"&name=%5E"+e.trim());if(!r.ok)return;const i=r.headers.get("Content-Type").split(";")[0];let o=[];try{if("text/json"===i){const e=await r.text();o=JSON.parse(e||[])}else"application/json"===i&&(o=await r.json())}catch{}return o=o.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),o.map(e=>({name:e[_]}))},D=()=>$.map(({name:e,refItem:t})=>`${t}=${(d?u[d][e]:u[e]).split(" ")[0]}`).join("&"),x=e=>{i("blur",{value:e})};return e.$$set=e=>{"classId"in e&&n(9,o=e.classId),"id"in e&&n(1,s=e.id),"item"in e&&n(10,a=e.item),"name"in e&&n(11,l=e.name),"listName"in e&&n(12,d=e.listName),"record"in e&&n(13,u=e.record),"value"in e&&n(0,f=e.value),"noForm"in e&&n(14,h=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[f,s,E,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,E=[]),x(f)},async function*(e){if(b||f&&e.startsWith(f))return n(0,f=e),void x(f);const t=await R(e);if(!t?.length)return n(0,f=e),void x(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,E=[]),x(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await qo(e);window.open(t,"_blank")},o,a,l,d,u,h,m,p,function(e){f=e,n(0,f)},function(e){E=e,n(2,E)},function(e){A=e,n(3,A)}]}class ns extends Re{constructor(e){var t;super(),Zo.getElementById("svelte-wpjws5-style")||((t=O("style")).id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",R(Zo.head,t)),Te(this,e,ts,es,b,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:rs}=_e;function is(e){e[26]=e[28].list,e[27]=e[28].items}function os(e,t,n){const r=e.slice();return r[29]=t[n],r}function ss(e,t,n){const r=e.slice();return r[32]=t[n],r}function as(e,t,n){const r=e.slice();return r[32]=t[n],r}function ls(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function cs(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[23](t)}is(e),n=new e[7]({props:{outline:!0,$$slots:{default:[ds]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),te.push(()=>Ae(s,"value",v)),s.$on("input",e[12]),d=new rt({props:{size:"18"}});let $=e[27]?.length&&function(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=us(as(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();W(n,"class","svelte-14hcfjl"),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[27],o=0;o<r.length;o+=1){const s=as(e,r,o);i[o]?i[o].p(s,t):(i[o]=us(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&x(t),k(i,e)}}}(e),_=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=ms(os(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);D(e,t,n)},p(e,i){if(11779&i[0]){let o;for(n=e[26],o=0;o<n.length;o+=1){const s=os(e,n,o);r[o]?r[o].p(s,i):(r[o]=ms(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){k(r,e),e&&x(t)}}}(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),i=O("div"),o=P("Suchen: "),be(s.$$.fragment),l=B(),c=O("span"),be(d.$$.fragment),u=B(),f=O("div"),h=O("table"),$&&$.c(),m=B(),p=O("tbody"),_&&_.c(),W(t,"class","form--buttons svelte-14hcfjl"),W(c,"class","feather pointer svelte-14hcfjl"),j(i,"margin-bottom","1em"),j(i,"position","relative"),W(h,"striped",""),W(h,"class","svelte-14hcfjl"),W(f,"class","eList svelte-14hcfjl")},m(a,v){D(a,t,v),Se(n,t,null),D(a,r,v),D(a,i,v),R(i,o),Se(s,i,null),R(i,l),R(i,c),Se(d,c,null),D(a,u,v),D(a,f,v),R(f,h),$&&$.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=F(c,"click",e[14]),w=!0)},p(e,t){is(e);const r={};64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ce(()=>a=!1)),s.$set(i),e[27]?.length&&$.p(e,t),e[26]?.length&&_.p(e,t)},i(e){g||(ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!0)},o(e){ve(n.$$.fragment,e),ve(s.$$.fragment,e),ve(d.$$.fragment,e),g=!1},d(e){e&&x(t),Ne(n),e&&x(r),e&&x(i),Ne(s),Ne(d),e&&x(u),e&&x(f),$&&$.d(),_&&_.d(),w=!1,y()}}}function ds(e){let t;return{c(){t=P("Abbrechen")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function us(e){let t,n,r=e[32]?.designation+"";return{c(){t=O("th"),n=P(r),W(t,"class","svelte-14hcfjl")},m(e,r){D(e,t,r),R(t,n)},p:$,d(e){e&&x(t)}}}function fs(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=hs(ss(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=B(),W(t,"class","pointer svelte-14hcfjl"),q(t,"active",e[29]._id===e[0])},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=ss(e,r,s);i[s]?i[s].p(a,o):(i[s]=hs(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}2049&o[0]&&q(t,"active",e[29]._id===e[0])},d(e){e&&x(t),k(i,e)}}}function hs(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=O("td"),n=P(o),W(t,"class","svelte-14hcfjl")},m(o,s){D(o,t,s),R(t,n),r||(i=F(t,"click",U(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&x(t),r=!1,i()}}}function ms(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&fs(e);return{c(){r&&r.c(),t=L()},m(e,n){r&&r.m(e,n),D(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[29],e[27],e[1])),n?r?r.p(e,i):(r=fs(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&x(t)}}}function ps(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p:$,i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function gs(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ps,then:cs,catch:ls,value:28,blocks:[,,,]};return Ie(e[11](),o),{c(){be(t.$$.fragment),n=B(),r=L(),o.block.c()},m(e,s){Se(t,e,s),D(e,n,s),D(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){$e(o,e=t,n)},i(e){i||(ye(t.$$.fragment,e),ye(o.block),i=!0)},o(e){ve(t.$$.fragment,e);for(let e=0;e<3;e+=1){ve(o.blocks[e])}i=!1},d(e){Ne(t,e),e&&x(n),e&&x(r),o.block.d(e),o.token=null,o=null}}}function ws(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[gs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ys(e,n,i){const o=Q(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{className:h}=n,{classId:p}=n,{rowId:g}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:$}=n,_="",C=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const E=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?w(n):m(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);Z(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(C)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await A;e.eventId===t.id&&fp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,f=e.item),"className"in e&&i(16,h=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,g=e.rowId),"viewName"in e&&i(18,y=e.viewName),"viewValue"in e&&i(19,v=e.viewValue),"recordId"in e&&i(20,I=e.recordId),"filter"in e&&i(21,$=e.filter)},[g,_,o,s,a,l,d,u,C,E,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+p+"#"+y;document.querySelector(n);let r={[y]:v},i=[];r[y]&&(i=await t.getSectionView(e.class,r,!0)),$&&(i=i.filter(e=>e._id!=$));const o=e.display;return{list:i,items:await Jt(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(E(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,p,y,v,I,$,()=>o("back"),function(e){_=e,i(1,_)}]}class vs extends Re{constructor(e){var t;super(),rs.getElementById("svelte-14hcfjl-style")||((t=O("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",R(rs.head,t)),Te(this,e,ys,ws,b,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Is(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function $s(e){let t,n,r,i,o;function s(t){e[21](t)}let a={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(a.value=e[0]),n=new e[10]({props:a}),te.push(()=>Ae(n,"value",s));let l=!e[6]&&_s(e);return{c(){t=O("div"),be(n.$$.fragment),i=B(),l&&l.c(),j(t,"position","relative")},m(e,r){D(e,t,r),Se(n,t,null),R(t,i),l&&l.m(t,null),o=!0},p(e,i){const o={};4&i&&(o.id=e[2]),8&i&&(o.name=e[3].name),34&i&&(o.inputClass=e[5]||e[1]),64&i&&(o.disabled=e[6]),128&i&&(o.formnovalidate=e[7]),!r&&1&i&&(r=!0,o.value=e[0],ce(()=>r=!1)),n.$set(o),e[6]?l&&(ge(),ve(l,1,1,()=>{l=null}),we()):l?(l.p(e,i),64&i&&ye(l,1)):(l=_s(e),l.c(),ye(l,1),l.m(t,null))},i(e){o||(ye(n.$$.fragment,e),ye(l),o=!0)},o(e){ve(n.$$.fragment,e),ve(l),o=!1},d(e){e&&x(t),Ne(n),l&&l.d()}}}function _s(e){let t,n,r,i,o;return n=new kt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-wbrqzu")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[17]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Cs(e){return{c:$,m:$,p:$,i:$,o:$,d:$}}function Es(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[As]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),te.push(()=>Ae(t,"open",i)),{c(){be(t.$$.fragment)},m(e,n){Se(t,e,n),r=!0},p(e,r){const i={};268435994&r&&(i.$$scope={dirty:r,ctx:e}),!n&&256&r&&(n=!0,i.open=e[8],ce(()=>n=!1)),t.$set(i)},i(e){r||(ye(t.$$.fragment,e),r=!0)},o(e){ve(t.$$.fragment,e),r=!1},d(e){Ne(t,e)}}}function As(e){let t,n;return t=new vs({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.item=e[3]),8&n&&(r.className=e[3].refClass),2&n&&(r.classId=e[1]),16&n&&(r.recordId=e[4]._id),512&n&&(r.viewValue=e[9]),16&n&&(r.filter=e[4]._id),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function bs(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Cs,then:$s,catch:Is,value:27,blocks:[,,,]};Ie(e[16](),i);let o=e[8]&&Es(e);return{c(){i.block.c(),t=B(),o&&o.c(),n=L()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,D(e,t,s),o&&o.m(e,s),D(e,n,s),r=!0},p(t,[r]){$e(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&ye(o,1)):(o=Es(e),o.c(),ye(o,1),o.m(n.parentNode,n)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){r||(ye(i.block),ye(o),r=!0)},o(e){for(let e=0;e<3;e+=1){ve(i.blocks[e])}ve(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&x(t),o&&o.d(e),e&&x(n)}}}function Ss(e,t,n){const{TextField:r,Modal:i}=c;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:f}=t,{formnovalidate:h}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:I=!1,view:$}=p,_=!1;const C=()=>{n(8,_=!1)};return e.$$set=e=>{"classId"in e&&n(1,o=e.classId),"id"in e&&n(2,s=e.id),"item"in e&&n(3,a=e.item),"record"in e&&n(4,l=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,f=e.disabled),"formnovalidate"in e&&n(7,h=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,f,h,_,g,r,i,w,v,I,$,async()=>(n(9,g=l[$.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,d=e.row[$.value?$.value:"_id"]),C()},C,m,function(e){d=e,n(0,d)},function(e){_=e,n(8,_)}]}class Ns extends Re{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=O("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",R(document.head,t)),Te(this,e,Ss,bs,b,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Ts(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Rs(e){let t;return{c(){t=O("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Ds(e){let t;return{c(){t=O("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function xs(e){let t,n,r,i,o=e[12]+"";return{c(){t=O("option"),n=P(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){D(e,t,r),R(t,n)},p(e,s){64&s&&o!==(o=e[12]+"")&&H(n,o),64&s&&r!==(r=e[13])&&(t.__value=r,t.value=t.__value),65&s&&i!==(i=e[0]==e[13])&&(t.selected=i)},d(e){e&&x(t)}}}function ks(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Ds:Rs}let r=n(e),i=r(e);return{c(){i.c(),t=L()},m(e,n){i.m(e,n),D(e,t,n)},p(e,o){r!==(r=n(e))&&(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&x(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=xs(Ts(e,a,t));return{c(){t=O("select"),s&&s.c(),n=L();for(let e=0;e<l.length;e+=1)l[e].c();W(t,"class",r=N(e[3]||e[4])+" svelte-5xpzvo"),W(t,"id",e[2]),W(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){D(r,t,a),s&&s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=F(t,"change",e[9]),i=!0)},p(e,[n]){if(e[7]||s.p(e,n),65&n){let r;for(a=e[6],r=0;r<a.length;r+=1){const i=Ts(e,a,r);l[r]?l[r].p(i,n):(l[r]=xs(i),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=a.length}24&n&&r!==(r=N(e[3]||e[4])+" svelte-5xpzvo")&&W(t,"class",r),4&n&&W(t,"id",e[2]),4&n&&W(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:$,o:$,d(e){e&&x(t),s&&s.d(),k(l,e),i=!1,o()}}}function Os(e,t,n){const r=Q();let{id:i}=t,{item:o}=t,{value:s}=t,{noForm:a=!1}=t,{classId:l}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:f,readonly:h}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===f&&(s||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===f&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===f&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(10,o=e.item),"value"in e&&n(0,s=e.value),"noForm"in e&&n(3,a=e.noForm),"classId"in e&&n(4,l=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[s,c,i,a,l,d,u,f,h,e=>r("blur",{value:e.srcElement.value}),o]}class Ms extends Re{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=O("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",R(document.head,t)),Te(this,e,Os,ks,b,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Ps(e){let t,n,r,i,o,s,a,l,c;i=new e[8]({props:{id:"dp-"+e[1]+(e[2]?"-"+e[2]:""),value:e[0],readonly:e[5],required:e[7],disabled:e[6],noCalendar:e[9],closeOnSelection:!0}}),i.$on("change",e[11]);let d=e[10]&&function(e){let t,n,r,i,o;return n=new Fe({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"title","Übernehmen"),W(t,"class","pointer feather")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}(e);return{c(){t=O("input"),r=B(),be(i.$$.fragment),o=B(),d&&d.c(),s=L(),W(t,"type","string"),W(t,"class",n=e[3]||e[4]),W(t,"id",e[1]),W(t,"name",e[1]),t.hidden=!0},m(n,u){D(n,t,u),z(t,e[0]),D(n,r,u),Se(i,n,u),D(n,o,u),d&&d.m(n,u),D(n,s,u),a=!0,l||(c=F(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&W(t,"class",n),(!a||2&r)&&W(t,"id",e[1]),(!a||2&r)&&W(t,"name",e[1]),1&r&&z(t,e[0]);const o={};6&r&&(o.id="dp-"+e[1]+(e[2]?"-"+e[2]:"")),1&r&&(o.value=e[0]),32&r&&(o.readonly=e[5]),128&r&&(o.required=e[7]),64&r&&(o.disabled=e[6]),i.$set(o),e[10]&&d.p(e,r)},i(e){a||(ye(i.$$.fragment,e),ye(d),a=!0)},o(e){ve(i.$$.fragment,e),ve(d),a=!1},d(e){e&&x(t),e&&x(r),Ne(i,e),e&&x(o),d&&d.d(e),e&&x(s),l=!1,c()}}}let Bs=new Map;function Ls(e,n,r){const i=Q(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:f=!1}=n,{classId:h}=n,{eventId:m}=n,{readonly:p}=n,{disabled:g}=n,{required:w}=n,{notifyList:y}=n,{dateInput:v}=n;s||(s=void 0);let I=null;const $=(void 0===u?"":u.toString())+"-"+m+"-"+l.name,_=l.properties?.noCalendar||!1,C=l.properties?.transfer,E=({detail:e})=>{try{r(0,s=Gr(e.value,s)),void 0!==u&&""!==u&&Bs.set($,new Date(s.valueOf())),A(s)}catch{r(0,s=void 0)}},A=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==u&&!s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=Gr(t,s)}return e.$$set=e=>{"value"in e&&r(0,s=e.value),"id"in e&&r(1,a=e.id),"item"in e&&r(13,l=e.item),"record"in e&&r(14,d=e.record),"praefix"in e&&r(2,u=e.praefix),"noForm"in e&&r(3,f=e.noForm),"classId"in e&&r(4,h=e.classId),"eventId"in e&&r(15,m=e.eventId),"readonly"in e&&r(5,p=e.readonly),"disabled"in e&&r(6,g=e.disabled),"required"in e&&r(7,w=e.required),"notifyList"in e&&r(16,y=e.notifyList),"dateInput"in e&&r(17,v=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!C&&Bs.has($)&&r(0,s=Bs.get($)),65536&e.$$.dirty&&(async e=>{if(null===I){const e=(await t.getEvent(m)).output.class[0].item;I=e.find(e=>e.properties?.value?.formula)}I&&I.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!I.properties.value.formula.argument[1].value&&e.itemName!==I.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:I}))})(y),131072&e.$$.dirty&&((e={})=>{let{ref:t,val:n,t:r,l:i,n:o}=e;if(o&&(n=o),!n||isNaN(new Date(n)))return;if(r)return;if(!t)return;const[s,a]=t.split(".");s===i&&a===l.name&&null!=u&&E({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=Gr(d[l.name],s))}catch{}},[s,a,u,f,h,p,g,w,o,_,C,E,()=>{i("record",{target:C.target,value:s.toISOString()})},l,d,m,y,v,function(){s=this.value,r(0,s),r(14,d),r(13,l),r(6,g),r(5,p)}]}class Fs extends Re{constructor(e){super(),Te(this,e,Ls,Ps,b,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function Vs(e){let t;return{c(){t=P("Stunden")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Us(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Vs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function Ws(e){let t;return{c(){t=P("Minuten")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function Hs(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[Ws]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function zs(e){let t;return{c(){t=P("Jetzt")},m(e,n){D(e,t,n)},d(e){e&&x(t)}}}function js(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[zs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function qs(e){let t,n,r,i,o,s,a,l,c;return i=new e[5]({props:{value:e[0],closeOnSelection:!0}}),i.$on("change",e[8]),s=new e[6]({props:{value:e[0],$$slots:{"now-label":[js],"minutes-label":[Hs],"hours-label":[Us]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=O("input"),r=B(),be(i.$$.fragment),o=B(),be(s.$$.fragment),W(t,"type","string"),W(t,"class",n=e[2]||e[3]),W(t,"id",e[1]),W(t,"name",e[1]),t.hidden=!0},m(n,d){D(n,t,d),z(t,e[0]),D(n,r,d),Se(i,n,d),D(n,o,d),Se(s,n,d),a=!0,l||(c=F(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&W(t,"class",n),(!a||2&r)&&W(t,"id",e[1]),(!a||2&r)&&W(t,"name",e[1]),1&r&&z(t,e[0]);const o={};1&r&&(o.value=e[0]),i.$set(o);const l={};1&r&&(l.value=e[0]),4096&r&&(l.$$scope={dirty:r,ctx:e}),s.$set(l)},i(e){a||(ye(i.$$.fragment,e),ye(s.$$.fragment,e),a=!0)},o(e){ve(i.$$.fragment,e),ve(s.$$.fragment,e),a=!1},d(e){e&&x(t),e&&x(r),Ne(i,e),e&&x(o),Ne(s,e),l=!1,c()}}}function Gs(e,t,n){const r=Q(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const f=e=>r("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,a=e.value),"id"in e&&n(1,l=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[a,l,d,u,i,o,s,({detail:e})=>{var t,r;n(0,(t=e.value,r=a,a=null==t||null==r?t:(r.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r))),f(a)},({detail:e})=>{n(0,a=Gr(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class Xs extends Re{constructor(e){super(),Te(this,e,Gs,qs,b,{value:0,id:1,noForm:2,classId:3})}}function Ys(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g;return u=new e[9]({props:{format:e[7],required:e[3],disabled:e[4],value:e[5],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),h=new e[9]({props:{format:e[8],required:e[3],disabled:e[4],value:e[6],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),h.$on("change",e[12]),{c(){t=O("input"),o=B(),s=O("input"),d=B(),be(u.$$.fragment),f=P(" /\n"),be(h.$$.fragment),W(t,"type","string"),W(t,"class",n=e[1]||e[2]),W(t,"id",r=e[0]+"_from"),W(t,"name",i=e[0]+"_from"),t.hidden=!0,W(s,"type","string"),W(s,"class",a=e[1]||e[2]),W(s,"id",l=e[0]+"_to"),W(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){D(n,t,r),z(t,e[5]),D(n,o,r),D(n,s,r),z(s,e[6]),D(n,d,r),Se(u,n,r),D(n,f,r),Se(h,n,r),m=!0,p||(g=[F(t,"input",e[15]),F(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&W(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&W(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&W(t,"name",i),32&o&&z(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&W(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&W(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&W(s,"name",c),64&o&&z(s,e[6]);const d={};128&o&&(d.format=e[7]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),32&o&&(d.value=e[5]),u.$set(d);const f={};256&o&&(f.format=e[8]),8&o&&(f.required=e[3]),16&o&&(f.disabled=e[4]),64&o&&(f.value=e[6]),h.$set(f)},i(e){m||(ye(u.$$.fragment,e),ye(h.$$.fragment,e),m=!0)},o(e){ve(u.$$.fragment,e),ve(h.$$.fragment,e),m=!1},d(e){e&&x(t),e&&x(o),e&&x(s),e&&x(d),Ne(u,e),e&&x(f),Ne(h,e),p=!1,E(g)}}}function Zs(e,t,n){const r=Q(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:f}=t;const{noCalendar:h,preset:m}=a.properties||{};let p,g,w="%d.%m.%Y",y="%d.%m.%Y";return e.$$set=e=>{"value"in e&&n(13,o=e.value),"id"in e&&n(0,s=e.id),"item"in e&&n(14,a=e.item),"noForm"in e&&n(1,l=e.noForm),"classId"in e&&n(2,d=e.classId),"required"in e&&n(3,u=e.required),"disabled"in e&&n(4,f=e.disabled)},e.$$.update=()=>{if(8304&e.$$.dirty&&o){if((o?.from||o?.to)&&(n(5,p=o?.from),n(6,g=o?.to)),m){const{first:e,last:t}=function(e){const t=new Date;let n=t.getFullYear();const r=t.getMonth();let i,o;switch(t.getDate(),e){case"currentMonth":i=o=r;break;case"currentYear":i=0,o=i+11;break;case"lastSemiYear":i=r<6?6:0,o=i+5,i>5&&--n;break;case"lastQuarter":i=r<3?9:r<6?0:r<9?3:6,o=i+2,i>8&&--n;break;case"lastMonth":i=o=0===r?11:r-1,11===i&&--n;break;default:i=0,o=i+11,--n}return{first:new Date(n,i,1),last:new Date(n,o+1,0)}}(m);e&&!p&&n(5,p=e),t&&!g&&n(6,g=t)}"Invalid Date"===p?.toString()&&n(5,p=void 0),"Invalid Date"===g?.toString()&&n(6,g=void 0),f&&(void 0===p&&n(7,w=""),void 0===g&&n(8,y=""))}},[s,l,d,u,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=Gr(e.value,p)),g&&p&&g.valueOf()-p.valueOf()<0&&n(5,p=void 0),n(13,o.from=p,o),r("change",{value:p,range:"_from"})},({detail:e})=>{n(6,g=Gr(e.value,g)),g&&p&&g.valueOf()-p.valueOf()<0&&n(6,g=void 0),n(13,o.to=g,o),r("change",{value:g,range:"_to"})},o,a,function(){p=this.value,n(5,p),n(13,o),n(6,g),n(4,f)},function(){g=this.value,n(6,g),n(13,o),n(5,p),n(4,f)}]}class Ks extends Re{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=O("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",R(document.head,t)),Te(this,e,Zs,Ys,b,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var Qs={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function ea(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ta(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ta(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var na={normalizePrecision:function(e){var t=e.reduce(function(e,t){return Math.max(e.getPrecision(),t.getPrecision())});return e.map(function(e){return e.getPrecision()!==t?e.convertPrecision(t):e})},minimum:function(e){var t=ea(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.lessThan(e)?i:e}),i},maximum:function(e){var t=ea(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function ra(e){return!isNaN(parseInt(e))&&isFinite(e)}function ia(e){return e%2==0}function oa(e){return ra(e)&&!Number.isInteger(e)}function sa(e){return Math.abs(e)%1==.5}function aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n])}(i,t.headers),i.send()})}function la(e){return void 0===e}function ca(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===Js(e[1])){var r=ca(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function da(){var e=function(e,t){var n=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)},t={HALF_ODD:function(e){var t=Math.round(e);return sa(e)&&ia(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return sa(e)?ia(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return sa(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return sa(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return sa(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(t,n){return oa(t)||oa(n)?e(t,n):t*n},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(e){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](e)}}}var ua=da();function fa(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,r){return(i=e.endpoint,!Boolean(i)||"object"!==Js(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return aa(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return ca(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function ha(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function ma(e){ha(function(e){return ra(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function pa(e){ha(Number.isInteger(e),"You must provide an integer.",TypeError)}var ga=da(),wa=Object.assign(function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;pa(r),pa(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},f=function(e){ha(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(e){return u.call(this,{locale:e})},getPrecision:function(){return o},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;pa(e);var n=this.getPrecision(),r=e>n,i=r?ga.multiply:ga.divide,o=r?[e,n]:[n,e],s=Math.pow(10,ga.subtract.apply(ga,o));return u.call(this,{amount:ga.round(i(this.getAmount(),s),t),precision:e})},add:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ga.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ga.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:ga.round(ga.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:ga.round(ga.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return ma(e),this.multiply(ga.divide(e,100),t)},allocate:function(e){var t=this;!function(e){ha(function(e){return e.length>0&&e.every(function(e){return e>=0})&&e.some(function(e){return e>0})}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce(function(e,t){return ga.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(ga.divide(ga.multiply(t.getAmount(),e),n));return r=ga.subtract(r,i),u.call(t,{amount:i})}),o=0;r>0;)e[o]>0&&(i[o]=i[o].add(u.call(this,{amount:1})),r=ga.subtract(r,1)),o+=1;return i},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,i=void 0===r?d.endpoint:r,o=n.propertyPath,s=void 0===o?d.propertyPath||"rates.{{to}}":o,a=n.headers,c=void 0===a?d.headers:a,f=n.roundingMode,h=void 0===f?l:f,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:h});return fa(m).getExchangeRate(this.getCurrency(),e).then(function(n){return ha(!la(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:ga.round(ga.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==ga.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==ga.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=function(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter(function(e){return!la(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return la(this.getMatches().find(e))?0:this.getMatches()[ua.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find(function(e){return"USD"===e||"dollar"===e||"$"===e})]},getStyle:function(){return la(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!la(this.getMatches().find(function(e){return","===e}))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:a);return this.toRoundedUnit(t.getMinimumFractionDigits(),e).toLocaleString(this.getLocale(),{currencyDisplay:t.getCurrencyDisplay(),useGrouping:t.getUseGrouping(),minimumFractionDigits:t.getMinimumFractionDigits(),style:t.getStyle(),currency:this.getCurrency()})},toUnit:function(){return ga.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,n=Math.pow(10,e);return ga.divide(ga.round(ga.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Qs,na),ya={},va={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+(t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+n+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let o=0;o<i;o++)e[r[o]]="strict"===n?[t[r[o]]]:t[r[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){const t=r.exec(e);return!(null==t)},e.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const i=[];i.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let e=0;e<o;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n},e.nameRegexp=n}(va);const Ia=va,$a={allowBooleanAttributes:!1,unpairedTags:[]};function _a(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ca(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return Da("InvalidXml","XML declaration allowed only at the start of the document.",Oa(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Ea(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}ya.validate=function(e,t){t=Object.assign({},$a,t);const n=[];let r=!1,i=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=Ca(e,o),o.err)return o}else{if("<"!==e[o]){if(_a(e[o]))continue;return Da("InvalidChar","char '"+e[o]+"' is not expected.",Oa(e,o))}{let s=o;if(o++,"!"===e[o]){o=Ea(e,o);continue}{let a=!1;"/"===e[o]&&(a=!0,o++);let l="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)l+=e[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!ka(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Da("InvalidTag",t,Oa(e,o))}const c=Sa(e,o);if(!1===c)return Da("InvalidAttr","Attributes for '"+l+"' have open quote.",Oa(e,o));let d=c.value;if(o=c.index,"/"===d[d.length-1]){const n=o-d.length;d=d.substring(0,d.length-1);const i=Ta(d,t);if(!0!==i)return Da(i.err.code,i.err.msg,Oa(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Da("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Oa(e,o));if(d.trim().length>0)return Da("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Oa(e,s));if(0===n.length)return Da("InvalidTag","Closing tag '"+l+"' has not been opened.",Oa(e,s));{const t=n.pop();if(l!==t.tagName){let n=Oa(e,t.tagStartPos);return Da("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Oa(e,s))}0==n.length&&(i=!0)}}else{const a=Ta(d,t);if(!0!==a)return Da(a.err.code,a.err.msg,Oa(e,o-d.length+a.err.line));if(!0===i)return Da("InvalidXml","Multiple possible root nodes found.",Oa(e,o));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:s}),r=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=Ea(e,o);continue}if("?"!==e[o+1])break;if(o=Ca(e,++o),o.err)return o}else if("&"===e[o]){const t=Ra(e,o);if(-1==t)return Da("InvalidChar","char '&' is not expected.",Oa(e,o));o=t}else if(!0===i&&!_a(e[o]))return Da("InvalidXml","Extra text at the end",Oa(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Da("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Oa(e,n[0].tagStartPos)):!(n.length>0)||Da("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Da("InvalidXml","Start tag expected.",1)};const Aa='"',ba="'";function Sa(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Aa||e[t]===ba)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const Na=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Ta(e,t){const n=Ia.getAllMatches(e,Na),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Da("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Ma(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Da("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Ma(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Da("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Ma(n[e]));const i=n[e][2];if(!xa(i))return Da("InvalidAttr","Attribute '"+i+"' is an invalid name.",Ma(n[e]));if(r.hasOwnProperty(i))return Da("InvalidAttr","Attribute '"+i+"' is repeated.",Ma(n[e]));r[i]=1}return!0}function Ra(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function Da(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xa(e){return Ia.isName(e)}function ka(e){return Ia.isName(e)}function Oa(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ma(e){return e.startIndex+e[1].length}var Pa={};const Ba={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};Pa.buildOptions=function(e){return Object.assign({},Ba,e)},Pa.defaultOptions=Ba;var La=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};const Fa=va;function Va(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const r=e[t++];let i="";for(;t<e.length&&e[t]!==r;t++)i+=e[t];return[n,i,t]}function Ua(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function Wa(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function Ha(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function za(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function ja(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function qa(e){if(Fa.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var Ga=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,i=!1,o=!1,s="";for(;t<e.length;t++)if("<"!==e[t]||o)if(">"===e[t]){if(o?"-"===e[t-1]&&"-"===e[t-2]&&(o=!1,r--):r--,0===r)break}else"["===e[t]?i=!0:s+=e[t];else{if(i&&Wa(e,t))t+=7,[entityName,val,t]=Va(e,t+1),-1===val.indexOf("&")&&(n[qa(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&Ha(e,t))t+=8;else if(i&&za(e,t))t+=8;else if(i&&ja(e,t))t+=9;else{if(!Ua)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const Xa=/^[-+]?0x[a-fA-F0-9]+$/,Ya=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Za={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var Ka=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1};const Qa=va,Ja=La,el=Ga,tl=function(e,t={}){if(t=Object.assign({},Za,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if(t.hex&&Xa.test(n))return Number.parseInt(n,16);{const r=Ya.exec(n);if(r){const i=r[1],o=r[2];let s=function(e){if(e&&-1!==e.indexOf("."))return"."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e;return e}(r[3]);const a=r[4]||r[6];if(!t.leadingZeros&&o.length>0&&i&&"."!==n[2])return e;if(!t.leadingZeros&&o.length>0&&!i&&"."!==n[1])return e;{const r=Number(n),l=""+r;return-1!==l.search(/[eE]/)||a?t.eNotation?r:e:-1!==n.indexOf(".")?"0"===l&&""===s||l===s||i&&l==="-"+s?r:e:o?s===l||i+s===l?r:e:n===l||n===i+l?r:e}}return e}},nl=Ka;function rl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function il(e,t,n,r,i,o,s){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,i,o);if(null==r)return e;if(typeof r!=typeof e||r!==e)return r;if(this.options.trimValues)return gl(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?gl(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function ol(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const sl=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function al(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=Qa.getAllMatches(e,sl),r=n.length,i={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let o=n[e][4],s=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[s]=null==e?o:typeof e!=typeof o||e!==o?e:gl(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[s]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const ll=function(e){e=e.replace(/\r\n?/g,"\n");const t=new Ja("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=hl(e,">",o,"Closing Tag is not closed.");let s=e.substring(o+2,t).trim();if(this.options.removeNSPrefix){const e=s.indexOf(":");-1!==e&&(s=s.substr(e+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(r=this.saveTextToParentTag(r,n,i));const a=i.substring(i.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=i.lastIndexOf("."),i=i.substring(0,l),n=this.tagsNodeStack.pop(),r="",o=t}else if("?"===e[o+1]){let t=ml(e,o,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,i),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new Ja(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i)}o=t.closeIndex+1}else if("!--"===e.substr(o+1,3)){const t=hl(e,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=e.substring(o+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=t}else if("!D"===e.substr(o+1,2)){const t=el(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=hl(e,"]]>",o,"CDATA is not closed.")-2,s=e.substring(o+9,t);r=this.saveTextToParentTag(r,n,i);let a=this.parseTextData(s,n.tagname,i,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=t+2}else{let s=ml(e,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let c=s.tagExp,d=s.attrExpPresent,u=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,i,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==t.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(e,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,t=n.tagContent}const r=new Ja(a);a!==c&&d&&(r[":@"]=this.buildAttributesMap(c,i,a)),t&&(t=this.parseTextData(t,a,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new Ja(a);a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),i=i.substr(0,i.lastIndexOf("."))}else{const e=new Ja(a);this.tagsNodeStack.push(n),a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),n=e}r="",o=u}}else r+=e[o]}return t.child};function cl(e,t,n){const r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const dl=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function ul(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function fl(e,t,n){const r="*."+n;for(const n in e){const i=e[n];if(r===i||t===i)return!0}return!1}function hl(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function ml(e,t,n,r=">"){const i=function(e,t,n=">"){let r,i="";for(let o=t;o<e.length;o++){let t=e[o];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:i,index:o};if(e[o+1]===n[1])return{data:i,index:o}}else"\t"===t&&(t=" ");i+=t}}(e,t+1,r);if(!i)return;let o=i.data;const s=i.index,a=o.search(/\s/);let l=o,c=!0;-1!==a&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const d=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==i.data.substr(e+1))}return{tagName:l,tagExp:o,closeIndex:s,attrExpPresent:c,rawTagName:d}}function pl(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=hl(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(i--,0===i))return{tagContent:e.substring(r,n),i:o};n=o}else if("?"===e[n+1]){n=hl(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=hl(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=hl(e,"]]>",n,"StopNode is not closed.")-2}else{const r=ml(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function gl(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:tl(e,n))}return Qa.isExist(e)?e:""}var wl=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=rl,this.parseXml=ll,this.parseTextData=il,this.resolveNameSpace=ol,this.buildAttributesMap=al,this.isItStopNode=fl,this.replaceEntitiesValue=dl,this.readStopNodeData=pl,this.saveTextToParentTag=ul,this.addChild=cl,this.ignoreAttributesFn=nl(this.options.ignoreAttributes)}},yl={};function vl(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Il(s);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=s[a]:r+=""+s[a];else{if(void 0===a)continue;if(s[a]){let e=vl(s[a],t,l);const n=_l(e,t);s[":@"]?$l(e,s[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==i[a]&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(e)):t.isArray(a,l,n)?i[a]=[e]:i[a]=e}}}return"string"==typeof r?r.length>0&&(i[t.textNodeName]=r):void 0!==r&&(i[t.textNodeName]=r),i}function Il(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function $l(e,t,n,r){if(t){const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];r.isArray(o,n+"."+o,!0,!0)?e[o]=[t[o]]:e[o]=t[o]}}}function _l(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}yl.prettify=function(e,t){return vl(e,t)};const{buildOptions:Cl}=Pa,El=wl,{prettify:Al}=yl,bl=ya;var Sl=class{constructor(e){this.externalEntities={},this.options=Cl(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=bl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new El(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Al(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Nl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Tl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Dl(c,t)||(e=t.tagValueProcessor(l,e),e=xl(e,t)),o&&(i+=r),i+=e,o=!1;continue}if(l===t.cdataPropName){o&&(i+=r),i+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,o=!1;continue}if(l===t.commentPropName){i+=r+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const e=Rl(a[":@"],t),n="?xml"===l?"":r;let s=a[l][0][t.textNodeName];s=0!==s.length?" "+s:"",i+=n+`<${l}${s}${e}?>`,o=!0;continue}let d=r;""!==d&&(d+=t.indentBy);const u=r+`<${l}${Rl(a[":@"],t)}`,f=Nl(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":f&&0!==f.length||!t.suppressEmptyNode?f&&f.endsWith(">")?i+=u+`>${f}${r}</${l}>`:(i+=u+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?i+=r+t.indentBy+f+r:i+=f,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function Tl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(e.hasOwnProperty(r)&&":@"!==r)return r}}function Rl(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=xl(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Dl(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function xl(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const kl=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Nl(e,t,"",n)},Ol=Ka,Ml={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Pl(e){this.options=Object.assign({},Ml,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ol(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Fl),this.processTextOrObjNode=Bl,this.options.format?(this.indentate=Ll,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Bl(e,t,n,r){const i=this.j2x(e,n+1,r.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function Ll(e){return this.options.indentBy.repeat(e)}function Fl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Pl.prototype.build=function(e){return this.options.preserveOrder?kl(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},Pl.prototype.j2x=function(e,t,n){let r="",i="";const o=n.join(".");for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(void 0===e[s])this.isAttribute(s)&&(i+="");else if(null===e[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,"",t);else if("object"!=typeof e[s]){const n=this.isAttribute(s);if(n&&!this.ignoreAttributesFn(n,o))r+=this.buildAttrPairStr(n,""+e[s]);else if(!n)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const r=e[s].length;let o="",a="";for(let l=0;l<r;l++){const r=e[s][l];if(void 0===r);else if(null===r)"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof r)if(this.options.oneListGroup){const e=this.j2x(r,t+1,n.concat(s));o+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else o+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),o+=e}else o+=this.buildTextValNode(r,s,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,a,t)),i+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],""+e[s][t[i]])}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Pl.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},Pl.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,o="";return"?"===t[0]&&(o="?",i=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===o.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+o+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+"<"+t+n+o+">"+e+i}},Pl.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},Pl.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+"</"+t+this.tagEndChar}},Pl.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};for(var Vl={XMLParser:Sl,XMLValidator:ya,XMLBuilder:Pl},Ul=[],Wl=0;Wl<256;++Wl)Ul.push((Wl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class Hl extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class zl extends Hl{constructor(e){super(e)}}class jl extends Hl{constructor(e){super(e)}}const ql=e=>e.Id.IBAN?{iban:e.Id.IBAN}:{...e.Id?.Othr?.Id&&{accountNumber:String(e.Id.Othr.Id)},...e.Nm&&{name:e.Nm},...e.Ccy&&{currency:e.Ccy}},Gl=e=>{if(e){if(e.FinInstnId?.BIC)return{bic:e.FinInstnId.BIC};if(e.FinInstnId?.BICFI)return{bic:e.FinInstnId.BICFI};if(e.FinInstnId){const t=e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId?.MmbId;if(t)return{abaRoutingNumber:t.toString()}}}},Xl=(e,t="USD")=>{const n=wa({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},Yl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},Zl=e=>{const t=e.Id.toString(),n=e.ElctrncSeqNb,r=e.LglSeqNb,i=new Date(e.CreDtTm);let o,s;e.FrToDt&&(o=new Date(e.FrToDt.FrDtTm),s=new Date(e.FrToDt.ToDtTm));const a=e.TxsSummry?.TtlNtries.NbOfNtries,l=e.TxsSummry?.TtlNtries.Sum,c=e.TxsSummry?.TtlNtries.TtlNetNtryAmt;let d;c&&(d=Xl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries.Sum,h=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=ql(e.Acct),g=Gl(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(Kl):e.Bal&&(w=[Kl(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(Ql):e.Ntry&&(y=[Ql(e.Ntry)]),{id:t,electronicSequenceNumber:n,legalSequenceNumber:r,creationDate:i,fromDate:o,toDate:s,account:p,agent:g,numOfEntries:a,sumOfEntries:l,netAmountOfEntries:d,numOfCredits:u,sumOfCredits:f,numOfDebits:h,sumOfDebits:m,balances:w,entries:y}},Kl=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=Xl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:Yl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},Ql=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=Yl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=Xl(o,s),l=e.BkTxCd.Prtry?.Cd,c=(e=>{if(e)return Array.isArray(e)?e.join("\n"):e})(e.AddtlNtryInf),d=e.AcctSvcrRef,u=ec(e.BkTxCd);let f=e.NtryDtls||[];Array.isArray(f)||(f=[f]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:f.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(Jl)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},Jl=e=>{const t=e.Refs?.MsgId,n=e.Refs?.AcctSvcrRef,r=e.Refs?.PmtInfId,i=e.RmtInf?.Ustrd,o=e.Purp?.Prtry,s=e.RtrInf?.Rsn,a=e.RtrInf?.AddtlInf,l=e.Refs?.EndToEndId,c=e.Amt["@_Ccy"],d=e.Amt["#text"],u=e.RmtInf?.Strd?.CdtrRefInf?.Ref?.toString(),f=e.RmtInf?.Strd?.AddtlRmtInf;let h,m,p,g,w,y,v,I;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm||e.RltdPties.Dbtr.Pty?.Nm),e.RltdPties?.DbtrAcct&&(p=ql(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=Gl(e.RltdAgts.DbtrAgt)),(m||p||g)&&(h={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm||e.RltdPties.Cdtr.Pty?.Nm),e.RltdPties?.CdtrAcct&&(v=ql(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&(I=Gl(e.RltdAgts.CdtrAgt)),(y||v||I)&&(w={name:y,account:v,agent:I}),{messageId:t,accountServicerReferenceId:n,endToEndId:l,currency:c,amount:d,paymentInformationId:r,remittanceInformation:i,proprietaryPurpose:o,returnReason:s,returnAdditionalInformation:a,debtor:h,creditor:w,invoiceRef:u,invoiceRefAdd:f}},ec=e=>{const t=e?.Domn?.Cd,n=e?.Domn?.Fmly?.Cd,r=e?.Domn?.Fmly?.SubFmlyCd,i=e.Prtry?.Cd,o=e.Prtry?.Issr;return{domainCode:t,domainFamilyCode:n,domainSubFamilyCode:r,proprietaryCode:i,proprietaryCodeIssuer:o}};class tc{_messageId;_creationDate;_recipient;_statements;constructor(e){this._messageId=e.messageId,this._creationDate=e.creationDate,this._recipient=e.recipient,this._statements=e.statements}static getParser(){return new Vl.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=tc.getParser().parse(e);if(!t.Document)throw new zl("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new jl("Invalid CAMT.053 namespace");const n=t.Document.BkToCstmrStmt,r=n.GrpHdr.CreDtTm,i=new Date(r);let o=[];o=Array.isArray(n.Stmt)?n.Stmt.map(e=>Zl(e)):[Zl(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new tc({messageId:n.GrpHdr.MsgId.toString(),creationDate:i,recipient:s?(a=s,{id:a.Id?.OrgId?.Othr?.Id,name:a.Nm}):void 0,statements:o});var a}get balances(){return this._statements.flatMap(e=>e.balances)}get transactions(){return this._statements.flatMap(e=>e.entries).flatMap(e=>e.transactions)}get entries(){return this._statements.flatMap(e=>e.entries)}get messageId(){return this._messageId}get recipient(){return this._recipient}get creationDate(){return this._creationDate}get statements(){return this._statements}}function nc(e){let t,n,r,i,o;function s(t){e[17](t)}let a={class:e[0],id:e[1],name:e[2],accept:"text/xml",max:"1",beforeChange:e[13]};return void 0!==e[3]&&(a.files=e[3]),t=new e[7]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[12]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function rc(e){let t,n;return t=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment)},m(e,r){Se(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.inputClass=e[0]),2&n&&(r.id=e[1]),2&n&&(r.name=e[1]),16&n&&(r.value=e[4]),t.$set(r)},i(e){n||(ye(t.$$.fragment,e),n=!0)},o(e){ve(t.$$.fragment,e),n=!1},d(e){Ne(t,e)}}}function ic(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[oc]},$$scope:{ctx:e}}}),{c(){t=O("div"),be(n.$$.fragment),j(t,"margin-top","1em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,t){const r={};1073741888&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function oc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=P(e[6]),n=B(),be(r.$$.fragment)},m(e,o){D(e,t,o),D(e,n,o),Se(r,e,o),i=!0},p(e,n){(!i||64&n)&&H(t,e[6])},i(e){i||(ye(r.$$.fragment,e),i=!0)},o(e){ve(r.$$.fragment,e),i=!1},d(e){e&&x(t),e&&x(n),Ne(r,e)}}}function sc(e){let t,n,r,i,o;const s=[rc,nc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&ic(e);return{c(){n.c(),r=B(),l&&l.c(),i=L()},m(e,n){a[t].m(e,n),D(e,r,n),l&&l.m(e,n),D(e,i,n),o=!0},p(e,[t]){n.p(e,t),e[5]?l?(l.p(e,t),32&t&&ye(l,1)):(l=ic(e),l.c(),ye(l,1),l.m(i.parentNode,i)):l&&(ge(),ve(l,1,1,()=>{l=null}),we())},i(e){o||(ye(n),ye(l),o=!0)},o(e){ve(n),ve(l),o=!1},d(e){a[t].d(e),e&&x(r),l&&l.d(e),e&&x(i)}}}function ac(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=c,l=Q();let{classId:d}=n,{eventId:u}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n;const g="camt53"===h.properties?.type;let w=[],y=f[h.name]||"",v=!!f._id,I=!1,$="In Verarbeitung!";const _=async(e,n,r,i,o,s)=>{try{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a?.length){let e=a[0].listBill.find(e=>i&&e.reference.replaceAll(" ","")===i);if(!e&&s&&(e=a[0].listBill.find(e=>e.iban.replaceAll(" ","")===s&&+e.amount==+o)),e)return e.bill}}catch{}return""},C=async(e,n,r,i,o,s,a=[])=>{try{if("credit"!==e)return"";let i,o=N(n);if(o.startsWith("R-")||(o=""),!o&&r&&(r=r.toString(),o=N(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}const l=+Number.parseFloat(+s-.04).toFixed(2),c=+Number.parseFloat(+s+.04).toFixed(2);if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id)&&e.__total>=l&&e.__total<=c)return e._id}}catch{}return""},E=async(e,n,r)=>{try{if(!e)return;const n=await t.getSectionView("incomingPayment",{invoice:e});if(!n?.length)return;const i=n[0];return r===i._total&&i._id}catch{}},A=async e=>{try{if(!e)return;const n=await t.getSectionView("outgoingPayment",{bill:e});if(n?.length)return n[0]._id}catch{}},b=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},S=async(e,n)=>{try{const i=n.output.class[0].list,o=await(async e=>{if(!e.includes("xsd:camt.053"))return;let t;try{t=tc.fromXML(e)}catch(e){console.log("error",e)}return t})(e);if(!o||!o.messageId)return r(6,$="Das ist keine camt53 Datei!"),void r(5,I=!0);const s=await t.getSectionView("dailyJournal",{messageId:o.messageId});if(s?.length)return r(6,$="Bereits eingelesen!"),void r(5,I=!0);o._saldo=o.balances[1].amount/100,o._saldoDate_from=o.balances[0].date,o._saldoDate_to=o.balances[1].date;let a=!0;for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=o[e.properties.source];if(e.properties?.required&&!t){a=!1;break}if("dateRange"===e.type){const t=o[e.properties.source+"_from"],n=o[e.properties.source+"_to"];l("record",{itemName:e.name+"_from",value:t}),l("record",{itemName:e.name+"_to",value:n});continue}"[object Date]"===Object.prototype.toString.call(t)&&(t=new Date(t)),l("record",{itemName:e.name,value:t})}if(!a)return r(6,$="Ungültiger Inhalt!"),void r(5,I=!0);l("record",{itemName:"status",value:"offen"}),await Promise.all(i.map(async e=>await(async(e,t,n)=>{if(f._id)return;if(!e.process)return;n.output.class[0].name;const i=e.process.target;if(!i)return;r(6,$="In Verarbeitung!"),r(5,I=!0);const o=[],s=[],{refItem:a,value:c}=e.process.filter;for(const n of t[e.source]){const t=await b(n.account?.iban);for(const r of n.entries){if(r[a]!==c)continue;let l="SALA"===r.bankTransactionCode?.domainSubFamilyCode,d=!1;for(const a of r.transactions){let c=await C(r.creditDebitIndicator,a.invoiceRef,a.remittanceInformation,e.process.creditor,a.debtor,a.amount,s),u=await E(c,r.bookingDate,a.amount);!1===u&&(c=void 0,u=void 0);const f=await _(r.creditDebitIndicator,l,a.paymentInformationId,a.invoiceRef,a.amount,a.creditor?.account?.iban),h=await A(f),m="",p="",g={accountServicerReferenceId:a.accountServicerReferenceId,messageId:a.messageId,account:n.account.iban,accountDebit:t,creditDebitIndicator:r.creditDebitIndicator,bookingDate:r.bookingDate,amount:a.amount,currency:a.currency,debtor:a.debtor?.name||"",debtorAccount:a.debtor?.account?.iban||"",creditor:a.creditor?.name||"",creditorAccount:a.creditor?.account?.iban||"",paymentInformationId:a.paymentInformationId,invoiceRef:a.invoiceRef,invoiceRefAdd:a.invoiceRefAdd,remittanceInformation:a.remittanceInformation,returnAdditionalInformation:a.returnAdditionalInformation,additionalInformation:r.additionalInformation,invoice:c,incomingPayment:u,payDebtorAvis:p,isSalary:l,bill:f,outgoingPayment:h,journalFinAcc:m};if(l){if(d)continue;g.amount=r.amount/100,d=!0}g[i]?o.push(g):s.push(g)}}}o.length&&l("record",{itemName:e.name,value:o}),s.length&&l("record",{itemName:"open"+e.name,value:s})})(e,o,n))),setTimeout(()=>{l("saveFull"),r(5,I=!1)},2e3)}catch{r(6,$="Ungültiger Inhalt!"),r(5,I=!0)}},N=e=>{try{if(!e?.length)return"";if(e.length<14)return"";const t=e.replaceAll(" ","").slice(-14),n=t.slice(-8),r=t.slice(0,4);let i="";for(let e=0;e<r.length/2;e++){const t=2*e,n=r.substring(t,t+2);i+=String.fromCharCode(n)}return i+n}catch{}return""};return e.$$set=e=>{"classId"in e&&r(0,d=e.classId),"eventId"in e&&r(14,u=e.eventId),"record"in e&&r(15,f=e.record),"item"in e&&r(16,h=e.item),"id"in e&&r(1,m=e.id),"name"in e&&r(2,p=e.name)},e.$$.update=()=>{8&e.$$.dirty&&(w.length||r(5,I=!1))},[d,m,p,w,y,I,$,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(u);if(n){r(4,y=n.name);const t=await n.text();if(g)return S(t,i);const o=(e=>{var t={toObj:function(e){var n={};if(1==e.nodeType){if(e.attributes.length)for(var r=0;r<e.attributes.length;r++)n["@"+e.attributes[r].nodeName]=(e.attributes[r].nodeValue||"").toString();if(e.firstChild){for(var i=0,o=0,s=!1,a=e.firstChild;a;a=a.nextSibling)1==a.nodeType?s=!0:3==a.nodeType&&a.nodeValue.match(/[^ \f\n\r\t\v]/)?i++:4==a.nodeType&&o++;if(s)if(i<2&&o<2)for(t.removeWhite(e),a=e.firstChild;a;a=a.nextSibling)3==a.nodeType?n["#text"]=t.escape(a.nodeValue):4==a.nodeType?n["#cdata"]=t.escape(a.nodeValue):n[a.nodeName]?n[a.nodeName]instanceof Array?n[a.nodeName][n[a.nodeName].length]=t.toObj(a):n[a.nodeName]=[n[a.nodeName],t.toObj(a)]:n[a.nodeName]=t.toObj(a);else e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(i)e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(o)if(o>1)n=t.escape(t.innerXml(e));else for(a=e.firstChild;a;a=a.nextSibling)n["#cdata"]=t.escape(a.nodeValue)}e.attributes.length||e.firstChild||(n=null)}else 9==e.nodeType&&(n=t.toObj(e.documentElement));return n},toJson:function(e,n,r){var i=n?'"'+n+'"':"";if(e instanceof Array){for(var o=0,s=e.length;o<s;o++)e[o]=t.toJson(e[o],"",r+"\t");i+=(n?":[":"[")+(e.length>1?"\n"+r+"\t"+e.join(",\n"+r+"\t")+"\n"+r:e.join(""))+"]"}else if(null==e)i+=(n&&":")+"null";else if("object"==typeof e){var a=[];for(var l in e)a[a.length]=t.toJson(e[l],l,r+"\t");i+=(n?":{":"{")+(a.length>1?"\n"+r+"\t"+a.join(",\n"+r+"\t")+"\n"+r:a.join(""))+"}"}else i+="string"==typeof e?(n&&":")+'"'+e.toString()+'"':(n&&":")+e.toString();return i},innerXml:function(e){var t="";if("innerHTML"in e)t=e.innerHTML;else for(var n=function(e){var t="";if(1==e.nodeType){t+="<"+e.nodeName;for(var r=0;r<e.attributes.length;r++)t+=" "+e.attributes[r].nodeName+'="'+(e.attributes[r].nodeValue||"").toString()+'"';if(e.firstChild){t+=">";for(var i=e.firstChild;i;i=i.nextSibling)t+=n(i);t+="</"+e.nodeName+">"}else t+="/>"}else 3==e.nodeType?t+=e.nodeValue:4==e.nodeType&&(t+="<![CDATA["+e.nodeValue+"]]>");return t},r=e.firstChild;r;r=r.nextSibling)t+=n(r);return t},escape:function(e){return e.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(e){e.normalize();for(var n=e.firstChild;n;)if(3==n.nodeType)if(n.nodeValue.match(/[^ \f\n\r\t\v]/))n=n.nextSibling;else{var r=n.nextSibling;e.removeChild(n),n=r}else 1==n.nodeType?(t.removeWhite(n),n=n.nextSibling):n=n.nextSibling;return e}};return e=(new window.DOMParser).parseFromString(e,"text/xml"),t.toObj(t.removeWhite(e))})(t),s=[],a=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(a.Ntry);for(const e of c){let t=[].concat(e.NtryDtls.TxDtls);for(const n of t){const t=n.RmtInf?.Strd?.CdtrRefInf?.Ref||n.Refs.EndToEndId||"",r={date:e.ValDt.Dt,branchName:n.RltdPties?.Dbtr?.Nm||"",amount:n.AmtDtls?.TxAmt?.Amt["#text"]||n.Amt["#text"],reference:t,invoiceId:N(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},u,f,h,function(e){w=e,r(3,w)}]}class lc extends Re{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=O("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",R(document.head,t)),Te(this,e,ac,sc,b,{classId:0,eventId:14,record:15,item:16,id:1,name:2})}}const cc=e=>{const t={},n=e.replaceAll("\r","").split("\n");return n?(t.iban=n[3],t.supplierText=n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9],t.supplier={company:{}},t.supplier.company.companyName=n[5],t.supplier.company.postcode=n[8],t.amount=n[18],t.amountOrg=n[18],t.currency={},t.currency.designation=n[19],t.reference=n[28],t.additionalInfo=n[29],t.extReference=dc(10,n[31]),t.amountVat=uc(!0,dc(32,n[31]),t.amount)||uc(!1,dc(33,n[31]),t.amount),t):t},dc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},uc=(e,t,n)=>{if(!t)return"";let r=0;if(t.includes(":")){const n=t.split(";");for(const t of n){const[n,i]=t.split(":");r+=e?i/100*n:i}}else r=+n/(+t+100)*+t;return r},{document:fc}=_e;function hc(e){let t,n,r,i,o;function s(t){e[14](t)}let a={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[10]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[8]),i=new e[6]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function mc(e){let t,n,r,i;n=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&pc(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),16&r&&(i.value=e[4]),n.$set(i),e[4]?o?(o.p(e,r),16&r&&ye(o,1)):(o=pc(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function pc(e){let t,n,r,i,o;return n=new ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-o0hiko")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[9]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function gc(e){let t,n,r,i;const o=[mc,hc],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}let wc;function yc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=Q();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,m=[],p=d[u.name]||"",g=!!d._id;const w={scale:{once:!1,value:1,start:1,step:.2,stop:1.6},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}};var y=async function(e){if(!e.success)return;const n=await t.getSchema(l),i=e.codes?.filter(e=>!!e)?.at(0);if(!i?.length)return;if(!i.startsWith("SPC"))return;const o=cc(i);for(const e in o){if(n.items.find(t=>t.name===e)){if("object"==typeof o[e]){let n={};for(const i in o[e])if("object"==typeof o[e][i])for(const s in o[e][i]){o[e][i][s]&&(n[s]=o[e][i][s]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(11,d[e]=n[0]._id,d)}}else{o[e][i]&&(n[i]=o[e][i]);const s=await t.getSectionView(e,n);s?.length&&r(11,d[e]=s[0]._id,d)}}else o[e]&&r(11,d[e]=o[e],d);s("record",{itemName:e,value:d[e]})}}};return Z(()=>{if(wc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){wc=PDF_QR_JS}}),K(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(12,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(13,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name)},[a,f,h,m,p,i,o,g,async e=>{const n=m[0];if(!n){s("record",{itemName:"$file",value:!1});const e=await t.getSchema(l);for(const t of e.items)s("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,p=n.name),s("record",{itemName:"$file",value:{fileName:p,file:n}}),wc.decodeDocument(i,w,y)},async()=>{if(!d?._id)return;const e=await t.getTaskByDocId(d._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r="/viewer/doc/index.html?file="+("/api/userreport/"+n[0]._id)+"&type=pdf";window.open(r,"","popup=yes toolbar=no width=800 height=1024")},()=>{r(3,m)},d,l,u,function(e){m=e,r(3,m)}]}class vc extends Re{constructor(e){var t;super(),fc.getElementById("svelte-o0hiko-style")||((t=O("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(fc.head,t)),Te(this,e,yc,gc,b,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Ic}=_e;function $c(e){let t,n,r,i,o;function s(t){e[18](t)}let a={class:e[0],id:e[1],name:e[2],accept:e[3],max:"1",beforeChange:e[12]};return void 0!==e[4]&&(a.files=e[4]),t=new e[7]({props:a}),te.push(()=>Ae(t,"files",s)),t.$on("change",e[9]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[5]}}),{c(){be(t.$$.fragment),r=B(),be(i.$$.fragment)},m(e,n){Se(t,e,n),D(e,r,n),Se(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),8&r&&(o.accept=e[3]),!n&&16&r&&(n=!0,o.files=e[4],ce(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),32&r&&(s.value=e[5]),i.$set(s)},i(e){o||(ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!0)},o(e){ve(t.$$.fragment,e),ve(i.$$.fragment,e),o=!1},d(e){Ne(t,e),e&&x(r),Ne(i,e)}}}function _c(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[5]}});let o=e[5]&&Cc(e);return{c(){t=O("div"),be(n.$$.fragment),r=B(),o&&o.c(),j(t,"position","relative")},m(e,s){D(e,t,s),Se(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),32&r&&(i.value=e[5]),n.$set(i),e[5]?o?(o.p(e,r),32&r&&ye(o,1)):(o=Cc(e),o.c(),ye(o,1),o.m(t,null)):o&&(ge(),ve(o,1,1,()=>{o=null}),we())},i(e){i||(ye(n.$$.fragment,e),ye(o),i=!0)},o(e){ve(n.$$.fragment,e),ve(o),i=!1},d(e){e&&x(t),Ne(n),o&&o.d()}}}function Cc(e){let t,n,r,i,o;const s=[Ac,Ec],a=[];function l(e,n){return 32&n&&(t=!!e[5].endsWith(".mp4")),t?0:1}return n=l(e,-1),r=a[n]=s[n](e),{c(){r.c(),i=L()},m(e,t){a[n].m(e,t),D(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(ge(),ve(a[o],1,1,()=>{a[o]=null}),we(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),ye(r,1),r.m(i.parentNode,i))},i(e){o||(ye(r),o=!0)},o(e){ve(r),o=!1},d(e){a[n].d(e),e&&x(i)}}}function Ec(e){let t,n,r,i,o;return n=new ke({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-o0hiko")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[10]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Ac(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:Nc,then:Sc,catch:bc,value:23};return Ie(e[11](),n),{c(){t=L(),n.block.c()},m(e,r){D(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){$e(n,e=t,r)},i:$,o:$,d(e){e&&x(t),n.block.d(e),n.token=null,n=null}}}function bc(e){return{c:$,m:$,p:$,d:$}}function Sc(e){let t,n,r,i;return{c(){t=O("video"),n=O("source"),i=P("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&W(n,"src",r),W(n,"type","video/mp4"),W(t,"width","500"),t.controls=!0,j(t,"margin-top","1em")},m(e,r){D(e,t,r),R(t,n),R(t,i)},p:$,d(e){e&&x(t)}}}function Nc(e){return{c:$,m:$,p:$,d:$}}function Tc(e){let t,n,r,i;const o=[_c,$c],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=L()},m(e,n){s[t].m(e,n),D(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(ge(),ve(s[l],1,1,()=>{s[l]=null}),we(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),ye(n,1),n.m(r.parentNode,r))},i(e){i||(ye(n),i=!0)},o(e){ve(n),i=!1},d(e){s[t].d(e),e&&x(r)}}}function Rc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=Q();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Z(()=>{(async()=>{if(!p)return;const e=await t.getTaskByDocId(p,!0);if(!e)return s("listRecord",{itemName:"fileName",value:"",string:!0});const n=d[u.name];if(!n)return s("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return s("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return s("listRecord",{itemName:"fileName",value:"",string:!0});r(5,y=o.fileName),r(6,v=void 0===m?!!p:!!y)})()}),K(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(13,l=e.eventId),"record"in e&&r(14,d=e.record),"item"in e&&r(15,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name),"praefix"in e&&r(16,m=e.praefix),"recordId"in e&&r(17,p=e.recordId),"fileType"in e&&r(3,g=e.fileType)},[a,f,h,g,w,y,v,i,o,async e=>{const t=w[0];URL.createObjectURL(t),r(5,y=t.name),s("record",{itemName:"$file",value:{fileName:y,file:t}}),void 0!==m&&s("listRecord",{itemName:"fileName",value:y,string:!0})},async()=>{if(!p)return;let e;const n=await t.getTaskByDocId(p,!0);if(!n)return;const r=await t.getUserReports(n._id);if(!r?.length)return;let i=r.find(e=>e.fileName===y);i||(i=r[0]);e="/viewer/doc/index.html?file="+("/api/userreport/"+i._id)+"&type=pdf",window.open(e,"","popup=yes toolbar=no width=800 height=1024")},async()=>{const e=await t.getTaskByDocId(p,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===y);return r||(r=n[0]),"/api/userreport/"+r._id},()=>{r(4,w)},l,d,u,m,p,function(e){w=e,r(4,w)}]}class Dc extends Re{constructor(e){var t;super(),Ic.getElementById("svelte-o0hiko-style")||((t=O("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(Ic.head,t)),Te(this,e,Rc,Tc,b,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function xc(e){let t,n,r;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:kc,placeholder:Oc,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=O("div"),be(n.$$.fragment),j(t,"max-width","4em")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p(e,[t]){const r={};4&t&&(r.inputClass=e[2]),1&t&&(r.id=e[0]),1&t&&(r.name=e[0]),2&t&&(r.value=e[1]),8&t&&(r.readonly=e[3]),16&t&&(r.disabled=e[4]),n.$set(r)},i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}const kc="([01][0-9]|2[0-3]):([0-5][0-9])",Oc="";function Mc(e,t,n){const r=Q(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:f}=t;const h=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,o=e.id),"item"in e&&n(7,s=e.item),"value"in e&&n(1,a=e.value),"inputClass"in e&&n(2,l=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class Pc extends Re{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=O("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",R(document.head,t)),Te(this,e,Mc,xc,b,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Bc}=_e;function Lc(e,t,n){const r=e.slice();return r[22]=t[n],r}function Fc(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function Vc(e){let t,n,r=e[3](e[22],e[25])+"",i=e[27]&&function(){let e;return{c(){e=P(", ")},m(t,n){D(t,e,n)},d(t){t&&x(e)}}}();return{c(){t=O("span"),i&&i.c(),n=P(r),W(t,"class","lookupValue")},m(e,r){D(e,t,r),i&&i.m(t,null),R(t,n)},p(e,t){3&t&&r!==(r=e[3](e[22],e[25])+"")&&H(n,r)},d(e){e&&x(t),i&&i.d()}}}function Uc(e){let t,n,r,i,o,s,a,l,c,d=e[0],u=[];for(let t=0;t<d.length;t+=1)u[t]=Vc(Fc(e,d,t));i=new st({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new ke({props:{size:"18"}}),{c(){t=O("span"),t.textContent="  /  ",n=B(),r=O("span"),be(i.$$.fragment),o=B(),s=O("span"),s.textContent="Rechnung",W(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){D(d,t,u),D(d,n,u),D(d,r,u),Se(i,r,null),D(d,o,u),D(d,s,u),a=!0,l||(c=F(r,"click",function(){A(e[5](e[22]._id))&&e[5](e[22]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||(ye(i.$$.fragment,e),a=!0)},o(e){ve(i.$$.fragment,e),a=!1},d(e){e&&x(t),e&&x(n),e&&x(r),Ne(i),e&&x(o),e&&x(s),l=!1,c()}}}(e);return{c(){t=O("div");for(let e=0;e<u.length;e+=1)u[e].c();n=B(),r=O("span"),be(i.$$.fragment),o=B(),f&&f.c(),s=B(),W(r,"class","feather pointer svelte-1jurfpd"),W(t,"class","lookupItem svelte-1jurfpd")},m(d,h){D(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,n),R(t,r),Se(i,r,null),R(t,o),f&&f.m(t,null),R(t,s),a=!0,l||(c=F(r,"click",function(){A(e[4](e[22]._id))&&e[4](e[22]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=Fc(e,d,r);u[r]?u[r].p(o,i):(u[r]=Vc(o),u[r].c(),u[r].m(t,n))}for(;r<u.length;r+=1)u[r].d(1);u.length=d.length}e[2]&&f.p(e,i)},i(e){a||(ye(i.$$.fragment,e),ye(f),a=!0)},o(e){ve(i.$$.fragment,e),ve(f),a=!1},d(e){e&&x(t),k(u,e),Ne(i),f&&f.d(),l=!1,c()}}}function Wc(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Uc(Lc(e,r,t));const o=e=>ve(i[e],1,1,()=>{i[e]=null});return{c(){t=O("div");for(let e=0;e<i.length;e+=1)i[e].c();W(t,"class","lookup svelte-1jurfpd")},m(e,r){D(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(63&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=Lc(e,r,s);i[s]?(i[s].p(o,n),ye(i[s],1)):(i[s]=Uc(o),i[s].c(),ye(i[s],1),i[s].m(t,null))}for(ge(),s=r.length;s<i.length;s+=1)o(s);we()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ye(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ve(i[e]);n=!1},d(e){e&&x(t),k(i,e)}}}function Hc(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{notifyList:l}=n;const{refItem:c,view:d,beforeSave:u,_state:f,addAttachment:h}=o.properties;let p=d.split(","),[g,w]=c.split(":"),y=[];const[v,I]=w.split("."),$=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},_=(e=!0)=>{ae().then(()=>{const t=document.querySelector("div.form-field."+o.name);if(t&&(t.style.display=e?"none":"flex"),!e&&u){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return Z(_),e.$$set=e=>{"id"in e&&r(6,i=e.id),"item"in e&&r(7,o=e.item),"praefix"in e&&r(8,s=e.praefix),"record"in e&&r(9,a=e.record),"notifyList"in e&&r(10,l=e.notifyList)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==g)return;if(r(1,y=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[g])return _();const o=!p.some(e=>e.includes(":")),s=I?I+"."+g:g;let l={[s]:a[g]||a._id};f&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f}}]);let c=!1;if(!s.includes(".")){const e=(await t.getSchemaByClass(v)).items.find(e=>e.name===s);e?.properties?.multi&&(c=!0)}if(r(1,y=await t.getSectionView(v,l,o,!0,c)),!o&&y.length){const e=p.find(e=>e.includes(":")),t=e.split(":")[0];r(1,y=y.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,p=p.map(e=>e.split(":")[1]))}_(!y.length)})(l)},[p,y,h,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||$(e,t),e=>async()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=n._id,i=`/task/${n.event}/${r}/task?view=standalone`;window.open(i)},e=>async()=>{let n;const r=await t.getTaskByDocId(e,!0);if(!r)return;const i=await t.getUserReports(r._id);if(!i?.length)return;n="/viewer/doc/index.html?file="+("/api/userreport/"+i[0]._id)+"&type=pdf",window.open(n,"","popup=yes toolbar=no width=800 height=1024")},i,o,s,a,l]}class zc extends Re{constructor(e){var t;super(),Bc.getElementById("svelte-1jurfpd-style")||((t=O("style")).id="svelte-1jurfpd-style",t.textContent=".feather.svelte-1jurfpd{position:absolute;top:0;left:-1.5em;color:#4300b0}.feather2.svelte-1jurfpd{color:#4300b0}div.lookup.svelte-1jurfpd{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1jurfpd{position:relative;margin-left:2em;padding-bottom:0.75em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}div.field:has(div.lookup){margin-bottom:0.25em !important}",R(Bc.head,t)),Te(this,e,Hc,Wc,b,{id:6,item:7,praefix:8,record:9,notifyList:10})}}function jc(e){let t,n,r;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function qc(e){let t,n,r,i,o;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[9]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Gc(e){let t,n,r,i,o,s;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const a=[qc,jc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function Xc(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){J(e,t)}]}class Yc extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Xc,Gc,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Zc(e){let t,n,r;return n=new Et({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function Kc(e){let t,n,r,i,o;return n=new Et({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function Qc(e){let t,n,r,i,o,s;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[15]);const a=[Kc,Zc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};4&r&&(s.inputClass=e[2]),1&r&&(s.pattern=e[0]),2&r&&(s.placeholder=e[1]),8&r&&(s.disabled=e[3]),16&r&&(s.formnovalidate=e[4]),32&r&&(s.readonly=e[5]),64&r&&(s.required=e[6]),128&r&&(s.id=e[7]),256&r&&(s.name=e[8]),512&r&&(s.value=e[9]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function Jc(e,t,r){let i;const{TextField:o}=c,{environment:s}=u;S(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:d}=t,{formnovalidate:f}=t,{readonly:h}=t,{required:m}=t,{id:p}=t,{name:g}=t,{value:w}=t,{pattern:y}=t,{placeholder:v}=t,{notifyList:I}=t,{country:$}=t;y||="(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))?\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*(\\d{1,2})$",v||="+41 58 234 56 78";const _={ch:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",li:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",de:"^((\\+49|0049)\\s?)?(0|\\s?)?\\d{2,5}(\\s?\\d){4,9}$",at:"^((\\+43|0043)\\s?)?(0\\s?)?[1-9]\\d{1,4}(\\s?\\d){4,10}$",us:"^((\\+1|001)\\s?)?(\\d{3}\\s?){2}\\d{4}$",zh:"^((\\+86|0086)\\s?)?((1\\d{10})|(0\\d{2,3}\\s?\\d{7,8}))$"},C={ch:"+41 58 234 5678",li:"+41 58 234 5678",de:"+49 619 1234 5678",at:"+43 800 123 456",us:"+1 2345 678 901",zh:"+86 123 456 7589"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,d=e.disabled),"formnovalidate"in e&&r(4,f=e.formnovalidate),"readonly"in e&&r(5,h=e.readonly),"required"in e&&r(6,m=e.required),"id"in e&&r(7,p=e.id),"name"in e&&r(8,g=e.name),"value"in e&&r(9,w=e.value),"pattern"in e&&r(0,y=e.pattern),"placeholder"in e&&r(1,v=e.placeholder),"notifyList"in e&&r(13,I=e.notifyList),"country"in e&&r(14,$=e.country)},e.$$.update=()=>{8192&e.$$.dirty&&(async e=>{const{listName:t,itemName:n,value:o}=e||{},s=i?.country?.countryCode?.toLowerCase()||a.lang;$&&n===$&&o?up("country",o).then(e=>{if(e.phonePattern)r(0,y=e.phonePattern),r(1,v=e.phonePlaceholder||"");else{const t=e.countryCode.toLowerCase();_[t]&&(r(0,y=_[t]),r(1,v=C[t]))}}).catch(()=>{r(0,y=_[s]),r(1,v=C[s])}):$&&(r(0,y=_[s]),r(1,v=C[s]))})(I)},[y,v,l,d,f,h,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},I,$,function(t){J(e,t)}]}class ed extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,Jc,Qc,b,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1,notifyList:13,country:14})}}function td(e){let t,n,r;return n=new yt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather2 svelte-9up2nn")},m(e,i){D(e,t,i),Se(n,t,null),r=!0},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n)}}}function nd(e){let t,n,r,i,o;return n=new yt({props:{size:"18"}}),{c(){t=O("span"),be(n.$$.fragment),W(t,"class","feather pointer svelte-9up2nn")},m(s,a){D(s,t,a),Se(n,t,null),r=!0,i||(o=F(t,"click",e[12]),i=!0)},p:$,i(e){r||(ye(n.$$.fragment,e),r=!0)},o(e){ve(n.$$.fragment,e),r=!1},d(e){e&&x(t),Ne(n),i=!1,o()}}}function rd(e){let t,n,r,i,o,s;n=new e[11]({props:{type:"email",inputClass:e[0],pattern:e[9],placeholder:e[10],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],multiple:e[8],value:e[7]}}),n.$on("change",e[13]);const a=[nd,td],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),be(n.$$.fragment),r=B(),o.c(),j(t,"position","relative")},m(e,o){D(e,t,o),Se(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),512&r&&(s.pattern=e[9]),1024&r&&(s.placeholder=e[10]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),256&r&&(s.multiple=e[8]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ge(),ve(l[d],1,1,()=>{l[d]=null}),we(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),ye(o,1),o.m(t,null))},i(e){s||(ye(n.$$.fragment,e),ye(o),s=!0)},o(e){ve(n.$$.fragment,e),ve(o),s=!1},d(e){e&&x(t),Ne(n),l[i].d()}}}function id(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{multiple:h}=t,{pattern:m}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"multiple"in e&&n(8,h=e.multiple),"pattern"in e&&n(9,m=e.pattern),"placeholder"in e&&n(10,p=e.placeholder)},[i,o,s,a,l,d,u,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){J(e,t)}]}class od extends Re{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=O("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",R(document.head,t)),Te(this,e,id,rd,b,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const sd=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","CommentChange","CompositionEnd","CompositionStart","CompositionUpdate","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","Input","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function ad(e){let t;return{c(){t=O("textarea"),W(t,"id",e[0]),j(t,"visibility","hidden")},m(n,r){D(n,t,r),e[20](t)},p(e,n){1&n&&W(t,"id",e[0])},d(n){n&&x(t),e[20](null)}}}function ld(e){let t;return{c(){t=O("div"),W(t,"id",e[0])},m(n,r){D(n,t,r),e[19](t)},p(e,n){1&n&&W(t,"id",e[0])},d(n){n&&x(t),e[19](null)}}}function cd(e){let t;function n(e,t){return e[1]?ld:ad}let r=n(e),i=r(e);return{c(){t=O("div"),i.c(),W(t,"class",e[2])},m(n,r){D(n,t,r),i.m(t,null),e[21](t)},p(e,[o]){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null))),4&o&&W(t,"class",e[2])},i:$,o:$,d(n){n&&x(t),i.d(),e[21](null)}}}const dd=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let ud=(()=>{let e={listeners:[],scriptId:dd("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,r)=>{e.scriptLoaded?r():(e.listeners.push(r),e.injected||((t,n,r,i)=>{e.injected=!0;const o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=r,o.onload=()=>{i()},n.head&&n.head.appendChild(o)})(e.scriptId,t,n,()=>{e.listeners.forEach(e=>e()),e.scriptLoaded=!0}))}}})();function fd(e,t,n){let r,i,o,{id:s=dd("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:f="7"}=t,{scriptSrc:h}=t,{conf:m={}}=t,{modelEvents:p="change input undo redo"}=t,{value:g=""}=t,{text:w=""}=t,{cssClass:y="tinymce-wrapper"}=t,v=g,I=l,$=c;const _=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},C=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},E=Q(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},b=()=>{var e;const t=Object.assign(Object.assign({},m),{target:i,inline:void 0!==a?a:void 0!==m.inline&&m.inline,license_key:u,setup:e=>{e.on("PreInit",()=>{C(e,l),_(e,c)}),n(15,o=e),e.on("init",()=>{e.setContent(g),e.on(p,()=>{n(16,v=e.getContent()),v!==g&&(n(5,g=v),n(6,w=e.getContent({format:"text"})))})}),((e,t)=>{sd.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,E),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return Z(()=>{if(null!==A())b();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;ud.load(r.ownerDocument,e,()=>{b()})}}),K(()=>{var e;o&&(null===(e=A())||void 0===e||e.remove(o))}),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,l=e.disabled),"readonly"in e&&n(8,c=e.readonly),"apiKey"in e&&n(9,d=e.apiKey),"licenseKey"in e&&n(10,u=e.licenseKey),"channel"in e&&n(11,f=e.channel),"scriptSrc"in e&&n(12,h=e.scriptSrc),"conf"in e&&n(13,m=e.conf),"modelEvents"in e&&n(14,p=e.modelEvents),"value"in e&&n(5,g=e.value),"text"in e&&n(6,w=e.text),"cssClass"in e&&n(2,y=e.cssClass)},e.$$.update=()=>{491936&e.$$.dirty&&(o&&v!==g&&(o.setContent(g),n(6,w=o.getContent({format:"text"}))),o&&c!==$&&(n(18,$=c),_(o,c)),o&&l!==I&&(n(17,I=l),C(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,f,h,m,p,o,v,I,$,function(e){te[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){te[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){te[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class hd extends Re{constructor(e){super(),Te(this,e,fd,cd,b,{id:0,inline:1,disabled:7,readonly:8,apiKey:9,licenseKey:10,channel:11,scriptSrc:12,conf:13,modelEvents:14,value:5,text:6,cssClass:2})}}function md(e){let t,n,r,i,o,s,a;function l(t){e[9](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",licenseKey:"gpl",conf:e[7],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new hd({props:c}),te.push(()=>Ae(n,"value",l)),{c(){t=O("div"),be(n.$$.fragment),i=B(),o=O("input"),W(o,"class",s=e[1]||e[2]),W(o,"id",e[3]),W(o,"name",e[3]),o.value=e[0],o.hidden=!0,j(t,"min-height","10em"),j(t,"margin-top","-1em")},m(e,r){D(e,t,r),Se(n,t,null),R(t,i),R(t,o),a=!0},p(e,t){const i={};16&t&&(i.disabled=e[4]),32&t&&(i.readonly=e[5]),!r&&1&t&&(r=!0,i.value=e[0],ce(()=>r=!1)),n.$set(i),(!a||6&t&&s!==(s=e[1]||e[2]))&&W(o,"class",s),(!a||8&t)&&W(o,"id",e[3]),(!a||8&t)&&W(o,"name",e[3]),(!a||1&t&&o.value!==e[0])&&(o.value=e[0])},i(e){a||(ye(n.$$.fragment,e),a=!0)},o(e){ve(n.$$.fragment,e),a=!1},d(e){e&&x(t),Ne(n)}}}function pd(e){let t,n,r=e[6]&&md(e);return{c(){r&&r.c(),t=L()},m(e,i){r&&r.m(e,i),D(e,t,i),n=!0},p(e,[n]){e[6]?r?(r.p(e,n),64&n&&ye(r,1)):(r=md(e),r.c(),ye(r,1),r.m(t.parentNode,t)):r&&(ge(),ve(r,1,1,()=>{r=null}),we())},i(e){n||(ye(r),n=!0)},o(e){ve(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}let gd=!1;function wd(e,t,r){const i=Q();let o=JSON.parse(n.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let s,{value:a=""}=t,{noForm:l}=t,{classId:c}=t,{id:d}=t,{record:u}=t,{disabled:f}=t,{readonly:h}=t;const m=(e,t)=>{if(!s)return;if(gd)return;if(!e)return;if(!e.includes("{{"))return;const n=p(a,u);n?.length&&(gd=!0,Promise.all(n.map(async(e,n)=>({table:await up(e.table,t[e.table]).catch(()=>{}),def:e}))).then(t=>{if(t?.length){for(const n of t)for(const t of n.def.attrs)e=e.replace(`{{${n.def.table}.${t}}}`,n.table[t]);i("blur",{value:e})}}).catch(e=>{console.log("error",e)}).finally(()=>{r(0,a=e),gd=!1}))},p=(e,t)=>{const n=e.split("{{").slice(1).map(e=>e.split("}}")[0]);if(n?.length)return n.reduce((e,n)=>{const[r,i]=n.split(".");if(!i)return e;if(!t[r])return e;const o=e.find(e=>e.table===r);return o?o.attrs=o.attrs.concat(i):e.push({table:r,attrs:[i]}),e},[])},g={plugins:"advlist link image lists table preview emoticons fullscreen",menu:{file:{title:"File",items:"preview"}},menubar:"edit view insert format table",toolbar:"undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | fullscreen",height:600,language:o};return Z(()=>setTimeout(()=>{r(6,s=!0),m(a,u)},300)),e.$$set=e=>{"value"in e&&r(0,a=e.value),"noForm"in e&&r(1,l=e.noForm),"classId"in e&&r(2,c=e.classId),"id"in e&&r(3,d=e.id),"record"in e&&r(8,u=e.record),"disabled"in e&&r(4,f=e.disabled),"readonly"in e&&r(5,h=e.readonly)},e.$$.update=()=>{257&e.$$.dirty&&m(a,u)},[a,l,c,d,f,h,s,g,u,function(e){a=e,r(0,a)}]}class yd extends Re{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=O("style")).id="svelte-yi7lpi-style",t.textContent="div.tox-statusbar__text-container, div.tox-promotion{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",R(document.head,t)),Te(this,e,wd,pd,b,{value:0,noForm:1,classId:2,id:3,record:8,disabled:4,readonly:5})}}
2
2
  /*!
3
3
  * Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
4
4
  * (c) 2025 Szymon Nowak | Released under the MIT license