@enablerr-ui/detail 0.3.65 → 0.3.66

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,h;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.TextArea,s=e.toasts,a=e.settings,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){h=e.taskClipboard}],execute:function(){function f(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.65");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=>e?"(ja)":"(nein)",w=(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]?g(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]&&g(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!y(e)).join(" · ")).filter(e=>!!e).join(" • ")},y=e=>/^[0-9a-f]{24}/.test(e),v=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};function I(){}function _(e){return e()}function C(){return Object.create(null)}function E(e){e.forEach(_)}function A(e){return"function"==typeof e}function $(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function b(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return I;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function T(e,t,n=t){return e.set(n),t}function N(e,t){e.appendChild(t)}function R(e,t,n){e.insertBefore(t,n||null)}function D(e){e.parentNode.removeChild(e)}function x(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 k(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function M(e){return document.createTextNode(e)}function P(){return M(" ")}function B(){return M("")}function L(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function F(e){return function(t){return t.preventDefault(),e.call(this,t)}}function V(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function U(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 W(e,t){e.value=null==t?"":t}function z(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function j(e,t,n){e.classList[n?"add":"remove"](t)}let G;function q(e){G=e}function X(){if(!G)throw new Error("Function called outside component initialization");return G}function Y(e){X().$$.on_mount.push(e)}function Z(e){X().$$.on_destroy.push(e)}function K(){const e=X();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 Q(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const J=[],ee=[],te=[],ne=[],re=Promise.resolve();let ie=!1;function oe(){ie||(ie=!0,re.then(ue))}function se(){return oe(),re}function ae(e){te.push(e)}function le(e){ne.push(e)}let ce=!1;const de=new Set;function ue(){if(!ce){ce=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];q(t),he(t.$$)}for(q(null),J.length=0;ee.length;)ee.pop()();for(let e=0;e<te.length;e+=1){const t=te[e];de.has(t)||(de.add(t),t())}te.length=0}while(J.length);for(;ne.length;)ne.pop()();ie=!1,ce=!1,de.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(ae)}}const fe=new Set;let me;function pe(){me={r:0,c:[],p:me}}function ge(){me.r||E(me.c),me=me.p}function we(e,t){e&&e.i&&(fe.delete(e),e.i(t))}function ye(e,t,n,r){if(e&&e.o){if(fe.has(e))return;fe.add(e),me&&me.c.push(()=>{fe.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function ve(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&&(pe(),ye(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),ge())}):t.block.d(1),a.c(),we(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&ue()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=X();if(e.then(e=>{q(n),r(t.then,1,t.value,e),q(null)},e=>{if(q(n),r(t.catch,2,t.error,e),q(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 Ie(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){ye(e,1,1,()=>{t.delete(e.key)})}function Ee(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Ae(e){e&&e.c()}function $e(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||ae(()=>{const t=o.map(_).filter(A);s?s.push(...t):E(t),e.$$.on_mount=[]}),a.forEach(ae)}function be(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 Se(e,t,n,r,i,o,s=[-1]){const a=G;q(e);const l=e.$$={fragment:null,ctx:null,props:o,update:I,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]&&(J.push(e),oe(),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(D)}else l.fragment&&l.fragment.c();t.intro&&we(e.$$.fragment),$e(e,t.target,t.anchor,t.customElement),ue()}q(a)}class Te{$destroy(){be(this,1),this.$destroy=I}$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 Ne(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polygon"),U(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"),U(r,"points","12 15 17 21 7 21 12 15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-airplay "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Re(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 De extends Te{constructor(e){super(),Se(this,e,Re,Ne,$,{size:0,strokeWidth:1,class:2})}}function xe(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("line"),i=k("line"),U(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"),U(r,"x1","12"),U(r,"y1","9"),U(r,"x2","12"),U(r,"y2","13"),U(i,"x1","12"),U(i,"y1","17"),U(i,"x2","12.01"),U(i,"y2","17"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function Oe(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 Te{constructor(e){super(),Se(this,e,Oe,xe,$,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("circle"),r=k("polyline"),i=k("line"),U(n,"cx","12"),U(n,"cy","12"),U(n,"r","10"),U(r,"points","8 12 12 16 16 12"),U(i,"x1","12"),U(i,"y1","8"),U(i,"x2","12"),U(i,"y2","16"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function Pe(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 Be extends Te{constructor(e){super(),Se(this,e,Pe,Me,$,{size:0,strokeWidth:1,class:2})}}function Le(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("path"),U(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),U(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-book-open "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Fe(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 Ve extends Te{constructor(e){super(),Se(this,e,Fe,Le,$,{size:0,strokeWidth:1,class:2})}}function Ue(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("circle"),U(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"),U(r,"cx","12"),U(r,"cy","13"),U(r,"r","4"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-camera "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function He(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 Te{constructor(e){super(),Se(this,e,He,Ue,$,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),U(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),U(r,"points","22 4 12 14.01 9 11.01"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(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 Ge extends Te{constructor(e){super(),Se(this,e,je,ze,$,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,r;return{c(){t=k("svg"),n=k("path"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",r="feather feather-command "+e[2])},m(e,r){R(e,t,r),N(t,n)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&U(t,"class",r)},i:I,o:I,d(e){e&&D(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 Ye extends Te{constructor(e){super(),Se(this,e,Xe,qe,$,{size:0,strokeWidth:1,class:2})}}function Ze(e){let t,n,r,i;return{c(){t=k("svg"),n=k("polyline"),r=k("path"),U(n,"points","9 10 4 15 9 20"),U(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Ke(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 Qe extends Te{constructor(e){super(),Se(this,e,Ke,Ze,$,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("line"),i=k("line"),U(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),U(r,"x1","18"),U(r,"y1","9"),U(r,"x2","12"),U(r,"y2","15"),U(i,"x1","12"),U(i,"y1","9"),U(i,"x2","18"),U(i,"y2","15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-delete "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function et(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 tt extends Te{constructor(e){super(),Se(this,e,et,Je,$,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),i=k("line"),U(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),U(r,"points","15 3 21 3 21 9"),U(i,"x1","10"),U(i,"y1","14"),U(i,"x2","21"),U(i,"y2","3"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-external-link "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function rt(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 it extends Te{constructor(e){super(),Se(this,e,rt,nt,$,{size:0,strokeWidth:1,class:2})}}function ot(e){let t,n,r,i,o,s;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),i=k("line"),o=k("line"),U(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),U(r,"points","14 2 14 8 20 8"),U(i,"x1","12"),U(i,"y1","18"),U(i,"x2","12"),U(i,"y2","12"),U(o,"x1","9"),U(o,"y1","15"),U(o,"x2","15"),U(o,"y2","15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){R(e,t,s),N(t,n),N(t,r),N(t,i),N(t,o)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&U(t,"class",s)},i:I,o:I,d(e){e&&D(t)}}}function st(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 at extends Te{constructor(e){super(),Se(this,e,st,ot,$,{size:0,strokeWidth:1,class:2})}}function lt(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("circle"),r=k("line"),i=k("path"),U(n,"cx","12"),U(n,"cy","12"),U(n,"r","10"),U(r,"x1","2"),U(r,"y1","12"),U(r,"x2","22"),U(r,"y2","12"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-globe "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(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 dt extends Te{constructor(e){super(),Se(this,e,ct,lt,$,{size:0,strokeWidth:1,class:2})}}function ut(e){let t,n,r,i,o,s,a,l;return{c(){t=k("svg"),n=k("line"),r=k("line"),i=k("line"),o=k("line"),s=k("line"),a=k("line"),U(n,"x1","8"),U(n,"y1","6"),U(n,"x2","21"),U(n,"y2","6"),U(r,"x1","8"),U(r,"y1","12"),U(r,"x2","21"),U(r,"y2","12"),U(i,"x1","8"),U(i,"y1","18"),U(i,"x2","21"),U(i,"y2","18"),U(o,"x1","3"),U(o,"y1","6"),U(o,"x2","3.01"),U(o,"y2","6"),U(s,"x1","3"),U(s,"y1","12"),U(s,"x2","3.01"),U(s,"y2","12"),U(a,"x1","3"),U(a,"y1","18"),U(a,"x2","3.01"),U(a,"y2","18"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",l="feather feather-list "+e[2])},m(e,l){R(e,t,l),N(t,n),N(t,r),N(t,i),N(t,o),N(t,s),N(t,a)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&U(t,"class",l)},i:I,o:I,d(e){e&&D(t)}}}function ht(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 Te{constructor(e){super(),Se(this,e,ht,ut,$,{size:0,strokeWidth:1,class:2})}}function mt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),U(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"),U(r,"points","22,6 12,13 2,6"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-mail "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function pt(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 gt extends Te{constructor(e){super(),Se(this,e,pt,mt,$,{size:0,strokeWidth:1,class:2})}}function wt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("circle"),U(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),U(r,"cx","12"),U(r,"cy","10"),U(r,"r","3"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function yt(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 vt extends Te{constructor(e){super(),Se(this,e,yt,wt,$,{size:0,strokeWidth:1,class:2})}}function It(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("polyline"),r=k("line"),i=k("path"),U(n,"points","23 7 23 1 17 1"),U(r,"x1","16"),U(r,"y1","8"),U(r,"x2","23"),U(r,"y2","1"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function _t(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 Te{constructor(e){super(),Se(this,e,_t,It,$,{size:0,strokeWidth:1,class:2})}}function Et(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("polyline"),r=k("path"),i=k("rect"),U(n,"points","6 9 6 2 18 2 18 9"),U(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"),U(i,"x","6"),U(i,"y","14"),U(i,"width","12"),U(i,"height","8"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-printer "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function At(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 Te{constructor(e){super(),Se(this,e,At,Et,$,{size:0,strokeWidth:1,class:2})}}function bt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("circle"),r=k("line"),U(n,"cx","11"),U(n,"cy","11"),U(n,"r","8"),U(r,"x1","21"),U(r,"y1","21"),U(r,"x2","16.65"),U(r,"y2","16.65"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-search "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function St(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 Tt extends Te{constructor(e){super(),Se(this,e,St,bt,$,{size:0,strokeWidth:1,class:2})}}const{document:Nt}=_e;function Rt(e){e[49]=e[50].items}function Dt(e,t,n){const r=e.slice();return r[51]=t[n],r[53]=n,r}function xt(e,t,n){const r=e.slice();return r[54]=t[n],r}function Ot(e,t,n){const r=e.slice();return r[54]=t[n],r}function kt(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Mt(e){let t,n,r,i,o,s;Rt(e);let a=e[5]?.length&&Pt(e),l=e[49]?.length&&Lt(e),c=e[5]?.length&&Ut(e);return{c(){a&&a.c(),t=P(),n=O("div"),r=O("table"),l&&l.c(),i=P(),o=O("tbody"),c&&c.c(),U(r,"striped",""),U(r,"class","svelte-47aais"),U(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),R(e,t,d),R(e,n,d),N(n,r),l&&l.m(r,null),N(r,i),N(r,o),c&&c.m(o,null),s=!0},p(e,n){Rt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&we(a,1)):(a=Pt(e),a.c(),we(a,1),a.m(t.parentNode,t)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge()),e[49]?.length?l?l.p(e,n):(l=Lt(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&we(c,1)):(c=Ut(e),c.c(),we(c,1),c.m(o,null)):c&&(pe(),ye(c,1,1,()=>{c=null}),ge())},i(e){s||(we(a),we(c),s=!0)},o(e){ye(a),ye(c),s=!1},d(e){a&&a.d(e),e&&D(t),e&&D(n),l&&l.d(),c&&c.d()}}}function Pt(e){let t,n,r,i,o,s,a,l,c,d,u,h=e[6]&&Bt(e);function f(t){e[33](t)}let m={id:e[10]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),ee.push(()=>Ee(i,"value",f)),i.$on("input",e[14]),l=new tt({props:{size:"18"}}),{c(){h&&h.c(),t=P(),n=O("div"),r=M("Suchen: "),Ae(i.$$.fragment),s=P(),a=O("span"),Ae(l.$$.fragment),U(a,"class","feather pointer svelte-47aais"),z(n,"margin-bottom","1em"),z(n,"position","relative")},m(o,f){h&&h.m(o,f),R(o,t,f),R(o,n,f),N(n,r),$e(i,n,null),N(n,s),N(n,a),$e(l,a,null),c=!0,d||(u=L(a,"click",e[16]),d=!0)},p(e,n){e[6]?h?64&n[0]&&we(h,1):(h=Bt(e),h.c(),we(h,1),h.m(t.parentNode,t)):h&&(pe(),ye(h,1,1,()=>{h=null}),ge());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],le(()=>o=!1)),i.$set(r)},i(e){c||(we(h),we(i.$$.fragment,e),we(l.$$.fragment,e),c=!0)},o(e){ye(h),ye(i.$$.fragment,e),ye(l.$$.fragment,e),c=!1},d(e){h&&h.d(e),e&&D(t),e&&D(n),be(i),be(l),d=!1,u()}}}function Bt(e){let t,n;return t=new e[7]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Lt(e){let t,n,r,i=e[4]&&e[0]&&Ft(),o=e[49],s=[];for(let t=0;t<o.length;t+=1)s[t]=Vt(Ot(e,o,t));return{c(){t=O("thead"),n=O("tr"),i&&i.c(),r=P();for(let e=0;e<s.length;e+=1)s[e].c();U(n,"class","svelte-47aais"),U(t,"class","svelte-47aais")},m(e,o){R(e,t,o),N(t,n),i&&i.m(n,null),N(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=Ft(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),8196&t[0]){let r;for(o=e[49],r=0;r<o.length;r+=1){const i=Ot(e,o,r);s[r]?s[r].p(i,t):(s[r]=Vt(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&&D(t),i&&i.d(),x(s,e)}}}function Ft(e){let t;return{c(){t=O("th"),U(t,"class","svelte-47aais")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Vt(e){let t,n,r=e[54]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-47aais")},m(e,r){R(e,t,r),N(t,n)},p(e,t){4&t[0]&&r!==(r=e[54]?.designation+"")&&H(n,r)},d(e){e&&D(t)}}}function Ut(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[51].index||e[51]?._id;for(let t=0;t<o.length;t+=1){let n=Dt(e,o,t),a=s(n);i.set(a,r[t]=jt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);R(e,t,i),n=!0},p(e,n){178239&n[0]&&(o=e[5],pe(),r=function(e,t,n,r,i,o,s,a,l,c,d,u){let h=e.length,f=o.length,m=h;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=f;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){we(e,1),e.m(a,d),s.set(e.key,e),d=e.first,f--}for(;h&&f;){const t=g[f-1],n=e[h-1],r=t.key,i=n.key;t===n?(d=t.first,h--,f--):w.has(i)?!s.has(r)||v.has(r)?_(t):I.has(i)?h--:y.get(r)>y.get(i)?(I.add(r),_(t)):(v.add(i),h--):(l(n,s),h--)}for(;h--;){const t=e[h];w.has(t.key)||l(t,s)}for(;f;)_(g[f-1]);return g}(r,n,s,1,e,o,i,t.parentNode,Ce,jt,t,Dt),ge())},i(e){if(!n){for(let e=0;e<o.length;e+=1)we(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ye(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&D(t)}}}function Ht(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Wt(e),l=e[49],c=[];for(let t=0;t<l.length;t+=1)c[t]=zt(xt(e,l,t));return{c(){t=O("tr"),a&&a.c(),n=P();for(let e=0;e<c.length;e+=1)c[e].c();r=P(),U(t,"class","pointer svelte-47aais"),j(t,"active",e[51]._id===e[1]),j(t,"blocked",!!e[51].blocked),j(t,"undeliverable",!!e[51].undeliverable)},m(l,d){R(l,t,d),a&&a.m(t,null),N(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);N(t,r),i=!0,o||(s=L(t,"click",V(function(){A(e[12](e[51],e[53]))&&e[12](e[51],e[53]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&we(a,1)):(a=Wt(e),a.c(),we(a,1),a.m(t,n)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge()),10276&o[0]){let n;for(l=e[49],n=0;n<l.length;n+=1){const i=xt(e,l,n);c[n]?c[n].p(i,o):(c[n]=zt(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]&&j(t,"active",e[51]._id===e[1]),32&o[0]&&j(t,"blocked",!!e[51].blocked),32&o[0]&&j(t,"undeliverable",!!e[51].undeliverable)},i(e){i||(we(a),i=!0)},o(e){ye(a),i=!1},d(e){e&&D(t),a&&a.d(),x(c,e),o=!1,s()}}}function Wt(e){let t,n,r,i,o;return n=new it({props:{size:"18"}}),{c(){t=O("td"),Ae(n.$$.fragment),U(t,"class","editRow svelte-47aais"),z(t,"color","#326173")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",V(function(){A(e[17](e[51]))&&e[17](e[51]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function zt(e){let t,n,r,i=e[11](e[51],e[54])+"";return{c(){t=O("td"),n=M(i),U(t,"class",r=S(e[54].type)+" svelte-47aais")},m(e,r){R(e,t,r),N(t,n)},p(e,o){36&o[0]&&i!==(i=e[11](e[51],e[54])+"")&&H(n,i),4&o[0]&&r!==(r=S(e[54].type)+" svelte-47aais")&&U(t,"class",r)},d(e){e&&D(t)}}}function jt(e,t){let n,r,i,o=t[15](t[51],t[49],t[3]),s=o&&Ht(t);return{key:e,first:null,c(){n=B(),s&&s.c(),r=B(),this.first=n},m(e,t){R(e,n,t),s&&s.m(e,t),R(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[15](t[51],t[49],t[3])),o?s?(s.p(t,n),44&n[0]&&we(s,1)):(s=Ht(t),s.c(),we(s,1),s.m(r.parentNode,r)):s&&(pe(),ye(s,1,1,()=>{s=null}),ge())},i(e){i||(we(s),i=!0)},o(e){ye(s),i=!1},d(e){e&&D(n),s&&s.d(e),e&&D(r)}}}function Gt(e){let t,n;return t=new e[7]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function qt(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Gt,then:Mt,catch:kt,value:50,blocks:[,,,]};return ve(n=e[2]&&e[13](),i),{c(){t=B(),i.block.c()},m(e,n){R(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[13]())&&ve(n,i)||Ie(i,e,r)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),i.block.d(e),i.token=null,i=null}}}const Xt=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))),a||(a=n.items.find(t=>t.name===e)),!a){const n=(await t.getSchemaByClass(e)).items.find(e=>e.name===s);n&&(a={name:e,designation:n.designation,type:n.type,decimals:n.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function Yt(e,i,o){let s;let a=JSON.parse(n.getItem("Locale")).id;const l=K(),{Loading:d,TextField:h}=c,{currentTasks:f}=u;b(e,f,e=>o(37,s=e));let p,w,y,v,{inputList:I}=i,{eventId:_}=i,{prevEventId:C}=i,{record:E}=i,{className:A}=i,{rowId:$}=i,{filterForReady:S=!1}=i,{filter:T}=i,{query:N}=i,{refStatus:R}=i,{showEdit:D=!1}=i,{praefix:x=""}=i,{selectionFields:O=!1}=i,{deList:k}=i,{stopAggregation:M=!1}=i,{shouldBlock:P}=i,{inputSearch:B=""}=i,L=!0,F=B,V=A+Math.floor(9e3*Math.random()+1e3).toString()+"search",U=!1,H=!0;const W=(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("_")){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(a,{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?g(n):m(e[`_${t.name}`]||n||"")},z=t.getSchemaByClass(A),j=async(e,n)=>{if(!e)return[];if(T){let n;const r=T.startsWith("!");r&&(n=T.replace("!",""));const i=T.startsWith("$");if(n&&!i&&(e=e.filter(e=>i?e[n]===$:r?!e[n]:!!e[n])),i){n=T.replace("$","");const[r,i]=n.split(".");if(E[i]){const n=await t.getSectionView(r,{[i]:E[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(R&&!N)return o(18,R=[].concat(R)),e.filter(e=>!!R.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(C){const n=await t.getEvent(C);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===A)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)},G=(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(a,{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},q=async e=>{let n,r=0;H=!1;const i=e=>new Promise(t=>setTimeout(t,e)),s=await z;for(;r++<200&&!M&&!(n=await X(e,s.id));)await i(500);o(6,U=!1),M&&t.readTasksByAggregationId(e,!0),n&&(o(5,y=G(w.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),H=!0},100))},X=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),Z=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(x),c=l&&await Im(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 ym(o+r._id.toString(),r),r}):e};Y(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(V)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await z;e.eventId===t.id&&(_m(t.class,e.eventId),o(2,L=!o(2,L=!1)))});return e.$$set=e=>{"inputList"in e&&o(20,I=e.inputList),"eventId"in e&&o(21,_=e.eventId),"prevEventId"in e&&o(22,C=e.prevEventId),"record"in e&&o(23,E=e.record),"className"in e&&o(24,A=e.className),"rowId"in e&&o(1,$=e.rowId),"filterForReady"in e&&o(25,S=e.filterForReady),"filter"in e&&o(26,T=e.filter),"query"in e&&o(27,N=e.query),"refStatus"in e&&o(18,R=e.refStatus),"showEdit"in e&&o(0,D=e.showEdit),"praefix"in e&&o(28,x=e.praefix),"selectionFields"in e&&o(29,O=e.selectionFields),"deList"in e&&o(30,k=e.deList),"stopAggregation"in e&&o(19,M=e.stopAggregation),"shouldBlock"in e&&o(31,P=e.shouldBlock),"inputSearch"in e&&o(32,B=e.inputSearch)},[D,$,L,F,p,y,U,d,h,f,V,W,(e,t)=>n=>{o(19,M=!0);const r=H?e:v[t];l("choose",{row:r})},async()=>{w=await z,o(4,p=(e=>!s?.length||!!s.find(t=>t===e))(w.id)),N&&o(5,y=v=await t.getTasksFiltered(w.class,N)),y||o(5,y=v=G(w.displaySort,await I||await gm(w.class,w.id))),500!==y?.length||N||(o(6,U=!0),t.getTasksList(w.id,!1,!0).then(({aggregationId:e})=>q(e)));let e,n=!1,r="";const i=O&&O?.find(e=>w.class===e.refClass.split(":")[0]),a=i?.value?.get&&i.value.get(x);if(a){const[s,l]=i.refClass.split(":");w.class===s&&o(5,y=await Z(y,s,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],a,s,"quantity")}o(0,D&&=!i),!i&&(T||S||R)&&o(5,y=await j(y,w));const{display:c}=w;let d=await Xt(c,w,y);return!D&&n?(d=d.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),o(5,y=y.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(!y.find(t=>t._id===e._id)){const t=v.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),y.push(t)}}),l("init",y)):k&&o(5,y=y.filter(e=>!k.find(t=>t?._id===e._id))),P&&o(5,y=y.filter(e=>!e[P])),{items:d}},({detail:{value:e}})=>{o(3,F=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=W(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,F="")},async e=>{let t=e._task;t||(t=await wm(A,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},R,M,I,_,C,E,A,S,T,N,x,O,k,P,B,function(e){F=e,o(3,F)}]}class Zt extends Te{constructor(e){var t;super(),Nt.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}",N(Nt.head,t)),Se(this,e,Yt,qt,$,{inputList:20,eventId:21,prevEventId:22,record:23,className:24,rowId:1,filterForReady:25,filter:26,query:27,refStatus:18,showEdit:0,praefix:28,selectionFields:29,deList:30,stopAggregation:19,shouldBlock:31,inputSearch:32},[-1,-1])}}function Kt(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Qt(e){let t,n,r=e[45]&&Jt(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&we(r,1)):(r=Jt(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Jt(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[dn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function en(e){let t,n;return t=new Am({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function tn(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[rn,nn],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new Zt({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(){Ae(t.$$.fragment),n=P(),i.c(),o=P(),Ae(s.$$.fragment)},m(e,i){$e(t,e,i),R(e,n,i),c[r].m(e,i),R(e,o,i),$e(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):(pe(),ye(c[u],1,1,()=>{c[u]=null}),ge(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),we(i,1),i.m(o.parentNode,o));const h={};32768&n[0]&&(h.inputSearch=e[15]),8&n[0]&&(h.record=e[3]),4&n[0]&&(h.eventId=e[2].id),4&n[0]&&(h.className=e[2].class),16384&n[0]&&(h.prevEventId=e[14]),32&n[0]&&(h.filterForReady=e[5]),64&n[0]&&(h.filter=e[6]),128&n[0]&&(h.query=e[7]),256&n[0]&&(h.refStatus=e[8]),512&n[0]&&(h.praefix=e[9]),1024&n[0]&&(h.selectionFields=e[10]),2&n[0]&&(h.rowId=e[1]),65536&n[0]&&(h.shouldBlock=e[16]),4096&n[0]&&(h.deList=e[12]),16777216&n[0]&&(h.stopAggregation=e[24]),2048&n[0]&&(h.showEdit=e[11]),s.$set(h)},i(e){a||(we(t.$$.fragment,e),we(i),we(s.$$.fragment,e),a=!0)},o(e){ye(t.$$.fragment,e),ye(i),ye(s.$$.fragment,e),a=!1},d(e){be(t,e),e&&D(n),c[r].d(e),e&&D(o),be(s,e)}}}function nn(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[on]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&sn(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),U(t,"class","form--buttons svelte-jb5mrh")},m(e,s){R(e,t,s),$e(n,t,null),N(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]&&we(o,1)):(o=sn(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function rn(e){let t,n,r,i,o,s,a=e[23]&&ln(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[cn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=P(),n=O("div"),Ae(r.$$.fragment),i=P(),Ae(o.$$.fragment),U(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),R(e,t,l),R(e,n,l),$e(r,n,null),R(e,i,l),$e(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&we(a,1)):(a=ln(e),a.c(),we(a,1),a.m(t.parentNode,t)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge());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||(we(a),we(r.$$.fragment,e),we(o.$$.fragment,e),s=!0)},o(e){ye(a),ye(r.$$.fragment,e),ye(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&D(t),e&&D(n),be(r),e&&D(i),be(o,e)}}}function on(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function sn(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[an]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function an(e){let t;return{c(){t=M("Neu")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ln(e){let t,n;return t=new Hd({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function cn(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function dn(e){let t,n,r,i;const o=[tn,en],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=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function un(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function hn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:un,then:Qt,catch:Kt,value:45,blocks:[,,,]};return ve(n=e[30](e[4]),i),{c(){t=B(),i.block.c()},m(e,n){R(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]))&&ve(n,i)||Ie(i,e,r)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),i.block.d(e),i.token=null,i=null}}}function fn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=K(),{currentTasks:d}=u;b(e,d,e=>r(41,i=e));let{title:h}=n,{schema:f}=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:C=!1}=n,{showEdit:E=!0}=n,{deList:A}=n,{newAllowed:$=!0}=n,{prevEventId:S}=n,{inputSearch:T}=n,{shouldBlock:N}=n,R=f.id;f.class;let D,x,O,k,M,P,B,L="",F=!1,V=!1;h??=f.identity.designation;const U=!i?.length||i.find(e=>e===R);return e.$$set=e=>{"title"in e&&r(0,h=e.title),"schema"in e&&r(2,f=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,C=e.selectionFields),"showEdit"in e&&r(11,E=e.showEdit),"deList"in e&&r(12,A=e.deList),"newAllowed"in e&&r(13,$=e.newAllowed),"prevEventId"in e&&r(14,S=e.prevEventId),"inputSearch"in e&&r(15,T=e.inputSearch),"shouldBlock"in e&&r(16,N=e.shouldBlock)},[h,p,f,m,g,w,y,v,I,_,C,E,A,$,S,T,N,L,F,D,O,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await gm(f.class,f.id);if(x=C&&C?.find(e=>f.class===e.refClass.split(":")[0]),r(20,O=x?.value?.get&&x.value.get(_)),O){k=x.refClass;const[e,n]=k.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"),E||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=f.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=f.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})=>{O&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){Q(e,t)}]}class mn extends Te{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}",N(document.head,t)),Se(this,e,fn,hn,$,{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:pn}=_e;function gn(e){e[28]=e[30].list,e[29]=e[30].items}function wn(e,t,n){const r=e.slice();return r[31]=t[n],r}function yn(e,t,n){const r=e.slice();return r[34]=t[n],r}function vn(e,t,n){const r=e.slice();return r[34]=t[n],r}function In(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function _n(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[25](t)}gn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Cn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=En(vn(e,o,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),i=P();for(let e=0;e<s.length;e+=1)s[e].c();U(r,"class","svelte-14hcfjl"),U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,o){R(e,t,o),N(t,n),N(n,r),N(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=vn(e,o,r);s[r]?s[r].p(i,t):(s[r]=En(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&&D(t),x(s,e)}}}(e),C=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=bn(wn(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=wn(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=bn(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){gn(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],le(()=>a=!1)),s.$set(i),e[29]?.length&&_.p(e,t),e[28]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),we(C),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),ye(C),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function Cn(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function En(e){let t,n,r=e[34]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function An(e){let t,n,r,i,o,s,a,l;r=new it({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=$n(yn(e,c,t));return{c(){t=O("tr"),n=O("td"),Ae(r.$$.fragment),i=P();for(let e=0;e<d.length;e+=1)d[e].c();o=P(),U(n,"class","editRow svelte-14hcfjl"),U(t,"class","pointer svelte-14hcfjl"),j(t,"active",e[31]._id===e[0])},m(c,u){R(c,t,u),N(t,n),$e(r,n,null),N(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);N(t,o),s=!0,a||(l=L(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=yn(e,c,n);d[n]?d[n].p(i,r):(d[n]=$n(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&r[0]&&j(t,"active",e[31]._id===e[0])},i(e){s||(we(r.$$.fragment,e),s=!0)},o(e){ye(r.$$.fragment,e),s=!1},d(e){e&&D(t),be(r),x(d,e),a=!1,l()}}}function $n(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function bn(e){let t,n,r=e[13](e[31],e[29],e[1]),i=r&&An(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){2&n[0]&&(r=e[13](e[31],e[29],e[1])),r?i?(i.p(e,n),2&n[0]&&we(i,1)):(i=An(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Sn(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Tn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Sn,then:_n,catch:In,value:30,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Nn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Tn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Rn(e,n,i){const o=K(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:h}=n,{classId:f}=n,{className:p}=n,{rowId:w}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:_}=n,{multiValues:C}=n,E="",A=f+Math.floor(9e3*Math.random()+1e3).toString()+"search";const $=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Y(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(A)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&_m(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,h=e.item),"classId"in e&&i(17,f=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(0,w=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,C=e.multiValues)},[w,E,o,s,a,l,d,u,A,$,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(h.lookup){let r,i,o;if("string"==typeof h.lookup){if(r="."+f+"#"+h.lookup,i=document.querySelector(r),o=i?.value||I,C.has(h.lookup)){const r=C.get(h.lookup)[0];n=r?await t.getSectionView(h.name,{[h.lookup]:r},!0):await gm(h.name,e.id)}else if(o&&24===o.toString().length){const e=await Im(h.lookup,o);if(e){const r=e[h.name]?.map(e=>e[h.name]);r&&(n=await t.getSectionView(h.name,{_id:{$in:r}},!0))}}}else{const{refItem:e,refList:s}=h.lookup,[a,l]=e.split(".");r="."+f+"#"+a,i=document.querySelector(r),o=i?.value||I;let c=await t.getDocById(a,o);if(c&&l&&(c=await t.getDocById(l,c[l])),c){const e=c[s].map(e=>e[h.name]);n=await t.getSectionView(h.name,{_id:{$in:e}},!0)}}}else{const r="."+f+"#"+y.split(":")[0],i=document.querySelector(r);let o={[y]:i?.value||I};if(h.refItem){const e="."+f+"#"+h.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[h.refItem]:t.value},{[h.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 Xt(r,e,n)}},({detail:{value:e}})=>{i(1,E=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if($(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,E="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},h,f,p,y,v,I,_,C,()=>o("back"),function(e){E=e,i(1,E)}]}class Dn extends Te{constructor(e){var t;super(),pn.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}",N(pn.head,t)),Se(this,e,Rn,Nn,$,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23},[-1,-1])}}const{document:xn}=_e;function On(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function kn(e){let t,n,r=e[72]&&function(e){let t,n,r,i,s,a,l,c,d,u,h,f,m,p,g,w,y,v,I;function _(t){e[55](t)}function C(t){e[56](t)}let E={class:"full-width",id:e[32],rows:"1",required:e[2],disabled:e[3],placeholder:e[34],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[25]&&(E.overwrite=e[25]);n=new o({props:E}),ee.push(()=>Ee(n,"value",_)),ee.push(()=>Ee(n,"overwrite",C)),n.$on("click",e[37]()),n.$on("blur",e[44]);const A=[Pn,Mn],$=[];function b(e,t){return!e[3]||e[16]?0:e[22]&&e[0]?1:-1}~(a=b(e))&&(l=$[a]=A[a](e));let T=(!e[3]||e[16]||e[17])&&Bn(e);function x(t){e[57](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[Un]},$$scope:{ctx:e}};void 0!==e[19]&&(k.open=e[19]);m=new e[28]({props:k}),ee.push(()=>Ee(m,"open",x));let M=e[20]&&Hn(e);return{c(){t=O("div"),Ae(n.$$.fragment),s=P(),l&&l.c(),c=P(),d=O("input"),h=P(),T&&T.c(),f=P(),Ae(m.$$.fragment),g=P(),M&&M.c(),w=B(),U(d,"class",u=S(e[9]||e[10])+" svelte-1wtpa4f"),U(d,"id",e[5]),U(d,"name",e[5]),d.value=e[0],d.hidden=!0,z(t,"position","relative")},m(r,i){R(r,t,i),$e(n,t,null),N(t,s),~a&&$[a].m(t,null),N(t,c),N(t,d),N(t,h),T&&T.m(t,null),R(r,f,i),$e(m,r,i),R(r,g,i),M&&M.m(r,i),R(r,w,i),y=!0,v||(I=L(t,"keydown",e[38]),v=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]),!r&&2&o[0]&&(r=!0,s.value=e[1],le(()=>r=!1)),!i&&33554432&o[0]&&(i=!0,s.overwrite=e[25],le(()=>i=!1)),n.$set(s);let h=a;a=b(e),a===h?~a&&$[a].p(e,o):(l&&(pe(),ye($[h],1,1,()=>{$[h]=null}),ge()),~a?(l=$[a],l?l.p(e,o):(l=$[a]=A[a](e),l.c()),we(l,1),l.m(t,c)):l=null),(!y||1536&o[0]&&u!==(u=S(e[9]||e[10])+" svelte-1wtpa4f"))&&U(d,"class",u),(!y||32&o[0])&&U(d,"id",e[5]),(!y||32&o[0])&&U(d,"name",e[5]),(!y||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[16]||e[17]?T?(T.p(e,o),196616&o[0]&&we(T,1)):(T=Bn(e),T.c(),we(T,1),T.m(t,null)):T&&(pe(),ye(T,1,1,()=>{T=null}),ge());const f={};93126097&o[0]|2048&o[2]&&(f.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,f.open=e[19],le(()=>p=!1)),m.$set(f),e[20]?M?(M.p(e,o),1048576&o[0]&&we(M,1)):(M=Hn(e),M.c(),we(M,1),M.m(w.parentNode,w)):M&&(pe(),ye(M,1,1,()=>{M=null}),ge())},i(e){y||(we(n.$$.fragment,e),we(l),we(T),we(m.$$.fragment,e),we(M),y=!0)},o(e){ye(n.$$.fragment,e),ye(l),ye(T),ye(m.$$.fragment,e),ye(M),y=!1},d(e){e&&D(t),be(n),~a&&$[a].d(),T&&T.d(),e&&D(f),be(m,e),e&&D(g),M&&M.d(e),e&&D(w),v=!1,I()}}}(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,t){e[72]&&r.p(e,t)},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Mn(e){let t,n,r,i,o;return n=new it({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[43]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Pn(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=[L(t,"click",e[37](!0)),L(t,"choose",e[40])],i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,E(o)}}}function Bn(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[42]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ln(e){let t,n,r,i;const o=[Vn,Fn],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=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function Fn(e){let t,n;return t=new mn({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[33],query:e[35](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[24],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[26],inputSearch:e[39]()}}),t.$on("choose",e[40]),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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]),16777216&n[0]&&(r.filterForReady=e[24]),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]),67108864&n[0]&&(r.shouldBlock=e[26]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Vn(e){let t,n;return t=new Dn({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8]}}),t.$on("choose",e[40]),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Un(e){let t,n,r=e[19]&&Ln(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&we(r,1)):(r=Ln(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Hn(e){let t,n,r;function i(t){e[58](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[zn]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[28]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|2048&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function Wn(e){let t,n;return t=new Am({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zn(e){let t,n;return t=new e[27]({props:{title:e[21],$$slots:{default:[Wn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|2048&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function jn(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Gn(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:jn,then:kn,catch:On,value:72,blocks:[,,,]};return ve(e[36](),r),{c(){t=B(),r.block.c()},m(e,i){R(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ie(r,e=t,n)},i(e){n||(we(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ye(r.blocks[e])}n=!1},d(e){e&&D(t),r.block.d(e),r.token=null,r=null}}}function qn(e,n,r){let o,s,a,l;b(e,i,e=>r(54,o=e));const d=K(),{Dialog:h,Modal:f}=c,{currentTasks:m,environment:p,loggedIn:g}=u;b(e,m,e=>r(60,s=e)),b(e,p,e=>r(62,l=e)),b(e,g,e=>r(61,a=e));let{id:y}=n,{item:v}=n,{fullRecord:I}=n,{value:_=""}=n,{multiValues:C}=n,{desc:E=""}=n,{noForm:A=!1}=n,{classId:$}=n,{eventId:S}=n,{recordId:T}=n,{withRefValue:N=!1}=n,{refValue:R=""}=n,{shortEdit:D}=n,{required:x}=n,{disabled:O}=n,{readonly:k}=n,{praefix:M}=n,{selectionFields:P}=n,{formnovalidate:B}=n,{selection:L}=n,{deList:F}=n,{isTemplate:V}=n,{noList:U=!1}=n,{multi:H=!1}=n,{initFinished:W}=n;const z="comment_"+y,j=v.filter;let G,q,X,Y,Z,Q,J=!1,ee=!0,te=!0,ne=!0,re=!1,ie="";k||=T&&v.asInput,O||=k,!L&&v.selection&&1===v.selection.split(":").length&&(L=v.selection);const oe=k||O||v.lookup||L&&!v.constraint?"":"Suchbegriff ⏎",se=()=>{v.refItem&&v.refItem.startsWith("owner")&&(r(46,R=l.owner[v.refClass]),R||r(46,R=((e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}})(v.refItem,l)),R&&(r(45,N=!0),d("change",{value:R})))},ae=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{d("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},le=async e=>{const n=()=>{r(19,J=!0)};if(9==e.which)return;if(_)return e.preventDefault();if(13!=e.which)return;e.preventDefault();const i=X.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:h=!1,end:f=!1}=d;if(o.length<u)return n();const m=(h?"^":"")+o+(f?"$":"");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(X.class,p);1!==g?.length?n():r(0,_=g[0]._id)},ce=e=>{e&&(r(53,ie=r(1,E=w(X,e))),d("setRefDesc",E.split(" •")[0]),d("change",{value:_,description:E}),d("task",{row:e,eventId:X.id}))},de=()=>{r(19,J=!1),r(20,G=!1)};return e.$$set=e=>{"id"in e&&r(5,y=e.id),"item"in e&&r(6,v=e.item),"fullRecord"in e&&r(7,I=e.fullRecord),"value"in e&&r(0,_=e.value),"multiValues"in e&&r(8,C=e.multiValues),"desc"in e&&r(1,E=e.desc),"noForm"in e&&r(9,A=e.noForm),"classId"in e&&r(10,$=e.classId),"eventId"in e&&r(11,S=e.eventId),"recordId"in e&&r(12,T=e.recordId),"withRefValue"in e&&r(45,N=e.withRefValue),"refValue"in e&&r(46,R=e.refValue),"shortEdit"in e&&r(49,D=e.shortEdit),"required"in e&&r(2,x=e.required),"disabled"in e&&r(3,O=e.disabled),"readonly"in e&&r(48,k=e.readonly),"praefix"in e&&r(13,M=e.praefix),"selectionFields"in e&&r(14,P=e.selectionFields),"formnovalidate"in e&&r(50,B=e.formnovalidate),"selection"in e&&r(4,L=e.selection),"deList"in e&&r(15,F=e.deList),"isTemplate"in e&&r(16,V=e.isTemplate),"noList"in e&&r(51,U=e.noList),"multi"in e&&r(17,H=e.multi),"initFinished"in e&&r(47,W=e.initFinished)},e.$$.update=()=>{if(4&e.$$.dirty[0]|524288&e.$$.dirty[1]&&r(2,x=x&&!B),49152&e.$$.dirty[1]&&N&&r(0,_=R),3&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&!E&&_&&ie&&r(1,E=ie),399425&e.$$.dirty[0]|1114112&e.$$.dirty[1]&&_&&X){let e=!1;if(!Array.isArray(_)){const t=v.properties?.prefetch?500:0;if(T||v.asInput||v.upate||!1!==v.refItem||!0===H||!1===v.refItem&&W)if(t){const t="p$"+v.refClass+"$"+S,n=pm(t);n?n.then(e=>{const t=e.find(({_id:e})=>e===_);t?ce(t):wm(v.refClass,X.id,_,!!v.lookup||U).then(ce)}):e=!0}else e=!0;e&&wm(v.refClass,X.id,_,!!v.lookup||U).then(ce),r(47,W=!0)}}if(65&e.$$.dirty[0]|10485760&e.$$.dirty[1]&&_&&Y&&v.name===Y.input?.at(0)&&Y.inputLookup?.length){const{domain:e}=Y.inputLookup[0]||{};"user"===e&&(o.some(e=>Y.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,O=!0))}262145&e.$$.dirty[0]&&!_&&X&&ce({})},[_,E,x,O,L,y,v,I,C,A,$,S,T,M,P,F,V,H,X,J,G,q,Z,ee,te,ne,re,h,f,m,p,g,z,j,oe,()=>{if(!v.query)return;const[e,t]=v.query.split(".");if(!I[t])return;let n=[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:I[t]}}];return v.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":v.refStatus}}])),n},async()=>{try{const e=await t.getEvent(S);if(Q="report"===e.output.type,r(24,te=!v.asInput),r(23,ee=e.output?.class[0].name!==v.refClass),r(18,X=await t.getSchemaByClass(v.refClass)),X?.blocked)return d("initFail",!0),!1;if(Q||r(26,re=((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===v.name);if(t?.properties?.blocking)return n.name}return!1})(e,X)),ae(X),r(22,Z=(e=>!s?.length||!!s.find(t=>t===e))(X.id)),r(52,Y=await t.getSchema(S)),S&&T&&_&&!O&&Y.input?.find(e=>e===v.refClass)&&r(3,O=!0),e.input?.class&&e.input.class[0]&&(e.input.class[0].name===v.refClass&&e.input.class[0].readonly&&r(3,O=!0),T&&e.input.class[0].name===v.refClass&&e.input.class[0].writeState)){(await t.getTaskByDocId(T,!0)).status===e.input.class[0].writeState&&r(3,O=r(48,k=!1))}if(v.properties?.query?.lookup){const{domain:e,value:n}=v.properties.query.lookup;if("user"===e){const e=a.user,i={[n]:e},s=await t.getSectionView(v.refClass,i);if(s?.length){const[{_id:e}]=s;e&&(r(46,R=e),r(45,N=!0),d("change",{value:R}))}o.some(e=>X.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,O=!0)}}else se();if(!R&&v.filter&&(""===M||void 0===M)){const e=v.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly(v.refClass,{[v.filter]:n});i&&(r(46,R=i._id),r(45,N=!0),d("change",{value:R}))}return r(21,q=X.identity.designation),!0}catch{return d("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!0===e&&r(19,J=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(v.lookup||L&&!v.constraint||_)&&r(19,J=!0)},le,()=>{if(_)return"";const e=document.getElementById(z);return r(1,E=""),e?.value||""},({detail:e})=>{r(0,_=e.row._id),de()},de,()=>{(Q||Z)&&(H?d("change",{value:_,delete:!0}):(r(0,_=""),r(1,E=""),r(25,ne=!0),d("change",{value:_,description:E}),d("task",{row:{_task:{event:X.id,_id:!1}}})))},async()=>{if(!_)return;let e=await wm(v.refClass,X.id,_);e._task||(e={_task:await t.getTaskByDocId(_,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{_||E&&le({which:13,preventDefault:()=>{},srcElement:{value:E}})},N,R,W,k,D,B,U,Y,ie,o,function(e){E=e,r(1,E),r(0,_),r(53,ie),r(45,N),r(46,R)},function(e){ne=e,r(25,ne)},function(e){J=e,r(19,J)},function(e){G=e,r(20,G)}]}class Xn extends Te{constructor(e){var t;super(),xn.getElementById("svelte-1wtpa4f-style")||((t=O("style")).id="svelte-1wtpa4f-style",t.textContent=".feather.svelte-1wtpa4f{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-1wtpa4f{z-index:10000 !important;position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",N(xn.head,t)),Se(this,e,qn,Gn,$,{id:5,item:6,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:45,refValue:46,shortEdit:49,required:2,disabled:3,readonly:48,praefix:13,selectionFields:14,formnovalidate:50,selection:4,deList:15,isTemplate:16,noList:51,multi:17,initFinished:47},[-1,-1,-1])}}function Yn(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function Zn(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Kn(e){let t,n;return t=new e[16]({props:{outline:!0,$$slots:{default:[er]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};8191&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Qn(e){let t,n,r,i,o;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",function(){A(e[22](e[0]))&&e[22](e[0]).apply(this,arguments)}),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Jn(e){let t,n;return t=new Xn({props:{classId:e[6],eventId:e[7],required:e[9],disabled:e[1],formnovalidate:e[12],readonly:e[10],id:e[2]+"."+e[42],item:e[3],desc:e[4],value:e[40],noForm:e[5],praefix:e[11],recordId:e[8],multi:!0}}),t.$on("change",e[24]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.classId=e[6]),128&n[0]&&(r.eventId=e[7]),512&n[0]&&(r.required=e[9]),2&n[0]&&(r.disabled=e[1]),4096&n[0]&&(r.formnovalidate=e[12]),1024&n[0]&&(r.readonly=e[10]),4&n[0]&&(r.id=e[2]+"."+e[42]),8&n[0]&&(r.item=e[3]),16&n[0]&&(r.desc=e[4]),1&n[0]&&(r.value=e[40]),32&n[0]&&(r.noForm=e[5]),2048&n[0]&&(r.praefix=e[11]),256&n[0]&&(r.recordId=e[8]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function er(e){let t,n,r,i=!e[10]&&Qn(e),o=[].concat(e[0]),s=[];for(let t=0;t<o.length;t+=1)s[t]=Jn(Yn(e,o,t));const a=e=>ye(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=P();for(let e=0;e<s.length;e+=1)s[e].c();n=B()},m(e,o){i&&i.m(e,o),R(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);R(e,n,o),r=!0},p(e,r){if(e[10]?i&&(pe(),ye(i,1,1,()=>{i=null}),ge()):i?(i.p(e,r),1024&r[0]&&we(i,1)):(i=Qn(e),i.c(),we(i,1),i.m(t.parentNode,t)),16785407&r[0]){let t;for(o=[].concat(e[0]),t=0;t<o.length;t+=1){const i=Yn(e,o,t);s[t]?(s[t].p(i,r),we(s[t],1)):(s[t]=Jn(i),s[t].c(),we(s[t],1),s[t].m(n.parentNode,n))}for(pe(),t=o.length;t<s.length;t+=1)a(t);ge()}},i(e){if(!r){we(i);for(let e=0;e<o.length;e+=1)we(s[e]);r=!0}},o(e){ye(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ye(s[e]);r=!1},d(e){i&&i.d(e),e&&D(t),x(s,e),e&&D(n)}}}function tr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function nr(e){let t,n;return t=new e[18]({props:{title:e[14].designation,class:"eList",$$slots:{default:[ir]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),49480&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ir(e){let t,n,r,i,o;return n=new e[19]({props:{outline:!0,$$slots:{default:[rr]},$$scope:{ctx:e}}}),n.$on("click",e[25]),i=new Zt({props:{item:e[3],className:e[14].class,classId:e[6],rowId:e[15],recordId:e[8],inputList:e[21]()}}),i.$on("choose",e[23]),i.$on("back",e[25]),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),Ae(i.$$.fragment),U(t,"class","form--buttons")},m(e,s){R(e,t,s),$e(n,t,null),R(e,r,s),$e(i,e,s),o=!0},p(e,t){const r={};4096&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const o={};8&t[0]&&(o.item=e[3]),16384&t[0]&&(o.className=e[14].class),64&t[0]&&(o.classId=e[6]),32768&t[0]&&(o.rowId=e[15]),256&t[0]&&(o.recordId=e[8]),i.$set(o)},i(e){o||(we(n.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(n.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){e&&D(t),be(n),e&&D(r),be(i,e)}}}function or(e){let t,n,r=e[13]&&nr(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&we(r,1)):(r=nr(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function sr(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:tr,then:Kn,catch:Zn,value:39,blocks:[,,,]};function s(t){e[34](t)}ve(e[20](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[or]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[17]({props:a}),ee.push(()=>Ee(n,"open",s)),{c(){o.block.c(),t=P(),Ae(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,R(e,t,r),$e(n,e,r),i=!0},p(t,i){Ie(o,e=t,i);const s={};57672&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],le(()=>r=!1)),n.$set(s)},i(e){i||(we(o.block),we(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){ye(o.blocks[e])}ye(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&D(t),be(n,e)}}}function ar(e,n,r){const i=K(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,{id:h}=n,{item:f}=n,{record:m}=n,{values:p=[]}=n,{desc:g=""}=n,{noForm:w=!1}=n,{classId:y}=n,{eventId:v}=n,{recordId:I}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:$}=n,{praefix:b}=n,{selectionFields:S}=n,{formnovalidate:T}=n,{selection:N}=n,{deList:R}=n,{isTemplate:D}=n,{noList:x=!1}=n,O=!1;const{lookup:k,filter:M,constraint:P}=f.properties.multi;A=!0;const B=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(2,h=e.id),"item"in e&&r(3,f=e.item),"record"in e&&r(26,m=e.record),"values"in e&&r(0,p=e.values),"desc"in e&&r(4,g=e.desc),"noForm"in e&&r(5,w=e.noForm),"classId"in e&&r(6,y=e.classId),"eventId"in e&&r(7,v=e.eventId),"recordId"in e&&r(8,I=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(9,E=e.required),"disabled"in e&&r(1,A=e.disabled),"readonly"in e&&r(10,$=e.readonly),"praefix"in e&&r(11,b=e.praefix),"selectionFields"in e&&r(29,S=e.selectionFields),"formnovalidate"in e&&r(12,T=e.formnovalidate),"selection"in e&&r(30,N=e.selection),"deList"in e&&r(31,R=e.deList),"isTemplate"in e&&r(32,D=e.isTemplate),"noList"in e&&r(33,x=e.noList)},[p,A,h,f,g,w,y,v,I,E,$,b,T,O,d,u,o,s,a,l,async()=>{r(0,p=[].concat(p)),r(14,d=await t.getSchemaByClass(f.refClass))},async()=>{let e,n;if(k?(n=[{$match:{[k]:m[k]}}],e=await t.getSectionView(d.class,n)):e=await gm(d.class,d.id),!e?.length)return[];if(P&&e?.length){const{refClass:r,refStatus:i}=P;n=[{$match:{[d.class]:{$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 o=await t.getSectionView(r,n);e=e.filter(e=>!!o.find(t=>t.project==e._id))}if(M)for(const t in M)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},e=>()=>{$||(e=[].concat(e),r(13,O=!0),r(15,u=e))},({detail:e})=>{const t=e.row._id;r(0,p=[].concat(p)),Array.isArray(p)&&!p.find(e=>e===t)&&r(0,p=p.concat(e.row._id)),B()},({detail:e})=>{r(0,p=[].concat(p)),e.delete&&r(0,p=p.filter(t=>t!==e.value)),e.value=p,i("change",e),i("multi",{lookup:k,filter:M,name:f.name,value:p})},B,m,_,C,S,N,R,D,x,function(e){O=e,r(13,O)}]}class lr extends Te{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}",N(document.head,t)),Se(this,e,ar,sr,$,{id:2,item:3,record:26,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:27,refValue:28,required:9,disabled:1,readonly:10,praefix:11,selectionFields:29,formnovalidate:12,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const cr=/\d+/g,dr=/%[HMSpPdmyY%]/g;function ur(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(dr);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{cr.lastIndex=s;const o=cr.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 hr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:fr}=_e;function mr(e,t,n){const r=e.slice();return r[17]=t[n],r}function pr(e,t,n){const r=e.slice();return r[20]=t[n],r}function gr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function wr(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=vr(pr(e,m,t));const g=e=>ye(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&Ir(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[Cr]},$$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:[Er]},$$scope:{ctx:e}}}),{c(){t=O("form"),n=O("input"),i=P();for(let e=0;e<p.length;e+=1)p[e].c();o=P(),w&&w.c(),s=P(),a=O("div"),Ae(l.$$.fragment),c=P(),Ae(d.$$.fragment),U(n,"class",S(e[6])+" svelte-1phofh5"),U(n,"name","_id"),U(n,"type","hidden"),n.value=r=e[1]._id||"",U(t,"class","fTask svelte-1phofh5"),U(t,"id",e[6]),U(a,"class","form--buttons svelte-1phofh5")},m(r,m){R(r,t,m),N(t,n),N(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);N(t,o),w&&w.m(t,null),R(r,s,m),R(r,a,m),$e(l,a,null),N(a,c),$e(d,a,null),u=!0,h||(f=[L(t,"keydown",e[8]),L(t,"submit",F(e[10]))],h=!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=pr(e,m,n);p[n]?(p[n].p(r,i),we(p[n],1)):(p[n]=vr(r),p[n].c(),we(p[n],1),p[n].m(t,o))}for(pe(),n=m.length;n<p.length;n+=1)g(n);ge()}e[0].list?w?(w.p(e,i),1&i&&we(w,1)):(w=Ir(e),w.c(),we(w,1),w.m(t,null)):w&&(pe(),ye(w,1,1,()=>{w=null}),ge());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)we(p[e]);we(w),we(l.$$.fragment,e),we(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)ye(p[e]);ye(w),ye(l.$$.fragment,e),ye(d.$$.fragment,e),u=!1},d(e){e&&D(t),x(p,e),w&&w.d(),e&&D(s),e&&D(a),be(l),be(d),h=!1,E(f)}}}function yr(e){let t,n;return t=new Hd({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function vr(e){let t,n,r=br(!0,e[20]),i=r&&yr(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){1&n&&(r=br(!0,e[20])),r?i?(i.p(e,n),1&n&&we(i,1)):(i=yr(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Ir(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=_r(mr(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=mr(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=_r(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}function _r(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Lr({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(){Ae(t.$$.fragment),n=P(),Ae(r.$$.fragment)},m(e,o){$e(t,e,o),R(e,n,o),$e(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||(we(t.$$.fragment,e),we(r.$$.fragment,e),i=!0)},o(e){ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!1},d(e){be(t,e),e&&D(n),be(r,e)}}}function Cr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Er(e){let t;return{c(){t=M("Speichern")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Ar(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function $r(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Ar,then:wr,catch:gr,value:16,blocks:[,,,]};return ve(e[7](),i),{c(){t=P(),n=O("section"),i.block.c(),fr.title="Vorgaben",U(n,"class","sTask svelte-1phofh5")},m(e,o){R(e,t,o),R(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ie(i,e=t,n)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),e&&D(n),i.block.d(),i.token=null,i=null}}}const br=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Sr(e,r,o){let l,d,u;b(e,a,e=>o(11,d=e)),b(e,i,e=>o(12,u=e));const{Divider:h,Button:f,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 ur(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&&o(0,g=e.schema),"record"in e&&o(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&o(3,l=v)},[g,w,v,l,h,f,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&o(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));o(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),s.success("Die Vorgaben wurden gespeichert.",2e3),I()}]}const{document:Tr}=_e;function Nr(e,t,n){const r=e.slice();return r[28]=t[n],r}function Rr(e){let t,n;return t=new Hd({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),2&n[0]&&(r.item=e[28]),2&n[0]&&(r.listName=e[1].name),8&n[0]&&(r.eventId=e[3]),1&n[0]&&(r.record=e[0]),16&n[0]&&(r.disabled=e[4]),32&n[0]&&(r.required=e[5]),256&n[0]&&(r.currency=e[8]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Dr(e){let t,n,r=br(e[7],e[28]),i=r&&Rr(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){130&n[0]&&(r=br(e[7],e[28])),r?i?(i.p(e,n),130&n[0]&&we(i,1)):(i=Rr(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function xr(e){let t,n,r,i=e[1].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Dr(Nr(e,i,t));const s=e=>ye(o[e],1,1,()=>{o[e]=null});return{c(){t=O("div");for(let e=0;e<o.length;e+=1)o[e].c();U(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){R(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(82367&a[0]){let n;for(i=e[1].item,n=0;n<i.length;n+=1){const r=Nr(e,i,n);o[n]?(o[n].p(r,a),we(o[n],1)):(o[n]=Dr(r),o[n].c(),we(o[n],1),o[n].m(t,null))}for(pe(),n=i.length;n<o.length;n+=1)s(n);ge()}(!r||6&a[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&U(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)we(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ye(o[e]);r=!1},d(e){e&&D(t),x(o,e)}}}function Or(e){let t,n,r=e[13](e[9])+"";return{c(){t=O("span"),n=M(r)},m(e,r){R(e,t,r),N(t,n)},p(e,t){512&t[0]&&r!==(r=e[13](e[9])+"")&&H(n,r)},d(e){e&&D(t)}}}function kr(e){let t,n,r;return n=new e[10]({props:{$$slots:{default:[Or]},$$scope:{ctx:e}}}),n.$on("click",function(){A(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)}),{c(){t=O("div"),Ae(n.$$.fragment),U(t,"class","accordion svelte-148ktt9"),U(t,"slot","handle")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p(t,r){e=t;const i={};512&r[0]|1&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Mr(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[kr,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[xr,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.open=e[6]),134218687&n[0]|1&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Pr(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[Mr]},$$scope:{ctx:e}}}),{c(){t=O("div"),Ae(n.$$.fragment),U(t,"class","formList")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p(e,t){const r={};1023&t[0]|1&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Br(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:h}=n,{disabled:f}=n,{required:w}=n,{open:y=!1}=n,{template:v={}}=n,{isTemplate:I=!1}=n,{currency:_}=n,{update:C=!1}=n,E=new Map;const A={};let $=d[a.name]||{};d[a.name]=$;const b=e=>A[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&r(1,a=e.list),"schema"in e&&r(18,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(2,u=e.classId),"eventId"in e&&r(3,h=e.eventId),"disabled"in e&&r(4,f=e.disabled),"required"in e&&r(5,w=e.required),"open"in e&&r(6,y=e.open),"template"in e&&r(19,v=e.template),"isTemplate"in e&&r(7,I=e.isTemplate),"currency"in e&&r(8,_=e.currency),"update"in e&&r(20,C=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&C&&d&&r(9,$=d[a.name]||{})},[d,a,u,h,f,w,y,I,_,$,i,o,s,e=>l.filter(t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format).map(t=>"object"===t.type?b(t.name):"boolean"===t.type?g(e[t.name]):"date"===t.type?m(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name]).filter(e=>!!e).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(A[n]=e.desc);const i=d[t];r(0,d[t]={...i,[n]:e.value},d),r(9,$=d[t])},e=>t=>{(()=>{const e=v[a.name]||{};for(const t in e)v[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=v[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`,i=document.querySelector(n);se().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)}).then(()=>i.scrollIntoView({behavior:"smooth",block:"end"}))},async({detail:{className:e,itemName:n,value:r}})=>{if(E.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&&E.set(e,o[0])},()=>{setTimeout(()=>{Array.from(E).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},l,v,C,function(t){Q(e,t)}]}class Lr extends Te{constructor(e){var t;super(),Tr.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}}",N(Tr.head,t)),Se(this,e,Br,Pr,$,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:Fr}=_e;function Vr(e){e[0]=e[23].list,e[22]=e[23].items}function Ur(e,t,n){const r=e.slice();return r[24]=t[n],r}function Hr(e,t,n){const r=e.slice();return r[27]=t[n],r}function Wr(e,t,n){const r=e.slice();return r[27]=t[n],r}function zr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function jr(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[19](t)}Vr(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Gr]},$$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}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=qr(Wr(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(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=Wr(e,r,o);i[o]?i[o].p(s,t):(i[o]=qr(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&&D(t),x(i,e)}}}(e),C=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=Zr(Ur(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);R(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=Ur(e,n,o);r[o]?r[o].p(s,i):(r[o]=Zr(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){x(r,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){Vr(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],le(()=>a=!1)),s.$set(i),e[22]?.length&&_.p(e,t),e[0]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function Gr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function qr(e){let t,n,r=e[27]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Xr(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Yr(Hr(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=P(),U(t,"class","pointer svelte-14hcfjl")},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);N(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Hr(e,r,s);i[s]?i[s].p(a,o):(i[s]=Yr(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&&D(t),x(i,e)}}}function Yr(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function Zr(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Xr(e);return{c(){r&&r.c(),t=B()},m(e,n){r&&r.m(e,n),R(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=Xr(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&D(t)}}}function Kr(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Qr(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Kr,then:jr,catch:zr,value:23,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Jr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Qr]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ei(e,n,r){const i=K(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:h}=n,{classId:f}=n,{list:p}=n,w="",y=f+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},I=t.getSchemaByClass(h);Y(()=>{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,h=e.className),"classId"in e&&r(17,f=e.classId),"list"in e&&r(0,p=e.list)},[p,w,i,o,s,a,l,d,y,v,e=>()=>i("choose",{row:e}),async()=>{const e=await I,t=e.display;let n=await Xt(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,w=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,w="")},u,h,f,()=>i("back"),function(e){w=e,r(1,w)}]}class ti extends Te{constructor(e){var t;super(),Fr.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}",N(Fr.head,t)),Se(this,e,ei,Jr,$,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ni}=_e;function ri(e,t,n){const r=e.slice();return r[11]=t[n],r}function ii(e,t,n){const r=e.slice();return r[3]=t[n],r}function oi(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function si(e){let t,n,r,i=e[7].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=ui(ii(e,i,t));const s=e=>ye(o[e],1,1,()=>{o[e]=null});let a=e[7].list&&hi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=P(),a&&a.c(),n=B()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);R(e,t,i),a&&a.m(e,i),R(e,n,i),r=!0},p(e,r){if(30327783&r[0]){let n;for(i=e[7].items,n=0;n<i.length;n+=1){const s=ii(e,i,n);o[n]?(o[n].p(s,r),we(o[n],1)):(o[n]=ui(s),o[n].c(),we(o[n],1),o[n].m(t.parentNode,t))}for(pe(),n=i.length;n<o.length;n+=1)s(n);ge()}e[7].list?a?(a.p(e,r),128&r[0]&&we(a,1)):(a=hi(e),a.c(),we(a,1),a.m(n.parentNode,n)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge())},i(e){if(!r){for(let e=0;e<i.length;e+=1)we(o[e]);we(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ye(o[e]);ye(a),r=!1},d(e){x(o,e),e&&D(t),a&&a.d(e),e&&D(n)}}}function ai(e){let t,n,r,i;const o=[ci,li],s=[];function a(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=B()},m(e,n){~t&&s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){~t&&s[t].d(e),e&&D(r)}}}function li(e){let t,n;return t=new Hd({props:{classId:e[8],item:e[3],record:e[6],disabled:e[3].name===e[14]&&e[15]||e[0],eventId:e[5],currency:e[2],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.item=e[3]),64&n[0]&&(r.record=e[6]),129&n[0]&&(r.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(r.eventId=e[5]),4&n[0]&&(r.currency=e[2]),512&n[0]&&(r.changeValue=e[9]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ci(e){let t,n,r,i;n=new Hd({props:{classId:e[8],item:e[3],record:e[6],disabled:e[0]||!!e[1],required:!0,eventId:e[5],currency:e[2],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]),n.$on("record",e[23]),n.$on("objRecord",e[24]);let o=e[1]&&di(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"padding-top",".25em"),z(t,"background-color","lightyellow"),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};256&r[0]&&(i.classId=e[8]),128&r[0]&&(i.item=e[3]),64&r[0]&&(i.record=e[6]),3&r[0]&&(i.disabled=e[0]||!!e[1]),32&r[0]&&(i.eventId=e[5]),4&r[0]&&(i.currency=e[2]),512&r[0]&&(i.changeValue=e[9]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&we(o,1)):(o=di(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function di(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[22]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function ui(e){let t,n,r="list"!==e[3].type&&ai(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){"list"!==e[3].type?r?(r.p(e,n),128&n[0]&&we(r,1)):(r=ai(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function hi(e){let t,n,r=e[7].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=mi(ri(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(e,t,r),n=!0},p(e,n){if(485&n[0]){let s;for(r=e[7].list,s=0;s<r.length;s+=1){const o=ri(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=mi(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}function fi(e){let t,n,r,i;return t=new e[12]({props:{text:e[11].designation}}),r=new Lr({props:{classId:e[8],list:e[11],eventId:e[5],schema:e[11].item,record:e[6],disabled:e[0],currency:e[2],update:!0}}),{c(){Ae(t.$$.fragment),n=P(),Ae(r.$$.fragment)},m(e,o){$e(t,e,o),R(e,n,o),$e(r,e,o),i=!0},p(e,n){const i={};128&n[0]&&(i.text=e[11].designation),t.$set(i);const o={};256&n[0]&&(o.classId=e[8]),128&n[0]&&(o.list=e[11]),32&n[0]&&(o.eventId=e[5]),128&n[0]&&(o.schema=e[11].item),64&n[0]&&(o.record=e[6]),1&n[0]&&(o.disabled=e[0]),4&n[0]&&(o.currency=e[2]),r.$set(o)},i(e){i||(we(t.$$.fragment,e),we(r.$$.fragment,e),i=!0)},o(e){ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!1},d(e){be(t,e),e&&D(n),be(r,e)}}}function mi(e){let t,n,r="array"!==e[11].type&&fi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){"array"!==e[11].type?r?(r.p(e,n),128&n[0]&&we(r,1)):(r=fi(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function pi(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function gi(e){let t,n;return t=new ti({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.item=e[3]),16&n[0]&&(r.className=e[4]),256&n[0]&&(r.classId=e[8]),2048&n[0]&&(r.list=e[11]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function wi(e){let t,n,r=e[10]&&gi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[10]?r?(r.p(e,n),1024&n[0]&&we(r,1)):(r=gi(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function yi(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:pi,then:si,catch:oi,value:54,blocks:[,,,]};function l(t){e[30](t)}ve(e[16](),a),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[wi]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),i=new e[13]({props:c}),ee.push(()=>Ee(i,"open",l)),{c(){a.block.c(),t=P(),Ae(n.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,R(e,t,o),$e(n,e,o),R(e,r,o),$e(i,e,o),s=!0},p(t,n){Ie(a,e=t,n);const r={};3352&n[0]|268435456&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&1024&n[0]&&(o=!0,r.open=e[10],le(()=>o=!1)),i.$set(r)},i(e){s||(we(a.block),we(n.$$.fragment,e),we(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){ye(a.blocks[e])}ye(n.$$.fragment,e),ye(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&D(t),be(n,e),e&&D(r),be(i,e)}}}function vi(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=K();let l,d,u,h,f,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:I}=n,{currency:_}=n,C={},E=[],A=[],$={},b=new Map,S=!1,T="";const N=y.checkOn,R=v,D=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?"!":""})})},x=()=>{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(9,$={});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 Im(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(9,$[t]="",$))}}};Y(()=>{k()});const k=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))})(),M())},M=()=>{setTimeout(()=>{Array.from(b).forEach(([e,t])=>{C[e]||r(6,C[e]=t._id,C)})},250)},P=async e=>{if(!e.value)return void L();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(11,T=i),r(10,S=!0)):(r(1,v=""),r(25,I=""),a("setRefValue",I))},B=()=>{r(10,S=!1)},L=()=>{r(1,v=""),r(25,I=v),r(6,C={}),a("setRefValue",I)};return e.$$set=e=>{"required"in e&&r(26,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(27,g=e.readonly),"id"in e&&r(28,w=e.id),"item"in e&&r(3,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(25,I=e.refValue),"currency"in e&&r(2,_=e.currency)},e.$$.update=()=>{134217729&e.$$.dirty[0]&&r(0,p=p||g),536871024&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:h,taskId:f})},[p,v,_,y,u,h,C,l,d,$,S,T,i,s,N,R,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(6,C=e),r(29,f=(await t.getTaskByDocId(e._id,!0))._id)}else r(6,C={})}catch{}return r(7,l=await t.getSchemaByClass(y.refClass)),r(8,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(4,u=l.class),l.identity.designation,r(5,h=l.id),["readonly","hidden","required"].map(D),x(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(6,C[t]=n,C),t===N)return P(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(6,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(6,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(b.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&&b.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(25,I=v),a("setRefValue",I),r(6,C=n[0])),B()},B,L,({detail:e})=>{r(6,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(6,C[e.listName][t.name]=t.value,C)},I,m,g,w,f,function(e){S=e,r(10,S)}]}class Ii extends Te{constructor(e){var t;super(),ni.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}",N(ni.head,t)),Se(this,e,vi,yi,$,{required:26,disabled:0,readonly:27,id:28,item:3,value:1,refValue:25,currency:2},[-1,-1])}}function _i(e){let t,n;return{c(){t=O("span"),n=M(e[4]),U(t,"class","item")},m(e,r){R(e,t,r),N(t,n)},p(e,t){16&t[0]&&H(n,e[4])},d(e){e&&D(t)}}}function Ci(e){let t,n,r,i=e[6]&&_i(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","pointer feather svelte-1fuww0c")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[17]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=P(),o&&o.c(),n=B()},m(e,s){i&&i.m(e,s),R(e,t,s),o&&o.m(e,s),R(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=_i(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||(we(o),r=!0)},o(e){ye(o),r=!1},d(e){i&&i.d(e),e&&D(t),o&&o.d(e),e&&D(n)}}}function Ei(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:[Ci]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=O("div"),Ae(n.$$.fragment),z(t,"position","relative"),z(t,"max-width","10em")},m(e,i){R(e,t,i),$e(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]|32&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Ai(e,t,r){const i=K(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:h}=t,{formnovalidate:f}=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:C,step:E,pattern:A,decimals:$=0,unit:b="",placeholder:S,hint:T,readonly:N,negative:R,required:D=!1,transfer:x}=I,O="";l=l?Number(l.toString().replace(",",".")):0,N=!0===N||void 0;const k=e=>Number(e.toString()).toFixed($).toString().replace(".",v);A||(A=$?`[0-9]+([${v}][0-9]{1,${$}})?`:"[0-9]*"),R&&(A="-?"+A);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,h=e.disabled),"formnovalidate"in e&&r(20,f=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&&!f),262144&e.$$.dirty[0]&&(e=>{r(9,O=k((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,h,m,D,y,A,N,O,o,w,E,S,x,({detail:e})=>i("blur",{value:k(e.value)}),({detail:e})=>{N||+l||r(9,O="")},({detail:e})=>{const t=[].concat(x.target);for(const e of t)i("record",{itemName:e,value:l}),i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,f,p,g]}class $i extends Te{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}",N(document.head,t)),Se(this,e,Ai,Ei,$,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:bi}=_e;function Si(e){e[34]=e[36].list,e[35]=e[36].items}function Ti(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function Ni(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function Ri(e,t,n){const r=e.slice();return r[40]=t[n],r}function Di(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function xi(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y,v;Si(e),n=new e[9]({props:{outline:!0,$$slots:{default:[Oi]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let I=!e[2]&&ki(e);function _(t){e[32](t)}let C={id:e[12]};void 0!==e[3]&&(C.value=e[3]),a=new e[7]({props:C}),ee.push(()=>Ee(a,"value",_)),a.$on("input",e[15]),u=new tt({props:{size:"18"}});let E=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&Pi(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=Bi(Ri(e,s,t));return{c(){t=O("thead"),n=O("tr"),o&&o.c(),r=P();for(let e=0;e<a.length;e+=1)a[e].c();U(n,"class","svelte-1m010ne"),U(t,"class","svelte-1m010ne")},m(e,s){R(e,t,s),N(t,n),o&&o.m(n,null),N(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&&(pe(),ye(o,1,1,()=>{o=null}),ge()):o?(o.p(e,t),4&t[0]&&we(o,1)):(o=Pi(e),o.c(),we(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=Ri(e,s,r);a[r]?a[r].p(i,t):(a[r]=Bi(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||(we(o),i=!0)},o(e){ye(o),i=!1},d(e){e&&D(t),o&&o.d(),x(a,e)}}}(e),A=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=Hi(Ti(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=Ti(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=Hi(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),I&&I.c(),i=P(),o=O("div"),s=M("Suchen: "),Ae(a.$$.fragment),c=P(),d=O("span"),Ae(u.$$.fragment),h=P(),f=O("div"),m=O("table"),E&&E.c(),p=P(),g=O("tbody"),A&&A.c(),U(t,"class","form--buttons svelte-1m010ne"),U(d,"class","feather pointer svelte-1m010ne"),z(o,"margin-bottom","1em"),z(o,"position","relative"),U(m,"striped",""),U(m,"class","svelte-1m010ne"),U(f,"class","eList svelte-1m010ne")},m(l,_){R(l,t,_),$e(n,t,null),N(t,r),I&&I.m(t,null),R(l,i,_),R(l,o,_),N(o,s),$e(a,o,null),N(o,c),N(o,d),$e(u,d,null),R(l,h,_),R(l,f,_),N(f,m),E&&E.m(m,null),N(m,p),N(m,g),A&&A.m(g,null),w=!0,y||(v=L(d,"click",e[17]),y=!0)},p(e,r){Si(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?I&&(pe(),ye(I,1,1,()=>{I=null}),ge()):I?(I.p(e,r),4&r[0]&&we(I,1)):(I=ki(e),I.c(),we(I,1),I.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],le(()=>l=!1)),a.$set(o),e[35]?.length&&E.p(e,r),e[34]?.length&&A.p(e,r)},i(e){w||(we(n.$$.fragment,e),we(I),we(a.$$.fragment,e),we(u.$$.fragment,e),we(E),we(A),w=!0)},o(e){ye(n.$$.fragment,e),ye(I),ye(a.$$.fragment,e),ye(u.$$.fragment,e),ye(E),ye(A),w=!1},d(e){e&&D(t),be(n),I&&I.d(),e&&D(i),e&&D(o),be(a),be(u),e&&D(h),e&&D(f),E&&E.d(),A&&A.d(),y=!1,v()}}}function Oi(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ki(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[Mi]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Mi(e){let t;return{c(){t=M("Bestätigen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Pi(e){let t,n,r,i,o;return n=new Ge({props:{size:"20"}}),{c(){t=O("th"),Ae(n.$$.fragment),U(t,"class","svelte-1m010ne")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Bi(e){let t,n,r=e[40]+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-1m010ne")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Li(e){let t,n,r,i,o,s,a,l=e[0],c=Vi(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Ui(Ni(e,d,t));return{c(){t=O("tr"),c.c(),n=P();for(let e=0;e<u.length;e+=1)u[e].c();r=P(),U(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),U(t,"title","übernimmt den Wert direkt"),U(t,"class","svelte-1m010ne"),j(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){R(i,t,l),c.m(t,null),N(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);N(t,r),o=!0,s||(a=L(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&$(l,l=e[0])?(pe(),ye(c,1,1,I),ge(),c=Vi(e),c.c(),we(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=Ni(e,d,n);u[n]?u[n].p(i,a):(u[n]=Ui(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;"))&&U(t,"style",i),16385&a[0]&&j(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||(we(c),o=!0)},o(e){ye(c),o=!1},d(e){e&&D(t),c.d(e),x(u,e),s=!1,a()}}}function Fi(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"),Ae(n.$$.fragment),U(t,"title","Wählt den Wert aus"),U(t,"class","svelte-1m010ne")},m(e,i){R(e,t,i),$e(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||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Vi(e){let t,n,r=!e[2]&&Fi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[2]?r&&(pe(),ye(r,1,1,()=>{r=null}),ge()):r?(r.p(e,n),4&n[0]&&we(r,1)):(r=Fi(e),r.c(),we(r,1),r.m(t.parentNode,t))},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Ui(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=M(r),U(t,"class","svelte-1m010ne")},m(e,r){R(e,t,r),N(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&&D(t)}}}function Hi(e){let t,n,r=e[16](e[37],e[3]),i=r&&Li(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(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]&&we(i,1)):(i=Li(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Wi(e){let t,n;return t=new e[6]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zi(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Wi,then:xi,catch:Di,value:36,blocks:[,,,]};return ve(e[14](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function ji(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[zi]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Gi(e,n,r){const i=K(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:h}=n,{id:f}=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:C}=n,{status:E}=n,{single:A}=n;p||=[];let $="",b=h+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const T=w+y+v+"checkbox",N=(e,t)=>e>t?1:t>e?-1:0;Y(()=>{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,h=e.classId),"id"in e&&r(23,f=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,C=e.uniqueView),"status"in e&&r(30,E=e.status),"single"in e&&r(2,A=e.single)},[p,m,A,$,S,i,o,s,a,l,d,u,b,T,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if(I){if(f){const n=h.split("-")[1].slice(0,-4),r="input."+h+"[name='_id']",o=document.querySelector(r).value;i={[y]:f},E&&(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 N(r(e),r(t))})}}else C?f&&(i={[y]:f,status:!0},Object.entries(C).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 N(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,f,_),e=e.sort((e,t)=>N(e,t))):(e=await t.getSection(w,y,f,!1,E),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))}));else i={},f&&!Array.isArray(f)&&(i._id=f),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,$=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,$="")},e=>()=>{const t=document.getElementsByName(T),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(T).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;A?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,h,f,g,w,y,I,_,C,E,()=>i("back"),function(e){$=e,r(3,$)}]}class qi extends Te{constructor(e){var t;super(),bi.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}",N(bi.head,t)),Se(this,e,Gi,ji,$,{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:Xi}=_e;function Yi(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=O("span"),n=M("("),r=M(s),i=M(")"),U(t,"class",o=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&U(t,"class",o)},d(e){e&&D(t)}}}function Zi(e){let t;return{c(){t=O("div"),U(t,"class","load-more-options"),U(t,"slot","load-more-options-message")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Ki(e){let t,n,r,i;const o=[eo,Ji,Qi],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=B()},m(e,n){~t&&s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){~t&&s[t].d(e),e&&D(r)}}}function Qi(e){let t,n,r,i,o;return n=new Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[26]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ji(e){let t,n,r,i,o;return n=new Ye({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title",e[17].title||"Generieren"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[25]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function eo(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Löschen"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[27]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function to(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[no]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(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],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function no(e){let t,n;return t=new qi({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ro(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&Yi(e);function u(t){e[35](t)}function h(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:io,minSearchLength:"3",$$slots:{"load-more-options-message":[Zi]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),r=new e[12]({props:f}),ee.push(()=>Ee(r,"selection",u)),ee.push(()=>Ee(r,"maxOptions",h)),r.$on("change",e[22]);let m=!e[1]&&Ki(e),p=e[10]&&to(e);return{c(){t=O("div"),d&&d.c(),n=P(),Ae(r.$$.fragment),s=P(),m&&m.c(),a=P(),p&&p.c(),l=B(),z(t,"position","relative")},m(e,i){R(e,t,i),d&&d.m(t,null),N(t,n),$e(r,t,null),N(t,s),m&&m.m(t,null),R(e,a,i),p&&p.m(e,i),R(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=Yi(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],le(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],le(()=>o=!1)),r.$set(a),e[1]?m&&(pe(),ye(m,1,1,()=>{m=null}),ge()):m?(m.p(e,s),2&s[0]&&we(m,1)):(m=Ki(e),m.c(),we(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&we(p,1)):(p=to(e),p.c(),we(p,1),p.m(l.parentNode,l)):p&&(pe(),ye(p,1,1,()=>{p=null}),ge())},i(e){c||(we(r.$$.fragment,e),we(m),we(p),c=!0)},o(e){ye(r.$$.fragment,e),ye(m),ye(p),c=!1},d(e){e&&D(t),d&&d.d(),be(r),m&&m.d(),e&&D(a),p&&p.d(e),e&&D(l)}}}async function*io(e){yield[{name:e}]}function oo(e,n,r){const i=K(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:h}=n,{noForm:f=!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:C,hint:E,readonly:A,required:$=!1,lookup:b="",view:S=!1,multi:T,max:N=1e3,generate:R=!1,status:D=!0,refDoc:x}=_;const[O,k]=b.split(":");let M=!1,P=h.map&&h.map(e=>({name:e}))||[];m||=A,m&&(C="");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:T.view,lookup:b,name:d.name,value:n})};Y(async()=>{i("multi",{view:T.view,lookup:b,name:d.name,value:h});const e=document.getElementById(l);e.classList.add(a),!A&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||N;(T.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:T.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[k]:u[k]},n=await t.getSectionView(O,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},H=(e=!1)=>{if(m||!T.required)return;const t=T.maxItem;if(!t||T.unique)return;r(9,N=!1!==e?e:v||u[t]||0);const n=P?.length!=N,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,h=e.value),"noForm"in e&&r(28,f=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,h=P.map&&P.map(e=>e.name)||[]),H()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===T.maxItem&&H(n)})(g),536870976&e.$$.dirty[0]&&r(6,$=$&&!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(H,250)}})(I)},[h,m,a,l,d,u,$,P,C,N,M,o,s,A,b,S,T,R,D,x,O,k,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[T.maxItem];if(!e)return;let n={};k&&(n={[k]:u[k]}),D&&(n.status=!0);const r=[].concat(u[T.view]||[]);r.length&&(n[T.view]={$in:r});const i=await t.getSectionView(O,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:[]}})},f,p,g,w,y,v,I,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){N=e,r(9,N)},function(e){M=e,r(10,M)}]}class so extends Te{constructor(e){var t;super(),Xi.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}",N(Xi.head,t)),Se(this,e,oo,ro,$,{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 ao(e){let t,n,r;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function lo(e){let t,n,r,i,o;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function co(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[12]);const a=[lo,ao],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}const uo=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)});function ho(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:h}=t,{record:f}=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,h=e.value),"record"in e&&n(10,f=e.record),"item"in e&&n(11,m=e.item)},[i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;const e=u.includes(".")?f[u.split(".")[0]]:f,t=await uo(e);window.open(t,"_blank")},f,m,function(t){Q(e,t)}]}class fo extends Te{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}",N(document.head,t)),Se(this,e,ho,co,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:mo}=_e;function po(e){let t;return{c(){t=O("div"),U(t,"class","load-more-options"),U(t,"slot","load-more-options-message")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function go(e){let t,n,r;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-wpjws5")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function wo(e){let t,n,r,i,o;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-wpjws5")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[8]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function yo(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":[po]},$$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}),ee.push(()=>Ee(n,"value",l)),ee.push(()=>Ee(n,"selection",c)),ee.push(()=>Ee(n,"searchQuery",d)),n.$on("change",e[6]);let h=e[5]&&function(e){let t,n,r,i;const o=[wo,go],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),s=P(),h&&h.c(),z(t,"position","relative"),U(t,"class","inputAutoComplete")},m(e,r){R(e,t,r),$e(n,t,null),N(t,s),h&&h.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]),16&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],le(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],le(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],le(()=>o=!1)),n.$set(s),e[5]&&h.p(e,t)},i(e){a||(we(n.$$.fragment,e),we(h),a=!0)},o(e){ye(n.$$.fragment,e),ye(h),a=!1},d(e){e&&D(t),be(n),h&&h.d()}}}function vo(e,t,n){const{Autocomplete:r}=c,i=K();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:h}=t,{noForm:f=!1}=t,{disabled:m}=t,{formnovalidate:p}=t;const{autocomplete:{input:g,min:w,url:y,output:v},format:I}=a.properties,_=[].concat(g),{name:C}=v,E="map"===I;let A,$=h,b=!1;Y(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",N),e.addEventListener("keyup",T),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},T=e=>{8===e.keyCode&&""===$&&n(0,h="")},N=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(h.startsWith(e[0].name))return;n(3,$=n(0,h=e[0].name)),x(h)}else e.find(e=>($||"").startsWith(e.name))||h||n(3,$=" ");else h||n(3,$="")},R=async(e="")=>{const t=await fetch(y+"?"+D()+"&name=%5E"+e.trim());if(!t.ok)return;const n=t.headers.get("Content-Type").split(";")[0];let r=[];try{if("text/json"===n){const e=await t.text();r=JSON.parse(e||[])}else"application/json"===n&&(r=await t.json())}catch{}return r.map(e=>({name:e[C]}))},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,h=e.value),"noForm"in e&&n(14,f=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[h,s,A,$,r,E,({detail:{value:e}})=>{e.length&&n(3,$=n(0,h=e[0].name)),n(2,A=[]),x(h)},async function*(e){if(b||h&&e.startsWith(h))return n(0,h=e),void x(h);const t=await R(e);if(!t?.length)return n(0,h=e),void x(h);1===t.length?(n(3,$=n(0,h=t[0].name)),n(2,A=[]),x(h)):yield t},async()=>{if(!h)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await uo(e);window.open(t,"_blank")},o,a,l,d,u,f,m,p,function(e){h=e,n(0,h)},function(e){A=e,n(2,A)},function(e){$=e,n(3,$)}]}class Io extends Te{constructor(e){var t;super(),mo.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}",N(mo.head,t)),Se(this,e,vo,yo,$,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:_o}=_e;function Co(e){e[26]=e[28].list,e[27]=e[28].items}function Eo(e,t,n){const r=e.slice();return r[29]=t[n],r}function Ao(e,t,n){const r=e.slice();return r[32]=t[n],r}function $o(e,t,n){const r=e.slice();return r[32]=t[n],r}function bo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function So(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[23](t)}Co(e),n=new e[7]({props:{outline:!0,$$slots:{default:[To]},$$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}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=No($o(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(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=$o(e,r,o);i[o]?i[o].p(s,t):(i[o]=No(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&&D(t),x(i,e)}}}(e),C=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=xo(Eo(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);R(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=Eo(e,n,o);r[o]?r[o].p(s,i):(r[o]=xo(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){x(r,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){Co(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],le(()=>a=!1)),s.$set(i),e[27]?.length&&_.p(e,t),e[26]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function To(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function No(e){let t,n,r=e[32]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Ro(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=Do(Ao(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=P(),U(t,"class","pointer svelte-14hcfjl"),j(t,"active",e[29]._id===e[0])},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);N(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=Ao(e,r,s);i[s]?i[s].p(a,o):(i[s]=Do(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]&&j(t,"active",e[29]._id===e[0])},d(e){e&&D(t),x(i,e)}}}function Do(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function xo(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&Ro(e);return{c(){r&&r.c(),t=B()},m(e,n){r&&r.m(e,n),R(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=Ro(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&D(t)}}}function Oo(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ko(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Oo,then:So,catch:bo,value:28,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Mo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ko]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Po(e,n,i){const o=K(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:h}=n,{className:f}=n,{classId:p}=n,{rowId:w}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:_}=n,C="",E=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},$=t.getSchemaByClass(f);Y(()=>{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 $;e.eventId===t.id&&_m(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,h=e.item),"className"in e&&i(16,f=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,w=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)},[w,C,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await $,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 Xt(o,e,i)}},({detail:{value:e}})=>{i(1,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(1,C="")},h,f,p,y,v,I,_,()=>o("back"),function(e){C=e,i(1,C)}]}class Bo extends Te{constructor(e){var t;super(),_o.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}",N(_o.head,t)),Se(this,e,Po,Mo,$,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Lo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Fo(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}),ee.push(()=>Ee(n,"value",s));let l=!e[6]&&Vo(e);return{c(){t=O("div"),Ae(n.$$.fragment),i=P(),l&&l.c(),z(t,"position","relative")},m(e,r){R(e,t,r),$e(n,t,null),N(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],le(()=>r=!1)),n.$set(o),e[6]?l&&(pe(),ye(l,1,1,()=>{l=null}),ge()):l?(l.p(e,i),64&i&&we(l,1)):(l=Vo(e),l.c(),we(l,1),l.m(t,null))},i(e){o||(we(n.$$.fragment,e),we(l),o=!0)},o(e){ye(n.$$.fragment,e),ye(l),o=!1},d(e){e&&D(t),be(n),l&&l.d()}}}function Vo(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-wbrqzu")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[17]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Uo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Ho(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Wo]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(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],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function Wo(e){let t,n;return t=new Bo({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zo(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Uo,then:Fo,catch:Lo,value:27,blocks:[,,,]};ve(e[16](),i);let o=e[8]&&Ho(e);return{c(){i.block.c(),t=P(),o&&o.c(),n=B()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,R(e,t,s),o&&o.m(e,s),R(e,n,s),r=!0},p(t,[r]){Ie(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&we(o,1)):(o=Ho(e),o.c(),we(o,1),o.m(n.parentNode,n)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){r||(we(i.block),we(o),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}ye(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&D(t),o&&o.d(e),e&&D(n)}}}function jo(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:h}=t,{formnovalidate:f}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:I=!1,view:_}=p,C=!1;const E=()=>{n(8,C=!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,h=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,h,f,C,g,r,i,w,v,I,_,async()=>(n(9,g=l[_.selection]),!0),()=>{n(8,C=!0)},({detail:e})=>{n(0,d=e.row[_.value?_.value:"_id"]),E()},E,m,function(e){d=e,n(0,d)},function(e){C=e,n(8,C)}]}class Go extends Te{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}",N(document.head,t)),Se(this,e,jo,zo,$,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function qo(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Xo(e){let t;return{c(){t=O("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Yo(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){R(e,t,n)},d(e){e&&D(t)}}}function Zo(e){let t,n,r,i,o=e[12]+"";return{c(){t=O("option"),n=M(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){R(e,t,r),N(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&&D(t)}}}function Ko(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Yo:Xo}let r=n(e),i=r(e);return{c(){i.c(),t=B()},m(e,n){i.m(e,n),R(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&&D(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=Zo(qo(e,a,t));return{c(){t=O("select"),s&&s.c(),n=B();for(let e=0;e<l.length;e+=1)l[e].c();U(t,"class",r=S(e[3]||e[4])+" svelte-5xpzvo"),U(t,"id",e[2]),U(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){R(r,t,a),s&&s.m(t,null),N(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=L(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=qo(e,a,r);l[r]?l[r].p(i,n):(l[r]=Zo(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=S(e[3]||e[4])+" svelte-5xpzvo")&&U(t,"class",r),4&n&&U(t,"id",e[2]),4&n&&U(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:I,o:I,d(e){e&&D(t),s&&s.d(),x(l,e),i=!1,o()}}}function Qo(e,t,n){const r=K();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:h,readonly:f}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===h&&(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"===h&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===h&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,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,h,f,e=>r("blur",{value:e.srcElement.value}),o]}class Jo extends Te{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}",N(document.head,t)),Se(this,e,Qo,Ko,$,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function es(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 Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","pointer feather")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[12]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}(e);return{c(){t=O("input"),r=P(),Ae(i.$$.fragment),o=P(),d&&d.c(),s=B(),U(t,"type","string"),U(t,"class",n=e[3]||e[4]),U(t,"id",e[1]),U(t,"name",e[1]),t.hidden=!0},m(n,u){R(n,t,u),W(t,e[0]),R(n,r,u),$e(i,n,u),R(n,o,u),d&&d.m(n,u),R(n,s,u),a=!0,l||(c=L(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&U(t,"class",n),(!a||2&r)&&U(t,"id",e[1]),(!a||2&r)&&U(t,"name",e[1]),1&r&&W(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||(we(i.$$.fragment,e),we(d),a=!0)},o(e){ye(i.$$.fragment,e),ye(d),a=!1},d(e){e&&D(t),e&&D(r),be(i,e),e&&D(o),d&&d.d(e),e&&D(s),l=!1,c()}}}let ts=new Map;function ns(e,n,r){const i=K(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:h=!1}=n,{classId:f}=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,C=l.properties?.noCalendar||!1,E=l.properties?.transfer,A=({detail:e})=>{try{r(0,s=hr(e.value,s)),void 0!==u&&""!==u&&ts.set(_,new Date(s.valueOf())),$(s)}catch{r(0,s=void 0)}},$=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=hr(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,h=e.noForm),"classId"in e&&r(4,f=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&&!E&&ts.has(_)&&r(0,s=ts.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&&A({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=hr(d[l.name],s))}catch{}},[s,a,u,h,f,p,g,w,o,C,E,A,()=>{i("record",{target:E.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 rs extends Te{constructor(e){super(),Se(this,e,ns,es,$,{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 is(e){let t;return{c(){t=M("Stunden")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function os(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[is]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ss(e){let t;return{c(){t=M("Minuten")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function as(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ss]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ls(e){let t;return{c(){t=M("Jetzt")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function cs(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[ls]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ds(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":[cs],"minutes-label":[as],"hours-label":[os]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=O("input"),r=P(),Ae(i.$$.fragment),o=P(),Ae(s.$$.fragment),U(t,"type","string"),U(t,"class",n=e[2]||e[3]),U(t,"id",e[1]),U(t,"name",e[1]),t.hidden=!0},m(n,d){R(n,t,d),W(t,e[0]),R(n,r,d),$e(i,n,d),R(n,o,d),$e(s,n,d),a=!0,l||(c=L(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&U(t,"class",n),(!a||2&r)&&U(t,"id",e[1]),(!a||2&r)&&U(t,"name",e[1]),1&r&&W(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||(we(i.$$.fragment,e),we(s.$$.fragment,e),a=!0)},o(e){ye(i.$$.fragment,e),ye(s.$$.fragment,e),a=!1},d(e){e&&D(t),e&&D(r),be(i,e),e&&D(o),be(s,e),l=!1,c()}}}function us(e,t,n){const r=K(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const h=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))),h(a)},({detail:e})=>{n(0,a=hr(e.value,a)),h(a)},function(){a=this.value,n(0,a)}]}class hs extends Te{constructor(e){super(),Se(this,e,us,ds,$,{value:0,id:1,noForm:2,classId:3})}}function fs(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[12]),{c(){t=O("input"),o=P(),s=O("input"),d=P(),Ae(u.$$.fragment),h=M(" /\n"),Ae(f.$$.fragment),U(t,"type","string"),U(t,"class",n=e[1]||e[2]),U(t,"id",r=e[0]+"_from"),U(t,"name",i=e[0]+"_from"),t.hidden=!0,U(s,"type","string"),U(s,"class",a=e[1]||e[2]),U(s,"id",l=e[0]+"_to"),U(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){R(n,t,r),W(t,e[7]),R(n,o,r),R(n,s,r),W(s,e[8]),R(n,d,r),$e(u,n,r),R(n,h,r),$e(f,n,r),m=!0,p||(g=[L(t,"input",e[15]),L(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&U(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&U(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&U(t,"name",i),128&o&&W(t,e[7]),(!m||6&o&&a!==(a=e[1]||e[2]))&&U(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&U(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&U(s,"name",c),256&o&&W(s,e[8]);const d={};32&o&&(d.format=e[5]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),128&o&&(d.value=e[7]),u.$set(d);const h={};64&o&&(h.format=e[6]),8&o&&(h.required=e[3]),16&o&&(h.disabled=e[4]),256&o&&(h.value=e[8]),f.$set(h)},i(e){m||(we(u.$$.fragment,e),we(f.$$.fragment,e),m=!0)},o(e){ye(u.$$.fragment,e),ye(f.$$.fragment,e),m=!1},d(e){e&&D(t),e&&D(o),e&&D(s),e&&D(d),be(u,e),e&&D(h),be(f,e),p=!1,E(g)}}}function ms(e,t,n){const r=K(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:h}=t;const{noCalendar:f,preset:m}=a.properties||{};let p="%d.%m.%Y",g="%d.%m.%Y",w=o?.from,y=o?.to;if(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&&(w=e),t&&(y=t)}"Invalid Date"===w?.toString()&&(w=void 0),"Invalid Date"===y?.toString()&&(y=void 0),h&&(void 0===w&&(p=""),void 0===y&&(g=""));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,h=e.disabled)},[s,l,d,u,h,p,g,w,y,i,f,({detail:e})=>{n(7,w=hr(e.value,w)),y&&w&&y.valueOf()-w.valueOf()<0&&n(7,w=void 0),r("change",{value:w,range:"_from"})},({detail:e})=>{n(8,y=hr(e.value,y)),y&&w&&y.valueOf()-w.valueOf()<0&&n(8,y=void 0),r("change",{value:y,range:"_to"})},o,a,function(){w=this.value,n(7,w)},function(){y=this.value,n(8,y)}]}class ps extends Te{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}",N(document.head,t)),Se(this,e,ms,fs,$,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var gs={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 ws(e){return ws="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},ws(e)}function ys(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 vs(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 vs(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 vs(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 Is={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=ys(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=ys(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function _s(e){return!isNaN(parseInt(e))&&isFinite(e)}function Cs(e){return e%2==0}function Es(e){return _s(e)&&!Number.isInteger(e)}function As(e){return Math.abs(e)%1==.5}function $s(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 bs(e){return void 0===e}function Ss(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===ws(e[1])){var r=Ss(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function Ts(){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 As(e)&&Cs(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return As(e)?Cs(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return As(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return As(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return As(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 Es(t)||Es(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 Ns=Ts();function Rs(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"!==ws(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return $s(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return Ss(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function Ds(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function xs(e){Ds(function(e){return _s(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Os(e){Ds(Number.isInteger(e),"You must provide an integer.",TypeError)}var ks=Ts(),Ms=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;Os(r),Os(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})},h=function(e){Ds(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;Os(e);var n=this.getPrecision(),r=e>n,i=r?ks.multiply:ks.divide,o=r?[e,n]:[n,e],s=Math.pow(10,ks.subtract.apply(ks,o));return u.call(this,{amount:ks.round(i(this.getAmount(),s),t),precision:e})},add:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ks.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ks.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:ks.round(ks.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:ks.round(ks.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return xs(e),this.multiply(ks.divide(e,100),t)},allocate:function(e){var t=this;!function(e){Ds(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 ks.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(ks.divide(ks.multiply(t.getAmount(),e),n));return r=ks.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=ks.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,h=n.roundingMode,f=void 0===h?l:h,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:f});return Rs(m).getExchangeRate(this.getCurrency(),e).then(function(n){return Ds(!bs(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:ks.round(ks.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){h.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!==ks.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==ks.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!bs(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return bs(this.getMatches().find(e))?0:this.getMatches()[Ns.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 bs(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!bs(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 ks.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 ks.divide(ks.round(ks.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},gs,Is),Ps={},Bs={};!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}(Bs);const Ls=Bs,Fs={allowBooleanAttributes:!1,unpairedTags:[]};function Vs(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Us(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 Ys("InvalidXml","XML declaration allowed only at the start of the document.",Qs(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Hs(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}Ps.validate=function(e,t){t=Object.assign({},Fs,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=Us(e,o),o.err)return o}else{if("<"!==e[o]){if(Vs(e[o]))continue;return Ys("InvalidChar","char '"+e[o]+"' is not expected.",Qs(e,o))}{let s=o;if(o++,"!"===e[o]){o=Hs(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--),!Ks(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Ys("InvalidTag",t,Qs(e,o))}const c=js(e,o);if(!1===c)return Ys("InvalidAttr","Attributes for '"+l+"' have open quote.",Qs(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=qs(d,t);if(!0!==i)return Ys(i.err.code,i.err.msg,Qs(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Ys("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Qs(e,o));if(d.trim().length>0)return Ys("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Qs(e,s));if(0===n.length)return Ys("InvalidTag","Closing tag '"+l+"' has not been opened.",Qs(e,s));{const t=n.pop();if(l!==t.tagName){let n=Qs(e,t.tagStartPos);return Ys("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Qs(e,s))}0==n.length&&(i=!0)}}else{const a=qs(d,t);if(!0!==a)return Ys(a.err.code,a.err.msg,Qs(e,o-d.length+a.err.line));if(!0===i)return Ys("InvalidXml","Multiple possible root nodes found.",Qs(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=Hs(e,o);continue}if("?"!==e[o+1])break;if(o=Us(e,++o),o.err)return o}else if("&"===e[o]){const t=Xs(e,o);if(-1==t)return Ys("InvalidChar","char '&' is not expected.",Qs(e,o));o=t}else if(!0===i&&!Vs(e[o]))return Ys("InvalidXml","Extra text at the end",Qs(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Ys("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Qs(e,n[0].tagStartPos)):!(n.length>0)||Ys("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ys("InvalidXml","Start tag expected.",1)};const Ws='"',zs="'";function js(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Ws||e[t]===zs)""===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 Gs=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function qs(e,t){const n=Ls.getAllMatches(e,Gs),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Ys("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Js(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Ys("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Js(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Ys("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Js(n[e]));const i=n[e][2];if(!Zs(i))return Ys("InvalidAttr","Attribute '"+i+"' is an invalid name.",Js(n[e]));if(r.hasOwnProperty(i))return Ys("InvalidAttr","Attribute '"+i+"' is repeated.",Js(n[e]));r[i]=1}return!0}function Xs(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 Ys(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function Zs(e){return Ls.isName(e)}function Ks(e){return Ls.isName(e)}function Qs(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Js(e){return e.startIndex+e[1].length}var ea={};const ta={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}};ea.buildOptions=function(e){return Object.assign({},ta,e)},ea.defaultOptions=ta;var na=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 ra=Bs;function ia(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 oa(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function sa(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 aa(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 la(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 ca(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 da(e){if(ra.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var ua=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&&sa(e,t))t+=7,[entityName,val,t]=ia(e,t+1),-1===val.indexOf("&")&&(n[da(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&aa(e,t))t+=8;else if(i&&la(e,t))t+=8;else if(i&&ca(e,t))t+=9;else{if(!oa)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const ha=/^[-+]?0x[a-fA-F0-9]+$/,fa=/^([\-\+])?(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 ma={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var pa=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 ga=Bs,wa=na,ya=ua,va=function(e,t={}){if(t=Object.assign({},ma,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&&ha.test(n))return Number.parseInt(n,16);{const r=fa.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}},Ia=pa;function _a(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 Ca(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 ka(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?ka(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Ea(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 Aa=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function $a(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=ga.getAllMatches(e,Aa),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:ka(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 ba=function(e){e=e.replace(/\r\n?/g,"\n");const t=new wa("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=Da(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=xa(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 wa(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=Da(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=ya(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=Da(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=xa(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 h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.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 wa(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 wa(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 wa(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 Sa(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 Ta=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 Na(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 Ra(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 Da(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function xa(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 Oa(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=Da(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=Da(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=Da(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=Da(e,"]]>",n,"StopNode is not closed.")-2}else{const r=xa(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function ka(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:va(e,n))}return ga.isExist(e)?e:""}var Ma=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=_a,this.parseXml=ba,this.parseTextData=Ca,this.resolveNameSpace=Ea,this.buildAttributesMap=$a,this.isItStopNode=Ra,this.replaceEntitiesValue=Ta,this.readStopNodeData=Oa,this.saveTextToParentTag=Na,this.addChild=Sa,this.ignoreAttributesFn=Ia(this.options.ignoreAttributes)}},Pa={};function Ba(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=La(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=Ba(s[a],t,l);const n=Va(e,t);s[":@"]?Fa(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 La(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function Fa(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 Va(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])}Pa.prettify=function(e,t){return Ba(e,t)};const{buildOptions:Ua}=ea,Ha=Ma,{prettify:Wa}=Pa,za=Ps;var ja=class{constructor(e){this.externalEntities={},this.options=Ua(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=za.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ha(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Wa(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 Ga(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=qa(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Ya(c,t)||(e=t.tagValueProcessor(l,e),e=Za(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=Xa(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}${Xa(a[":@"],t)}`,h=Ga(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":h&&0!==h.length||!t.suppressEmptyNode?h&&h.endsWith(">")?i+=u+`>${h}${r}</${l}>`:(i+=u+">",h&&""!==r&&(h.includes("/>")||h.includes("</"))?i+=r+t.indentBy+h+r:i+=h,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function qa(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 Xa(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=Za(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Ya(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 Za(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 Ka=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Ga(e,t,"",n)},Qa=pa,Ja={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 el(e){this.options=Object.assign({},Ja,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Qa(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=rl),this.processTextOrObjNode=tl,this.options.format?(this.indentate=nl,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function tl(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 nl(e){return this.options.indentBy.repeat(e)}function rl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}el.prototype.build=function(e){return this.options.preserveOrder?Ka(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},el.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}},el.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},el.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}},el.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},el.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}},el.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 il={XMLParser:ja,XMLValidator:Ps,XMLBuilder:el},ol=[],sl=0;sl<256;++sl)ol.push((sl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class al extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ll extends al{constructor(e){super(e)}}class cl extends al{constructor(e){super(e)}}const dl=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}},ul=e=>{if(e)return e.FinInstnId?.BIC?{bic:e.FinInstnId.BIC}:e.FinInstnId?.BICFI?{bic:e.FinInstnId.BICFI}:e.FinInstnId?{abaRoutingNumber:(e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId.MmbId).toString()}:void 0},hl=(e,t="USD")=>{const n=Ms({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},fl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},ml=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=hl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,h=e.TxsSummry?.TtlCdtNtries.Sum,f=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=dl(e.Acct),g=ul(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(pl):e.Bal&&(w=[pl(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(gl):e.Ntry&&(y=[gl(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:h,numOfDebits:f,sumOfDebits:m,balances:w,entries:y}},pl=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=hl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:fl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},gl=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=fl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=hl(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=yl(e.BkTxCd);let h=e.NtryDtls||[];Array.isArray(h)||(h=[h]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:h.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(wl)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},wl=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(),h=e.RmtInf?.Strd?.AddtlRmtInf;let f,m,p,g,w,y,v,I;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm),e.RltdPties?.DbtrAcct&&(p=dl(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=ul(e.RltdAgts.DbtrAgt)),(m||p||g)&&(f={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm),e.RltdPties?.CdtrAcct&&(v=dl(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&(I=ul(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:f,creditor:w,invoiceRef:u,invoiceRefAdd:h}},yl=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 vl{_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 il.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=vl.getParser().parse(e);if(!t.Document)throw new ll("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new cl("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=>ml(e)):[ml(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new vl({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 Il(e){let t,n,r,i,o;function s(t){e[13](t)}let a={class:e[0],id:e[1],name:e[2],accept:".xml",max:"1",beforeChange:e[9]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function _l(e){let t,n;return t=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Cl(e){let t,n,r,i;const o=[_l,Il],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function El(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=n;const m="camt53"===u.properties?.type;let p=[],g=d[u.name]||"",w=!!d._id;const y=async(e,n,r,i,o,s)=>{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a&&console.log("bill",s,o,a),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}return""},v=async(e,n,r)=>{if("credit"!==e)return"";let i=C(n);if(i.startsWith("R-")||(i=""),!i&&r){if(r=r.toString(),i=C(r.replaceAll(" ","")),i.startsWith("R-")||(i=""),!i&&r.includes("R-")){i="R-"+r.split("R-")[1].slice(0,8)}if(!i&&r.includes("2025")){i="R-2025"+r.split("2025")[1].slice(0,4)}}if(!i)return"";const o=await t.getSectionView("invoice",{invoiceId:i});return o?.length?o[0]._id:""},I=async e=>{if(!e)return{};const n=await t.getSectionView("incomingPayment",{invoice:e});return n?.length?{incomingPayment:n[0]._id,paymentDate:n[0].date}:{}},_=async(e,t,n)=>{const r=await(async e=>vl.fromXML(e))(t);for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=r[e.properties.source];"date"===e.name&&(t=t.toISOString().slice(0,10)),s("record",{itemName:e.name,value:t})}const i=[],{refItem:o,value:a}=e.process.filter;for(const t of r[e.source])for(const e of t.entries){if(e[o]!==a)continue;let n="SALA"===e.bankTransactionCode?.domainSubFamilyCode,r=!1;for(const o of e.transactions){const s=await v(e.creditDebitIndicator,o.invoiceRef,o.remittanceInformation),{incomingPayment:a,paymentDate:l}=await I(s),c=await y(e.creditDebitIndicator,n,o.paymentInformationId,o.invoiceRef,o.amount,o.creditor?.account?.iban),d={accountServicerReferenceId:o.accountServicerReferenceId,messageId:o.messageId,account:t.account.iban,creditDebitIndicator:e.creditDebitIndicator,bookingDate:e.bookingDate,amount:o.amount,currency:o.currency,debtor:o.debtor?.name||"",debtorAccount:o.debtor?.account?.iban||"",creditor:o.creditor?.name||"",creditorAccount:o.creditor?.account?.iban||"",paymentInformationId:o.paymentInformationId,invoiceRef:o.invoiceRef,invoiceRefAdd:o.invoiceRefAdd,remittanceInformation:o.remittanceInformation,returnAdditionalInformation:o.returnAdditionalInformation,additionalInformation:e.additionalInformation,invoice:s,incomingPayment:a,isSalary:n,bill:c};if(n){if(r)continue;d.amount=e.amount/100,r=!0}i.push(d)}}i.length&&s("record",{itemName:e.name,value:i})},C=e=>{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};return e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(10,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(12,u=e.item),"id"in e&&r(1,h=e.id),"name"in e&&r(2,f=e.name)},[a,h,f,p,g,i,o,w,async()=>{const{list:e}=u.properties,n=p[0],i=await t.getEvent(l);if(n){r(4,g=n.name);const t=await n.text();if(m)return((e,t)=>{t.output.class[0].list.map(n=>_(n,e,t))})(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),a=[],l=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(l.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:C(t),information:n.RmtInf?.Ustrd||""};a.push(r)}}a.length&&s("record",{itemName:e,value:a})}},()=>{r(3,p)},l,d,u,function(e){p=e,r(3,p)}]}class Al extends Te{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}",N(document.head,t)),Se(this,e,El,Cl,$,{classId:0,eventId:10,record:11,item:12,id:1,name:2})}}const $l=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=bl(10,n[31]),t.amountVat=Sl(!0,bl(32,n[31]),t.amount)||Sl(!1,bl(33,n[31]),t.amount),t):t},bl=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},Sl=(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:Tl}=_e;function Nl(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}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function Rl(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]&&Dl(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(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&&we(o,1)):(o=Dl(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function Dl(e){let t,n,r,i,o;return n=new De({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-o0hiko")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function xl(e){let t,n,r,i;const o=[Rl,Nl],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}let Ol;function kl(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=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=$l(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 Y(()=>{if(Ol)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){Ol=PDF_QR_JS}}),Z(()=>{}),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,h=e.id),"name"in e&&r(2,f=e.name)},[a,h,f,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}}),Ol.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 Ml extends Te{constructor(e){var t;super(),Tl.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}",N(Tl.head,t)),Se(this,e,kl,xl,$,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Pl}=_e;function Bl(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}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function Ll(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]&&Fl(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(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&&we(o,1)):(o=Fl(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function Fl(e){let t,n,r,i,o;const s=[Ul,Vl],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=B()},m(e,t){a[n].m(e,t),R(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(pe(),ye(a[o],1,1,()=>{a[o]=null}),ge(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),we(r,1),r.m(i.parentNode,i))},i(e){o||(we(r),o=!0)},o(e){ye(r),o=!1},d(e){a[n].d(e),e&&D(i)}}}function Vl(e){let t,n,r,i,o;return n=new De({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-o0hiko")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[10]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ul(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:zl,then:Wl,catch:Hl,value:23};return ve(e[11](),n),{c(){t=B(),n.block.c()},m(e,r){R(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ie(n,e=t,r)},i:I,o:I,d(e){e&&D(t),n.block.d(e),n.token=null,n=null}}}function Hl(e){return{c:I,m:I,p:I,d:I}}function Wl(e){let t,n,r,i;return{c(){t=O("video"),n=O("source"),i=M("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&U(n,"src",r),U(n,"type","video/mp4"),U(t,"width","500"),t.controls=!0,z(t,"margin-top","1em")},m(e,r){R(e,t,r),N(t,n),N(t,i)},p:I,d(e){e&&D(t)}}}function zl(e){return{c:I,m:I,p:I,d:I}}function jl(e){let t,n,r,i;const o=[Ll,Bl],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function Gl(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Y(()=>{(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)})()}),Z(()=>{}),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,h=e.id),"name"in e&&r(2,f=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,h,f,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 ql extends Te{constructor(e){var t;super(),Pl.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}",N(Pl.head,t)),Se(this,e,Gl,jl,$,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function Xl(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:Yl,placeholder:Zl,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=O("div"),Ae(n.$$.fragment),z(t,"max-width","4em")},m(e,i){R(e,t,i),$e(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||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}const Yl="([01][0-9]|2[0-3]):([0-5][0-9])",Zl="";function Kl(e,t,n){const r=K(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:h}=t;const f=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,h=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:f(e.value)}),r("checkRange",{idx:h,fieldId:o,value:e.value})},s,h]}class Ql extends Te{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}",N(document.head,t)),Se(this,e,Kl,Xl,$,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Jl}=_e;function ec(e,t,n){const r=e.slice();return r[20]=t[n],r}function tc(e,t,n){const r=e.slice();return r[23]=t[n],r[25]=n,r}function nc(e){let t,n,r=e[2](e[20],e[23])+"",i=e[25]&&function(){let e;return{c(){e=M(", ")},m(t,n){R(t,e,n)},d(t){t&&D(e)}}}();return{c(){t=O("span"),i&&i.c(),n=M(r),U(t,"class","lookupValue")},m(e,r){R(e,t,r),i&&i.m(t,null),N(t,n)},p(e,t){3&t&&r!==(r=e[2](e[20],e[23])+"")&&H(n,r)},d(e){e&&D(t),i&&i.d()}}}function rc(e){let t,n,r,i,o,s,a,l,c=e[0],d=[];for(let t=0;t<c.length;t+=1)d[t]=nc(tc(e,c,t));return i=new it({props:{size:"18"}}),{c(){t=O("div");for(let e=0;e<d.length;e+=1)d[e].c();n=P(),r=O("span"),Ae(i.$$.fragment),o=P(),U(r,"class","feather pointer svelte-1r8jgd4"),U(t,"class","lookupItem svelte-1r8jgd4")},m(c,u){R(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);N(t,n),N(t,r),$e(i,r,null),N(t,o),s=!0,a||(l=L(r,"click",function(){A(e[3](e[20]._id))&&e[3](e[20]._id).apply(this,arguments)}),a=!0)},p(r,i){if(e=r,7&i){let r;for(c=e[0],r=0;r<c.length;r+=1){const o=tc(e,c,r);d[r]?d[r].p(o,i):(d[r]=nc(o),d[r].c(),d[r].m(t,n))}for(;r<d.length;r+=1)d[r].d(1);d.length=c.length}},i(e){s||(we(i.$$.fragment,e),s=!0)},o(e){ye(i.$$.fragment,e),s=!1},d(e){e&&D(t),x(d,e),be(i),a=!1,l()}}}function ic(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=rc(ec(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){t=O("div");for(let e=0;e<i.length;e+=1)i[e].c();U(t,"class","lookup svelte-1r8jgd4")},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(15&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=ec(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=rc(o),i[s].c(),we(i[s],1),i[s].m(t,null))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){e&&D(t),x(i,e)}}}function oc(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:h}=o.properties;let f=d.split(","),[p,g]=c.split(":"),w=[];const[y,v]=g.split("."),I=(e,t)=>{const[n,r]=t.split(".");return r?e[n][r]:""},_=(e=!0)=>{se().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 Y(_),e.$$set=e=>{"id"in e&&r(4,i=e.id),"item"in e&&r(5,o=e.item),"praefix"in e&&r(6,s=e.praefix),"record"in e&&r(7,a=e.record),"notifyList"in e&&r(8,l=e.notifyList)},e.$$.update=()=>{256&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==p)return;if(r(1,w=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[p])return _();const o=!f.some(e=>e.includes(":")),s=v?v+"."+p:p;let l={[s]:a[p]||a._id};if(h&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":h}}]),r(1,w=await t.getSectionView(y,l,o)),!o&&w.length){const e=f.find(e=>e.includes(":")),t=e.split(":")[0];r(1,w=w.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,f=f.map(e=>e.split(":")[1]))}_(!w.length)})(l)},[f,w,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||I(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)},i,o,s,a,l]}class sc extends Te{constructor(e){var t;super(),Jl.getElementById("svelte-1r8jgd4-style")||((t=O("style")).id="svelte-1r8jgd4-style",t.textContent=".feather.svelte-1r8jgd4{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1r8jgd4{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1r8jgd4{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}",N(Jl.head,t)),Se(this,e,oc,ic,$,{id:4,item:5,praefix:6,record:7,notifyList:8})}}function ac(e){let t,n,r;return n=new dt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function lc(e){let t,n,r,i,o;return n=new dt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function cc(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=[lc,ac],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function dc(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:h}=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,h=e.value)},[i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;let e=h;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){Q(e,t)}]}class uc extends Te{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}",N(document.head,t)),Se(this,e,dc,cc,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function hc(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function fc(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[11]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function mc(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[12]);const a=[fc,hc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function pc(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:h}=t,{pattern:f}=t,{placeholder:m}=t;f||="(\\+(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})$",m||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,i=e.inputClass),"disabled"in e&&n(3,o=e.disabled),"formnovalidate"in e&&n(4,s=e.formnovalidate),"readonly"in e&&n(5,a=e.readonly),"required"in e&&n(6,l=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,h=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,m=e.placeholder)},[f,m,i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;let e="tel:"+h;window.open(e,"_self")},function(t){Q(e,t)}]}class gc extends Te{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}",N(document.head,t)),Se(this,e,pc,mc,$,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function wc(e){let t,n,r;return n=new gt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function yc(e){let t,n,r,i,o;return n=new gt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[12]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function vc(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=[yc,wc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function Ic(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:h}=t,{multiple:f}=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,h=e.value),"multiple"in e&&n(8,f=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,h,f,m,p,r,async()=>{if(!h)return;let e="mailto:"+h;window.open(e,"_self")},function(t){Q(e,t)}]}class _c extends Te{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}",N(document.head,t)),Se(this,e,Ic,vc,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const Cc=["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 Ec(e){let t;return{c(){t=O("textarea"),U(t,"id",e[0]),z(t,"visibility","hidden")},m(n,r){R(n,t,r),e[20](t)},p(e,n){1&n&&U(t,"id",e[0])},d(n){n&&D(t),e[20](null)}}}function Ac(e){let t;return{c(){t=O("div"),U(t,"id",e[0])},m(n,r){R(n,t,r),e[19](t)},p(e,n){1&n&&U(t,"id",e[0])},d(n){n&&D(t),e[19](null)}}}function $c(e){let t;function n(e,t){return e[1]?Ac:Ec}let r=n(e),i=r(e);return{c(){t=O("div"),i.c(),U(t,"class",e[2])},m(n,r){R(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&&U(t,"class",e[2])},i:I,o:I,d(n){n&&D(t),i.d(),e[21](null)}}}const bc=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let Sc=(()=>{let e={listeners:[],scriptId:bc("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 Tc(e,t,n){let r,i,o,{id:s=bc("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:h="7"}=t,{scriptSrc:f}=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 C=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},E=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},A=K(),$=()=>{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",()=>{E(e,l),C(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)=>{Cc.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,A),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=$())||void 0===e||e.init(t)};return Y(()=>{if(null!==$())b();else{const e=f||`https://cdn.tiny.cloud/1/${d}/tinymce/${h}/tinymce.min.js`;Sc.load(r.ownerDocument,e,()=>{b()})}}),Z(()=>{var e;o&&(null===(e=$())||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,h=e.channel),"scriptSrc"in e&&n(12,f=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),C(o,c)),o&&l!==I&&(n(17,I=l),E(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,h,f,m,p,o,v,I,_,function(e){ee[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){ee[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){ee[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class Nc extends Te{constructor(e){super(),Se(this,e,Tc,$c,$,{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 Rc(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 Nc({props:c}),ee.push(()=>Ee(n,"value",l)),{c(){t=O("div"),Ae(n.$$.fragment),i=P(),o=O("input"),U(o,"class",s=e[1]||e[2]),U(o,"id",e[3]),U(o,"name",e[3]),o.value=e[0],o.hidden=!0,z(t,"min-height","10em"),z(t,"margin-top","-1em")},m(e,r){R(e,t,r),$e(n,t,null),N(t,i),N(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],le(()=>r=!1)),n.$set(i),(!a||6&t&&s!==(s=e[1]||e[2]))&&U(o,"class",s),(!a||8&t)&&U(o,"id",e[3]),(!a||8&t)&&U(o,"name",e[3]),(!a||1&t&&o.value!==e[0])&&(o.value=e[0])},i(e){a||(we(n.$$.fragment,e),a=!0)},o(e){ye(n.$$.fragment,e),a=!1},d(e){e&&D(t),be(n)}}}function Dc(e){let t,n,r=e[6]&&Rc(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,[n]){e[6]?r?(r.p(e,n),64&n&&we(r,1)):(r=Rc(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function xc(e,t,r){const i=K();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:h}=t,{readonly:f}=t;const m=(e,t)=>{if(!s)return;if(!e)return;if(!e.includes("{{"))return;const n=t.employee;if(n)try{Im("employee",n).then(t=>{if(!t)return;const n=e.replace("{{employee.firstName}}",t.firstName).replace("{{employee.lastName}}",t.lastName);i("blur",{value:n})})}catch(e){}},p={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 Y(()=>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,h=e.disabled),"readonly"in e&&r(5,f=e.readonly)},e.$$.update=()=>{257&e.$$.dirty&&(a||u)&&m(a,u)},[a,l,c,d,h,f,s,p,u,function(e){a=e,r(0,a)}]}class Oc extends Te{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}",N(document.head,t)),Se(this,e,xc,Dc,$,{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,h;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.TextArea,s=e.toasts,a=e.settings,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){h=e.taskClipboard}],execute:function(){function f(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.66");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=>e?"(ja)":"(nein)",w=(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]?g(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]&&g(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!y(e)).join(" · ")).filter(e=>!!e).join(" • ")},y=e=>/^[0-9a-f]{24}/.test(e),v=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};function I(){}function _(e){return e()}function C(){return Object.create(null)}function E(e){e.forEach(_)}function A(e){return"function"==typeof e}function $(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function b(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return I;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function T(e,t,n=t){return e.set(n),t}function N(e,t){e.appendChild(t)}function R(e,t,n){e.insertBefore(t,n||null)}function D(e){e.parentNode.removeChild(e)}function x(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 k(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function M(e){return document.createTextNode(e)}function P(){return M(" ")}function B(){return M("")}function L(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function F(e){return function(t){return t.preventDefault(),e.call(this,t)}}function V(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function U(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 W(e,t){e.value=null==t?"":t}function z(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function j(e,t,n){e.classList[n?"add":"remove"](t)}let G;function q(e){G=e}function X(){if(!G)throw new Error("Function called outside component initialization");return G}function Y(e){X().$$.on_mount.push(e)}function Z(e){X().$$.on_destroy.push(e)}function K(){const e=X();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 Q(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const J=[],ee=[],te=[],ne=[],re=Promise.resolve();let ie=!1;function oe(){ie||(ie=!0,re.then(ue))}function se(){return oe(),re}function ae(e){te.push(e)}function le(e){ne.push(e)}let ce=!1;const de=new Set;function ue(){if(!ce){ce=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];q(t),he(t.$$)}for(q(null),J.length=0;ee.length;)ee.pop()();for(let e=0;e<te.length;e+=1){const t=te[e];de.has(t)||(de.add(t),t())}te.length=0}while(J.length);for(;ne.length;)ne.pop()();ie=!1,ce=!1,de.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(ae)}}const fe=new Set;let me;function pe(){me={r:0,c:[],p:me}}function ge(){me.r||E(me.c),me=me.p}function we(e,t){e&&e.i&&(fe.delete(e),e.i(t))}function ye(e,t,n,r){if(e&&e.o){if(fe.has(e))return;fe.add(e),me&&me.c.push(()=>{fe.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function ve(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&&(pe(),ye(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),ge())}):t.block.d(1),a.c(),we(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&ue()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=X();if(e.then(e=>{q(n),r(t.then,1,t.value,e),q(null)},e=>{if(q(n),r(t.catch,2,t.error,e),q(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 Ie(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){ye(e,1,1,()=>{t.delete(e.key)})}function Ee(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Ae(e){e&&e.c()}function $e(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||ae(()=>{const t=o.map(_).filter(A);s?s.push(...t):E(t),e.$$.on_mount=[]}),a.forEach(ae)}function be(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 Se(e,t,n,r,i,o,s=[-1]){const a=G;q(e);const l=e.$$={fragment:null,ctx:null,props:o,update:I,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]&&(J.push(e),oe(),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(D)}else l.fragment&&l.fragment.c();t.intro&&we(e.$$.fragment),$e(e,t.target,t.anchor,t.customElement),ue()}q(a)}class Te{$destroy(){be(this,1),this.$destroy=I}$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 Ne(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polygon"),U(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"),U(r,"points","12 15 17 21 7 21 12 15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-airplay "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Re(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 De extends Te{constructor(e){super(),Se(this,e,Re,Ne,$,{size:0,strokeWidth:1,class:2})}}function xe(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("line"),i=k("line"),U(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"),U(r,"x1","12"),U(r,"y1","9"),U(r,"x2","12"),U(r,"y2","13"),U(i,"x1","12"),U(i,"y1","17"),U(i,"x2","12.01"),U(i,"y2","17"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function Oe(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 Te{constructor(e){super(),Se(this,e,Oe,xe,$,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("circle"),r=k("polyline"),i=k("line"),U(n,"cx","12"),U(n,"cy","12"),U(n,"r","10"),U(r,"points","8 12 12 16 16 12"),U(i,"x1","12"),U(i,"y1","8"),U(i,"x2","12"),U(i,"y2","16"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function Pe(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 Be extends Te{constructor(e){super(),Se(this,e,Pe,Me,$,{size:0,strokeWidth:1,class:2})}}function Le(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("path"),U(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),U(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-book-open "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Fe(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 Ve extends Te{constructor(e){super(),Se(this,e,Fe,Le,$,{size:0,strokeWidth:1,class:2})}}function Ue(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("circle"),U(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"),U(r,"cx","12"),U(r,"cy","13"),U(r,"r","4"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-camera "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function He(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 Te{constructor(e){super(),Se(this,e,He,Ue,$,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),U(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),U(r,"points","22 4 12 14.01 9 11.01"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(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 Ge extends Te{constructor(e){super(),Se(this,e,je,ze,$,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,r;return{c(){t=k("svg"),n=k("path"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",r="feather feather-command "+e[2])},m(e,r){R(e,t,r),N(t,n)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&U(t,"class",r)},i:I,o:I,d(e){e&&D(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 Ye extends Te{constructor(e){super(),Se(this,e,Xe,qe,$,{size:0,strokeWidth:1,class:2})}}function Ze(e){let t,n,r,i;return{c(){t=k("svg"),n=k("polyline"),r=k("path"),U(n,"points","9 10 4 15 9 20"),U(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function Ke(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 Qe extends Te{constructor(e){super(),Se(this,e,Ke,Ze,$,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("line"),i=k("line"),U(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),U(r,"x1","18"),U(r,"y1","9"),U(r,"x2","12"),U(r,"y2","15"),U(i,"x1","12"),U(i,"y1","9"),U(i,"x2","18"),U(i,"y2","15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-delete "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function et(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 tt extends Te{constructor(e){super(),Se(this,e,et,Je,$,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),i=k("line"),U(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),U(r,"points","15 3 21 3 21 9"),U(i,"x1","10"),U(i,"y1","14"),U(i,"x2","21"),U(i,"y2","3"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-external-link "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function rt(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 it extends Te{constructor(e){super(),Se(this,e,rt,nt,$,{size:0,strokeWidth:1,class:2})}}function ot(e){let t,n,r,i,o,s;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),i=k("line"),o=k("line"),U(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),U(r,"points","14 2 14 8 20 8"),U(i,"x1","12"),U(i,"y1","18"),U(i,"x2","12"),U(i,"y2","12"),U(o,"x1","9"),U(o,"y1","15"),U(o,"x2","15"),U(o,"y2","15"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){R(e,t,s),N(t,n),N(t,r),N(t,i),N(t,o)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&U(t,"class",s)},i:I,o:I,d(e){e&&D(t)}}}function st(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 at extends Te{constructor(e){super(),Se(this,e,st,ot,$,{size:0,strokeWidth:1,class:2})}}function lt(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("circle"),r=k("line"),i=k("path"),U(n,"cx","12"),U(n,"cy","12"),U(n,"r","10"),U(r,"x1","2"),U(r,"y1","12"),U(r,"x2","22"),U(r,"y2","12"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-globe "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(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 dt extends Te{constructor(e){super(),Se(this,e,ct,lt,$,{size:0,strokeWidth:1,class:2})}}function ut(e){let t,n,r,i,o,s,a,l;return{c(){t=k("svg"),n=k("line"),r=k("line"),i=k("line"),o=k("line"),s=k("line"),a=k("line"),U(n,"x1","8"),U(n,"y1","6"),U(n,"x2","21"),U(n,"y2","6"),U(r,"x1","8"),U(r,"y1","12"),U(r,"x2","21"),U(r,"y2","12"),U(i,"x1","8"),U(i,"y1","18"),U(i,"x2","21"),U(i,"y2","18"),U(o,"x1","3"),U(o,"y1","6"),U(o,"x2","3.01"),U(o,"y2","6"),U(s,"x1","3"),U(s,"y1","12"),U(s,"x2","3.01"),U(s,"y2","12"),U(a,"x1","3"),U(a,"y1","18"),U(a,"x2","3.01"),U(a,"y2","18"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",l="feather feather-list "+e[2])},m(e,l){R(e,t,l),N(t,n),N(t,r),N(t,i),N(t,o),N(t,s),N(t,a)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&U(t,"class",l)},i:I,o:I,d(e){e&&D(t)}}}function ht(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 Te{constructor(e){super(),Se(this,e,ht,ut,$,{size:0,strokeWidth:1,class:2})}}function mt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("polyline"),U(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"),U(r,"points","22,6 12,13 2,6"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-mail "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function pt(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 gt extends Te{constructor(e){super(),Se(this,e,pt,mt,$,{size:0,strokeWidth:1,class:2})}}function wt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("path"),r=k("circle"),U(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),U(r,"cx","12"),U(r,"cy","10"),U(r,"r","3"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function yt(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 vt extends Te{constructor(e){super(),Se(this,e,yt,wt,$,{size:0,strokeWidth:1,class:2})}}function It(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("polyline"),r=k("line"),i=k("path"),U(n,"points","23 7 23 1 17 1"),U(r,"x1","16"),U(r,"y1","8"),U(r,"x2","23"),U(r,"y2","1"),U(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"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function _t(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 Te{constructor(e){super(),Se(this,e,_t,It,$,{size:0,strokeWidth:1,class:2})}}function Et(e){let t,n,r,i,o;return{c(){t=k("svg"),n=k("polyline"),r=k("path"),i=k("rect"),U(n,"points","6 9 6 2 18 2 18 9"),U(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"),U(i,"x","6"),U(i,"y","14"),U(i,"width","12"),U(i,"height","8"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",o="feather feather-printer "+e[2])},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&U(t,"class",o)},i:I,o:I,d(e){e&&D(t)}}}function At(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 Te{constructor(e){super(),Se(this,e,At,Et,$,{size:0,strokeWidth:1,class:2})}}function bt(e){let t,n,r,i;return{c(){t=k("svg"),n=k("circle"),r=k("line"),U(n,"cx","11"),U(n,"cy","11"),U(n,"r","8"),U(r,"x1","21"),U(r,"y1","21"),U(r,"x2","16.65"),U(r,"y2","16.65"),U(t,"xmlns","http://www.w3.org/2000/svg"),U(t,"width",e[0]),U(t,"height",e[0]),U(t,"fill","none"),U(t,"viewBox","0 0 24 24"),U(t,"stroke","currentColor"),U(t,"stroke-width",e[1]),U(t,"stroke-linecap","round"),U(t,"stroke-linejoin","round"),U(t,"class",i="feather feather-search "+e[2])},m(e,i){R(e,t,i),N(t,n),N(t,r)},p(e,[n]){1&n&&U(t,"width",e[0]),1&n&&U(t,"height",e[0]),2&n&&U(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&U(t,"class",i)},i:I,o:I,d(e){e&&D(t)}}}function St(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 Tt extends Te{constructor(e){super(),Se(this,e,St,bt,$,{size:0,strokeWidth:1,class:2})}}const{document:Nt}=_e;function Rt(e){e[49]=e[50].items}function Dt(e,t,n){const r=e.slice();return r[51]=t[n],r[53]=n,r}function xt(e,t,n){const r=e.slice();return r[54]=t[n],r}function Ot(e,t,n){const r=e.slice();return r[54]=t[n],r}function kt(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Mt(e){let t,n,r,i,o,s;Rt(e);let a=e[5]?.length&&Pt(e),l=e[49]?.length&&Lt(e),c=e[5]?.length&&Ut(e);return{c(){a&&a.c(),t=P(),n=O("div"),r=O("table"),l&&l.c(),i=P(),o=O("tbody"),c&&c.c(),U(r,"striped",""),U(r,"class","svelte-47aais"),U(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),R(e,t,d),R(e,n,d),N(n,r),l&&l.m(r,null),N(r,i),N(r,o),c&&c.m(o,null),s=!0},p(e,n){Rt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&we(a,1)):(a=Pt(e),a.c(),we(a,1),a.m(t.parentNode,t)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge()),e[49]?.length?l?l.p(e,n):(l=Lt(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&we(c,1)):(c=Ut(e),c.c(),we(c,1),c.m(o,null)):c&&(pe(),ye(c,1,1,()=>{c=null}),ge())},i(e){s||(we(a),we(c),s=!0)},o(e){ye(a),ye(c),s=!1},d(e){a&&a.d(e),e&&D(t),e&&D(n),l&&l.d(),c&&c.d()}}}function Pt(e){let t,n,r,i,o,s,a,l,c,d,u,h=e[6]&&Bt(e);function f(t){e[33](t)}let m={id:e[10]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),ee.push(()=>Ee(i,"value",f)),i.$on("input",e[14]),l=new tt({props:{size:"18"}}),{c(){h&&h.c(),t=P(),n=O("div"),r=M("Suchen: "),Ae(i.$$.fragment),s=P(),a=O("span"),Ae(l.$$.fragment),U(a,"class","feather pointer svelte-47aais"),z(n,"margin-bottom","1em"),z(n,"position","relative")},m(o,f){h&&h.m(o,f),R(o,t,f),R(o,n,f),N(n,r),$e(i,n,null),N(n,s),N(n,a),$e(l,a,null),c=!0,d||(u=L(a,"click",e[16]),d=!0)},p(e,n){e[6]?h?64&n[0]&&we(h,1):(h=Bt(e),h.c(),we(h,1),h.m(t.parentNode,t)):h&&(pe(),ye(h,1,1,()=>{h=null}),ge());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],le(()=>o=!1)),i.$set(r)},i(e){c||(we(h),we(i.$$.fragment,e),we(l.$$.fragment,e),c=!0)},o(e){ye(h),ye(i.$$.fragment,e),ye(l.$$.fragment,e),c=!1},d(e){h&&h.d(e),e&&D(t),e&&D(n),be(i),be(l),d=!1,u()}}}function Bt(e){let t,n;return t=new e[7]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Lt(e){let t,n,r,i=e[4]&&e[0]&&Ft(),o=e[49],s=[];for(let t=0;t<o.length;t+=1)s[t]=Vt(Ot(e,o,t));return{c(){t=O("thead"),n=O("tr"),i&&i.c(),r=P();for(let e=0;e<s.length;e+=1)s[e].c();U(n,"class","svelte-47aais"),U(t,"class","svelte-47aais")},m(e,o){R(e,t,o),N(t,n),i&&i.m(n,null),N(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=Ft(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),8196&t[0]){let r;for(o=e[49],r=0;r<o.length;r+=1){const i=Ot(e,o,r);s[r]?s[r].p(i,t):(s[r]=Vt(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&&D(t),i&&i.d(),x(s,e)}}}function Ft(e){let t;return{c(){t=O("th"),U(t,"class","svelte-47aais")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Vt(e){let t,n,r=e[54]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-47aais")},m(e,r){R(e,t,r),N(t,n)},p(e,t){4&t[0]&&r!==(r=e[54]?.designation+"")&&H(n,r)},d(e){e&&D(t)}}}function Ut(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[51].index||e[51]?._id;for(let t=0;t<o.length;t+=1){let n=Dt(e,o,t),a=s(n);i.set(a,r[t]=jt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);R(e,t,i),n=!0},p(e,n){178239&n[0]&&(o=e[5],pe(),r=function(e,t,n,r,i,o,s,a,l,c,d,u){let h=e.length,f=o.length,m=h;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=f;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){we(e,1),e.m(a,d),s.set(e.key,e),d=e.first,f--}for(;h&&f;){const t=g[f-1],n=e[h-1],r=t.key,i=n.key;t===n?(d=t.first,h--,f--):w.has(i)?!s.has(r)||v.has(r)?_(t):I.has(i)?h--:y.get(r)>y.get(i)?(I.add(r),_(t)):(v.add(i),h--):(l(n,s),h--)}for(;h--;){const t=e[h];w.has(t.key)||l(t,s)}for(;f;)_(g[f-1]);return g}(r,n,s,1,e,o,i,t.parentNode,Ce,jt,t,Dt),ge())},i(e){if(!n){for(let e=0;e<o.length;e+=1)we(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)ye(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&D(t)}}}function Ht(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Wt(e),l=e[49],c=[];for(let t=0;t<l.length;t+=1)c[t]=zt(xt(e,l,t));return{c(){t=O("tr"),a&&a.c(),n=P();for(let e=0;e<c.length;e+=1)c[e].c();r=P(),U(t,"class","pointer svelte-47aais"),j(t,"active",e[51]._id===e[1]),j(t,"blocked",!!e[51].blocked),j(t,"undeliverable",!!e[51].undeliverable)},m(l,d){R(l,t,d),a&&a.m(t,null),N(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);N(t,r),i=!0,o||(s=L(t,"click",V(function(){A(e[12](e[51],e[53]))&&e[12](e[51],e[53]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&we(a,1)):(a=Wt(e),a.c(),we(a,1),a.m(t,n)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge()),10276&o[0]){let n;for(l=e[49],n=0;n<l.length;n+=1){const i=xt(e,l,n);c[n]?c[n].p(i,o):(c[n]=zt(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]&&j(t,"active",e[51]._id===e[1]),32&o[0]&&j(t,"blocked",!!e[51].blocked),32&o[0]&&j(t,"undeliverable",!!e[51].undeliverable)},i(e){i||(we(a),i=!0)},o(e){ye(a),i=!1},d(e){e&&D(t),a&&a.d(),x(c,e),o=!1,s()}}}function Wt(e){let t,n,r,i,o;return n=new it({props:{size:"18"}}),{c(){t=O("td"),Ae(n.$$.fragment),U(t,"class","editRow svelte-47aais"),z(t,"color","#326173")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",V(function(){A(e[17](e[51]))&&e[17](e[51]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function zt(e){let t,n,r,i=e[11](e[51],e[54])+"";return{c(){t=O("td"),n=M(i),U(t,"class",r=S(e[54].type)+" svelte-47aais")},m(e,r){R(e,t,r),N(t,n)},p(e,o){36&o[0]&&i!==(i=e[11](e[51],e[54])+"")&&H(n,i),4&o[0]&&r!==(r=S(e[54].type)+" svelte-47aais")&&U(t,"class",r)},d(e){e&&D(t)}}}function jt(e,t){let n,r,i,o=t[15](t[51],t[49],t[3]),s=o&&Ht(t);return{key:e,first:null,c(){n=B(),s&&s.c(),r=B(),this.first=n},m(e,t){R(e,n,t),s&&s.m(e,t),R(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[15](t[51],t[49],t[3])),o?s?(s.p(t,n),44&n[0]&&we(s,1)):(s=Ht(t),s.c(),we(s,1),s.m(r.parentNode,r)):s&&(pe(),ye(s,1,1,()=>{s=null}),ge())},i(e){i||(we(s),i=!0)},o(e){ye(s),i=!1},d(e){e&&D(n),s&&s.d(e),e&&D(r)}}}function Gt(e){let t,n;return t=new e[7]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function qt(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Gt,then:Mt,catch:kt,value:50,blocks:[,,,]};return ve(n=e[2]&&e[13](),i),{c(){t=B(),i.block.c()},m(e,n){R(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[13]())&&ve(n,i)||Ie(i,e,r)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),i.block.d(e),i.token=null,i=null}}}const Xt=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))),a||(a=n.items.find(t=>t.name===e)),!a){const n=(await t.getSchemaByClass(e)).items.find(e=>e.name===s);n&&(a={name:e,designation:n.designation,type:n.type,decimals:n.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function Yt(e,i,o){let s;let a=JSON.parse(n.getItem("Locale")).id;const l=K(),{Loading:d,TextField:h}=c,{currentTasks:f}=u;b(e,f,e=>o(37,s=e));let p,w,y,v,{inputList:I}=i,{eventId:_}=i,{prevEventId:C}=i,{record:E}=i,{className:A}=i,{rowId:$}=i,{filterForReady:S=!1}=i,{filter:T}=i,{query:N}=i,{refStatus:R}=i,{showEdit:D=!1}=i,{praefix:x=""}=i,{selectionFields:O=!1}=i,{deList:k}=i,{stopAggregation:M=!1}=i,{shouldBlock:P}=i,{inputSearch:B=""}=i,L=!0,F=B,V=A+Math.floor(9e3*Math.random()+1e3).toString()+"search",U=!1,H=!0;const W=(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("_")){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(a,{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?g(n):m(e[`_${t.name}`]||n||"")},z=t.getSchemaByClass(A),j=async(e,n)=>{if(!e)return[];if(T){let n;const r=T.startsWith("!");r&&(n=T.replace("!",""));const i=T.startsWith("$");if(n&&!i&&(e=e.filter(e=>i?e[n]===$:r?!e[n]:!!e[n])),i){n=T.replace("$","");const[r,i]=n.split(".");if(E[i]){const n=await t.getSectionView(r,{[i]:E[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(R&&!N)return o(18,R=[].concat(R)),e.filter(e=>!!R.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(C){const n=await t.getEvent(C);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===A)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)},G=(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(a,{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},q=async e=>{let n,r=0;H=!1;const i=e=>new Promise(t=>setTimeout(t,e)),s=await z;for(;r++<200&&!M&&!(n=await X(e,s.id));)await i(500);o(6,U=!1),M&&t.readTasksByAggregationId(e,!0),n&&(o(5,y=G(w.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),H=!0},100))},X=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),Z=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(x),c=l&&await Im(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 ym(o+r._id.toString(),r),r}):e};Y(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(V)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await z;e.eventId===t.id&&(_m(t.class,e.eventId),o(2,L=!o(2,L=!1)))});return e.$$set=e=>{"inputList"in e&&o(20,I=e.inputList),"eventId"in e&&o(21,_=e.eventId),"prevEventId"in e&&o(22,C=e.prevEventId),"record"in e&&o(23,E=e.record),"className"in e&&o(24,A=e.className),"rowId"in e&&o(1,$=e.rowId),"filterForReady"in e&&o(25,S=e.filterForReady),"filter"in e&&o(26,T=e.filter),"query"in e&&o(27,N=e.query),"refStatus"in e&&o(18,R=e.refStatus),"showEdit"in e&&o(0,D=e.showEdit),"praefix"in e&&o(28,x=e.praefix),"selectionFields"in e&&o(29,O=e.selectionFields),"deList"in e&&o(30,k=e.deList),"stopAggregation"in e&&o(19,M=e.stopAggregation),"shouldBlock"in e&&o(31,P=e.shouldBlock),"inputSearch"in e&&o(32,B=e.inputSearch)},[D,$,L,F,p,y,U,d,h,f,V,W,(e,t)=>n=>{o(19,M=!0);const r=H?e:v[t];l("choose",{row:r})},async()=>{w=await z,o(4,p=(e=>!s?.length||!!s.find(t=>t===e))(w.id)),N&&o(5,y=v=await t.getTasksFiltered(w.class,N)),y||o(5,y=v=G(w.displaySort,await I||await gm(w.class,w.id))),500!==y?.length||N||(o(6,U=!0),t.getTasksList(w.id,!1,!0).then(({aggregationId:e})=>q(e)));let e,n=!1,r="";const i=O&&O?.find(e=>w.class===e.refClass.split(":")[0]),a=i?.value?.get&&i.value.get(x);if(a){const[s,l]=i.refClass.split(":");w.class===s&&o(5,y=await Z(y,s,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],a,s,"quantity")}o(0,D&&=!i),!i&&(T||S||R)&&o(5,y=await j(y,w));const{display:c}=w;let d=await Xt(c,w,y);return!D&&n?(d=d.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),o(5,y=y.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(!y.find(t=>t._id===e._id)){const t=v.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),y.push(t)}}),l("init",y)):k&&o(5,y=y.filter(e=>!k.find(t=>t?._id===e._id))),P&&o(5,y=y.filter(e=>!e[P])),{items:d}},({detail:{value:e}})=>{o(3,F=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=W(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,F="")},async e=>{let t=e._task;t||(t=await wm(A,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},R,M,I,_,C,E,A,S,T,N,x,O,k,P,B,function(e){F=e,o(3,F)}]}class Zt extends Te{constructor(e){var t;super(),Nt.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}",N(Nt.head,t)),Se(this,e,Yt,qt,$,{inputList:20,eventId:21,prevEventId:22,record:23,className:24,rowId:1,filterForReady:25,filter:26,query:27,refStatus:18,showEdit:0,praefix:28,selectionFields:29,deList:30,stopAggregation:19,shouldBlock:31,inputSearch:32},[-1,-1])}}function Kt(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Qt(e){let t,n,r=e[45]&&Jt(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&we(r,1)):(r=Jt(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Jt(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[dn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function en(e){let t,n;return t=new Am({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function tn(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[rn,nn],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new Zt({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(){Ae(t.$$.fragment),n=P(),i.c(),o=P(),Ae(s.$$.fragment)},m(e,i){$e(t,e,i),R(e,n,i),c[r].m(e,i),R(e,o,i),$e(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):(pe(),ye(c[u],1,1,()=>{c[u]=null}),ge(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),we(i,1),i.m(o.parentNode,o));const h={};32768&n[0]&&(h.inputSearch=e[15]),8&n[0]&&(h.record=e[3]),4&n[0]&&(h.eventId=e[2].id),4&n[0]&&(h.className=e[2].class),16384&n[0]&&(h.prevEventId=e[14]),32&n[0]&&(h.filterForReady=e[5]),64&n[0]&&(h.filter=e[6]),128&n[0]&&(h.query=e[7]),256&n[0]&&(h.refStatus=e[8]),512&n[0]&&(h.praefix=e[9]),1024&n[0]&&(h.selectionFields=e[10]),2&n[0]&&(h.rowId=e[1]),65536&n[0]&&(h.shouldBlock=e[16]),4096&n[0]&&(h.deList=e[12]),16777216&n[0]&&(h.stopAggregation=e[24]),2048&n[0]&&(h.showEdit=e[11]),s.$set(h)},i(e){a||(we(t.$$.fragment,e),we(i),we(s.$$.fragment,e),a=!0)},o(e){ye(t.$$.fragment,e),ye(i),ye(s.$$.fragment,e),a=!1},d(e){be(t,e),e&&D(n),c[r].d(e),e&&D(o),be(s,e)}}}function nn(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[on]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&sn(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),U(t,"class","form--buttons svelte-jb5mrh")},m(e,s){R(e,t,s),$e(n,t,null),N(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]&&we(o,1)):(o=sn(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function rn(e){let t,n,r,i,o,s,a=e[23]&&ln(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[cn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=P(),n=O("div"),Ae(r.$$.fragment),i=P(),Ae(o.$$.fragment),U(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),R(e,t,l),R(e,n,l),$e(r,n,null),R(e,i,l),$e(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&we(a,1)):(a=ln(e),a.c(),we(a,1),a.m(t.parentNode,t)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge());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||(we(a),we(r.$$.fragment,e),we(o.$$.fragment,e),s=!0)},o(e){ye(a),ye(r.$$.fragment,e),ye(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&D(t),e&&D(n),be(r),e&&D(i),be(o,e)}}}function on(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function sn(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[an]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function an(e){let t;return{c(){t=M("Neu")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ln(e){let t,n;return t=new Hd({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function cn(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function dn(e){let t,n,r,i;const o=[tn,en],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=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function un(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function hn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:un,then:Qt,catch:Kt,value:45,blocks:[,,,]};return ve(n=e[30](e[4]),i),{c(){t=B(),i.block.c()},m(e,n){R(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]))&&ve(n,i)||Ie(i,e,r)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),i.block.d(e),i.token=null,i=null}}}function fn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=K(),{currentTasks:d}=u;b(e,d,e=>r(41,i=e));let{title:h}=n,{schema:f}=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:C=!1}=n,{showEdit:E=!0}=n,{deList:A}=n,{newAllowed:$=!0}=n,{prevEventId:S}=n,{inputSearch:T}=n,{shouldBlock:N}=n,R=f.id;f.class;let D,x,O,k,M,P,B,L="",F=!1,V=!1;h??=f.identity.designation;const U=!i?.length||i.find(e=>e===R);return e.$$set=e=>{"title"in e&&r(0,h=e.title),"schema"in e&&r(2,f=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,C=e.selectionFields),"showEdit"in e&&r(11,E=e.showEdit),"deList"in e&&r(12,A=e.deList),"newAllowed"in e&&r(13,$=e.newAllowed),"prevEventId"in e&&r(14,S=e.prevEventId),"inputSearch"in e&&r(15,T=e.inputSearch),"shouldBlock"in e&&r(16,N=e.shouldBlock)},[h,p,f,m,g,w,y,v,I,_,C,E,A,$,S,T,N,L,F,D,O,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await gm(f.class,f.id);if(x=C&&C?.find(e=>f.class===e.refClass.split(":")[0]),r(20,O=x?.value?.get&&x.value.get(_)),O){k=x.refClass;const[e,n]=k.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"),E||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=f.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=f.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})=>{O&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){Q(e,t)}]}class mn extends Te{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}",N(document.head,t)),Se(this,e,fn,hn,$,{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:pn}=_e;function gn(e){e[28]=e[30].list,e[29]=e[30].items}function wn(e,t,n){const r=e.slice();return r[31]=t[n],r}function yn(e,t,n){const r=e.slice();return r[34]=t[n],r}function vn(e,t,n){const r=e.slice();return r[34]=t[n],r}function In(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function _n(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[25](t)}gn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Cn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let I={id:e[8]};void 0!==e[1]&&(I.value=e[1]),s=new e[6]({props:I}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=En(vn(e,o,t));return{c(){t=O("thead"),n=O("tr"),r=O("th"),i=P();for(let e=0;e<s.length;e+=1)s[e].c();U(r,"class","svelte-14hcfjl"),U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,o){R(e,t,o),N(t,n),N(n,r),N(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=vn(e,o,r);s[r]?s[r].p(i,t):(s[r]=En(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&&D(t),x(s,e)}}}(e),C=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=bn(wn(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=wn(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=bn(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){gn(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],le(()=>a=!1)),s.$set(i),e[29]?.length&&_.p(e,t),e[28]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),we(C),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),ye(C),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function Cn(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function En(e){let t,n,r=e[34]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function An(e){let t,n,r,i,o,s,a,l;r=new it({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=$n(yn(e,c,t));return{c(){t=O("tr"),n=O("td"),Ae(r.$$.fragment),i=P();for(let e=0;e<d.length;e+=1)d[e].c();o=P(),U(n,"class","editRow svelte-14hcfjl"),U(t,"class","pointer svelte-14hcfjl"),j(t,"active",e[31]._id===e[0])},m(c,u){R(c,t,u),N(t,n),$e(r,n,null),N(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);N(t,o),s=!0,a||(l=L(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=yn(e,c,n);d[n]?d[n].p(i,r):(d[n]=$n(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&r[0]&&j(t,"active",e[31]._id===e[0])},i(e){s||(we(r.$$.fragment,e),s=!0)},o(e){ye(r.$$.fragment,e),s=!1},d(e){e&&D(t),be(r),x(d,e),a=!1,l()}}}function $n(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function bn(e){let t,n,r=e[13](e[31],e[29],e[1]),i=r&&An(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){2&n[0]&&(r=e[13](e[31],e[29],e[1])),r?i?(i.p(e,n),2&n[0]&&we(i,1)):(i=An(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Sn(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Tn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Sn,then:_n,catch:In,value:30,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Nn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Tn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Rn(e,n,i){const o=K(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:h}=n,{classId:f}=n,{className:p}=n,{rowId:w}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:_}=n,{multiValues:C}=n,E="",A=f+Math.floor(9e3*Math.random()+1e3).toString()+"search";const $=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Y(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(A)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&_m(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,h=e.item),"classId"in e&&i(17,f=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(0,w=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,C=e.multiValues)},[w,E,o,s,a,l,d,u,A,$,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(h.lookup){let r,i,o;if("string"==typeof h.lookup){if(r="."+f+"#"+h.lookup,i=document.querySelector(r),o=i?.value||I,C.has(h.lookup)){const r=C.get(h.lookup)[0];n=r?await t.getSectionView(h.name,{[h.lookup]:r},!0):await gm(h.name,e.id)}else if(o&&24===o.toString().length){const e=await Im(h.lookup,o);if(e){const r=e[h.name]?.map(e=>e[h.name]);r&&(n=await t.getSectionView(h.name,{_id:{$in:r}},!0))}}}else{const{refItem:e,refList:s}=h.lookup,[a,l]=e.split(".");r="."+f+"#"+a,i=document.querySelector(r),o=i?.value||I;let c=await t.getDocById(a,o);if(c&&l&&(c=await t.getDocById(l,c[l])),c){const e=c[s].map(e=>e[h.name]);n=await t.getSectionView(h.name,{_id:{$in:e}},!0)}}}else{const r="."+f+"#"+y.split(":")[0],i=document.querySelector(r);let o={[y]:i?.value||I};if(h.refItem){const e="."+f+"#"+h.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[h.refItem]:t.value},{[h.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 Xt(r,e,n)}},({detail:{value:e}})=>{i(1,E=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if($(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,E="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},h,f,p,y,v,I,_,C,()=>o("back"),function(e){E=e,i(1,E)}]}class Dn extends Te{constructor(e){var t;super(),pn.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}",N(pn.head,t)),Se(this,e,Rn,Nn,$,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23},[-1,-1])}}const{document:xn}=_e;function On(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function kn(e){let t,n,r=e[72]&&function(e){let t,n,r,i,s,a,l,c,d,u,h,f,m,p,g,w,y,v,I;function _(t){e[55](t)}function C(t){e[56](t)}let E={class:"full-width",id:e[32],rows:"1",required:e[2],disabled:e[3],placeholder:e[34],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[25]&&(E.overwrite=e[25]);n=new o({props:E}),ee.push(()=>Ee(n,"value",_)),ee.push(()=>Ee(n,"overwrite",C)),n.$on("click",e[37]()),n.$on("blur",e[44]);const A=[Pn,Mn],$=[];function b(e,t){return!e[3]||e[16]?0:e[22]&&e[0]?1:-1}~(a=b(e))&&(l=$[a]=A[a](e));let T=(!e[3]||e[16]||e[17])&&Bn(e);function x(t){e[57](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[Un]},$$scope:{ctx:e}};void 0!==e[19]&&(k.open=e[19]);m=new e[28]({props:k}),ee.push(()=>Ee(m,"open",x));let M=e[20]&&Hn(e);return{c(){t=O("div"),Ae(n.$$.fragment),s=P(),l&&l.c(),c=P(),d=O("input"),h=P(),T&&T.c(),f=P(),Ae(m.$$.fragment),g=P(),M&&M.c(),w=B(),U(d,"class",u=S(e[9]||e[10])+" svelte-1wtpa4f"),U(d,"id",e[5]),U(d,"name",e[5]),d.value=e[0],d.hidden=!0,z(t,"position","relative")},m(r,i){R(r,t,i),$e(n,t,null),N(t,s),~a&&$[a].m(t,null),N(t,c),N(t,d),N(t,h),T&&T.m(t,null),R(r,f,i),$e(m,r,i),R(r,g,i),M&&M.m(r,i),R(r,w,i),y=!0,v||(I=L(t,"keydown",e[38]),v=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]),!r&&2&o[0]&&(r=!0,s.value=e[1],le(()=>r=!1)),!i&&33554432&o[0]&&(i=!0,s.overwrite=e[25],le(()=>i=!1)),n.$set(s);let h=a;a=b(e),a===h?~a&&$[a].p(e,o):(l&&(pe(),ye($[h],1,1,()=>{$[h]=null}),ge()),~a?(l=$[a],l?l.p(e,o):(l=$[a]=A[a](e),l.c()),we(l,1),l.m(t,c)):l=null),(!y||1536&o[0]&&u!==(u=S(e[9]||e[10])+" svelte-1wtpa4f"))&&U(d,"class",u),(!y||32&o[0])&&U(d,"id",e[5]),(!y||32&o[0])&&U(d,"name",e[5]),(!y||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[16]||e[17]?T?(T.p(e,o),196616&o[0]&&we(T,1)):(T=Bn(e),T.c(),we(T,1),T.m(t,null)):T&&(pe(),ye(T,1,1,()=>{T=null}),ge());const f={};93126097&o[0]|2048&o[2]&&(f.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,f.open=e[19],le(()=>p=!1)),m.$set(f),e[20]?M?(M.p(e,o),1048576&o[0]&&we(M,1)):(M=Hn(e),M.c(),we(M,1),M.m(w.parentNode,w)):M&&(pe(),ye(M,1,1,()=>{M=null}),ge())},i(e){y||(we(n.$$.fragment,e),we(l),we(T),we(m.$$.fragment,e),we(M),y=!0)},o(e){ye(n.$$.fragment,e),ye(l),ye(T),ye(m.$$.fragment,e),ye(M),y=!1},d(e){e&&D(t),be(n),~a&&$[a].d(),T&&T.d(),e&&D(f),be(m,e),e&&D(g),M&&M.d(e),e&&D(w),v=!1,I()}}}(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,t){e[72]&&r.p(e,t)},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Mn(e){let t,n,r,i,o;return n=new it({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[43]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Pn(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=[L(t,"click",e[37](!0)),L(t,"choose",e[40])],i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,E(o)}}}function Bn(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 pointer svelte-1wtpa4f")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[42]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ln(e){let t,n,r,i;const o=[Vn,Fn],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=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function Fn(e){let t,n;return t=new mn({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[33],query:e[35](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[24],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[26],inputSearch:e[39]()}}),t.$on("choose",e[40]),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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]),16777216&n[0]&&(r.filterForReady=e[24]),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]),67108864&n[0]&&(r.shouldBlock=e[26]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Vn(e){let t,n;return t=new Dn({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8]}}),t.$on("choose",e[40]),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Un(e){let t,n,r=e[19]&&Ln(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&we(r,1)):(r=Ln(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Hn(e){let t,n,r;function i(t){e[58](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[zn]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[28]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|2048&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function Wn(e){let t,n;return t=new Am({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[41]),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zn(e){let t,n;return t=new e[27]({props:{title:e[21],$$slots:{default:[Wn]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|2048&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function jn(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Gn(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:jn,then:kn,catch:On,value:72,blocks:[,,,]};return ve(e[36](),r),{c(){t=B(),r.block.c()},m(e,i){R(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ie(r,e=t,n)},i(e){n||(we(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ye(r.blocks[e])}n=!1},d(e){e&&D(t),r.block.d(e),r.token=null,r=null}}}function qn(e,n,r){let o,s,a,l;b(e,i,e=>r(54,o=e));const d=K(),{Dialog:h,Modal:f}=c,{currentTasks:m,environment:p,loggedIn:g}=u;b(e,m,e=>r(60,s=e)),b(e,p,e=>r(62,l=e)),b(e,g,e=>r(61,a=e));let{id:y}=n,{item:v}=n,{fullRecord:I}=n,{value:_=""}=n,{multiValues:C}=n,{desc:E=""}=n,{noForm:A=!1}=n,{classId:$}=n,{eventId:S}=n,{recordId:T}=n,{withRefValue:N=!1}=n,{refValue:R=""}=n,{shortEdit:D}=n,{required:x}=n,{disabled:O}=n,{readonly:k}=n,{praefix:M}=n,{selectionFields:P}=n,{formnovalidate:B}=n,{selection:L}=n,{deList:F}=n,{isTemplate:V}=n,{noList:U=!1}=n,{multi:H=!1}=n,{initFinished:W}=n;const z="comment_"+y,j=v.filter;let G,q,X,Y,Z,Q,J=!1,ee=!0,te=!0,ne=!0,re=!1,ie="";k||=T&&v.asInput,O||=k,!L&&v.selection&&1===v.selection.split(":").length&&(L=v.selection);const oe=k||O||v.lookup||L&&!v.constraint?"":"Suchbegriff ⏎",se=()=>{v.refItem&&v.refItem.startsWith("owner")&&(r(46,R=l.owner[v.refClass]),R||r(46,R=((e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}})(v.refItem,l)),R&&(r(45,N=!0),d("change",{value:R})))},ae=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{d("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},le=async e=>{const n=()=>{r(19,J=!0)};if(9==e.which)return;if(_)return e.preventDefault();if(13!=e.which)return;e.preventDefault();const i=X.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:h=!1,end:f=!1}=d;if(o.length<u)return n();const m=(h?"^":"")+o+(f?"$":"");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(X.class,p);1!==g?.length?n():r(0,_=g[0]._id)},ce=e=>{e&&(r(53,ie=r(1,E=w(X,e))),d("setRefDesc",E.split(" •")[0]),d("change",{value:_,description:E}),d("task",{row:e,eventId:X.id}))},de=()=>{r(19,J=!1),r(20,G=!1)};return e.$$set=e=>{"id"in e&&r(5,y=e.id),"item"in e&&r(6,v=e.item),"fullRecord"in e&&r(7,I=e.fullRecord),"value"in e&&r(0,_=e.value),"multiValues"in e&&r(8,C=e.multiValues),"desc"in e&&r(1,E=e.desc),"noForm"in e&&r(9,A=e.noForm),"classId"in e&&r(10,$=e.classId),"eventId"in e&&r(11,S=e.eventId),"recordId"in e&&r(12,T=e.recordId),"withRefValue"in e&&r(45,N=e.withRefValue),"refValue"in e&&r(46,R=e.refValue),"shortEdit"in e&&r(49,D=e.shortEdit),"required"in e&&r(2,x=e.required),"disabled"in e&&r(3,O=e.disabled),"readonly"in e&&r(48,k=e.readonly),"praefix"in e&&r(13,M=e.praefix),"selectionFields"in e&&r(14,P=e.selectionFields),"formnovalidate"in e&&r(50,B=e.formnovalidate),"selection"in e&&r(4,L=e.selection),"deList"in e&&r(15,F=e.deList),"isTemplate"in e&&r(16,V=e.isTemplate),"noList"in e&&r(51,U=e.noList),"multi"in e&&r(17,H=e.multi),"initFinished"in e&&r(47,W=e.initFinished)},e.$$.update=()=>{if(4&e.$$.dirty[0]|524288&e.$$.dirty[1]&&r(2,x=x&&!B),49152&e.$$.dirty[1]&&N&&r(0,_=R),3&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&!E&&_&&ie&&r(1,E=ie),399425&e.$$.dirty[0]|1114112&e.$$.dirty[1]&&_&&X){let e=!1;if(!Array.isArray(_)){const t=v.properties?.prefetch?500:0;if(T||v.asInput||v.upate||!1!==v.refItem||!0===H||!1===v.refItem&&W)if(t){const t="p$"+v.refClass+"$"+S,n=pm(t);n?n.then(e=>{const t=e.find(({_id:e})=>e===_);t?ce(t):wm(v.refClass,X.id,_,!!v.lookup||U).then(ce)}):e=!0}else e=!0;e&&wm(v.refClass,X.id,_,!!v.lookup||U).then(ce),r(47,W=!0)}}if(65&e.$$.dirty[0]|10485760&e.$$.dirty[1]&&_&&Y&&v.name===Y.input?.at(0)&&Y.inputLookup?.length){const{domain:e}=Y.inputLookup[0]||{};"user"===e&&(o.some(e=>Y.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,O=!0))}262145&e.$$.dirty[0]&&!_&&X&&ce({})},[_,E,x,O,L,y,v,I,C,A,$,S,T,M,P,F,V,H,X,J,G,q,Z,ee,te,ne,re,h,f,m,p,g,z,j,oe,()=>{if(!v.query)return;const[e,t]=v.query.split(".");if(!I[t])return;let n=[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:I[t]}}];return v.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":v.refStatus}}])),n},async()=>{try{const e=await t.getEvent(S);if(Q="report"===e.output.type,r(24,te=!v.asInput),r(23,ee=e.output?.class[0].name!==v.refClass),r(18,X=await t.getSchemaByClass(v.refClass)),X?.blocked)return d("initFail",!0),!1;if(Q||r(26,re=((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===v.name);if(t?.properties?.blocking)return n.name}return!1})(e,X)),ae(X),r(22,Z=(e=>!s?.length||!!s.find(t=>t===e))(X.id)),r(52,Y=await t.getSchema(S)),S&&T&&_&&!O&&Y.input?.find(e=>e===v.refClass)&&r(3,O=!0),e.input?.class&&e.input.class[0]&&(e.input.class[0].name===v.refClass&&e.input.class[0].readonly&&r(3,O=!0),T&&e.input.class[0].name===v.refClass&&e.input.class[0].writeState)){(await t.getTaskByDocId(T,!0)).status===e.input.class[0].writeState&&r(3,O=r(48,k=!1))}if(v.properties?.query?.lookup){const{domain:e,value:n}=v.properties.query.lookup;if("user"===e){const e=a.user,i={[n]:e},s=await t.getSectionView(v.refClass,i);if(s?.length){const[{_id:e}]=s;e&&(r(46,R=e),r(45,N=!0),d("change",{value:R}))}o.some(e=>X.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,O=!0)}}else se();if(!R&&v.filter&&(""===M||void 0===M)){const e=v.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly(v.refClass,{[v.filter]:n});i&&(r(46,R=i._id),r(45,N=!0),d("change",{value:R}))}return r(21,q=X.identity.designation),!0}catch{return d("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!0===e&&r(19,J=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(v.lookup||L&&!v.constraint||_)&&r(19,J=!0)},le,()=>{if(_)return"";const e=document.getElementById(z);return r(1,E=""),e?.value||""},({detail:e})=>{r(0,_=e.row._id),de()},de,()=>{(Q||Z)&&(H?d("change",{value:_,delete:!0}):(r(0,_=""),r(1,E=""),r(25,ne=!0),d("change",{value:_,description:E}),d("task",{row:{_task:{event:X.id,_id:!1}}})))},async()=>{if(!_)return;let e=await wm(v.refClass,X.id,_);e._task||(e={_task:await t.getTaskByDocId(_,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{_||E&&le({which:13,preventDefault:()=>{},srcElement:{value:E}})},N,R,W,k,D,B,U,Y,ie,o,function(e){E=e,r(1,E),r(0,_),r(53,ie),r(45,N),r(46,R)},function(e){ne=e,r(25,ne)},function(e){J=e,r(19,J)},function(e){G=e,r(20,G)}]}class Xn extends Te{constructor(e){var t;super(),xn.getElementById("svelte-1wtpa4f-style")||((t=O("style")).id="svelte-1wtpa4f-style",t.textContent=".feather.svelte-1wtpa4f{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-1wtpa4f{z-index:10000 !important;position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",N(xn.head,t)),Se(this,e,qn,Gn,$,{id:5,item:6,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:45,refValue:46,shortEdit:49,required:2,disabled:3,readonly:48,praefix:13,selectionFields:14,formnovalidate:50,selection:4,deList:15,isTemplate:16,noList:51,multi:17,initFinished:47},[-1,-1,-1])}}function Yn(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function Zn(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Kn(e){let t,n;return t=new e[16]({props:{outline:!0,$$slots:{default:[er]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};8191&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Qn(e){let t,n,r,i,o;return n=new ft({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",function(){A(e[22](e[0]))&&e[22](e[0]).apply(this,arguments)}),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Jn(e){let t,n;return t=new Xn({props:{classId:e[6],eventId:e[7],required:e[9],disabled:e[1],formnovalidate:e[12],readonly:e[10],id:e[2]+"."+e[42],item:e[3],desc:e[4],value:e[40],noForm:e[5],praefix:e[11],recordId:e[8],multi:!0}}),t.$on("change",e[24]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.classId=e[6]),128&n[0]&&(r.eventId=e[7]),512&n[0]&&(r.required=e[9]),2&n[0]&&(r.disabled=e[1]),4096&n[0]&&(r.formnovalidate=e[12]),1024&n[0]&&(r.readonly=e[10]),4&n[0]&&(r.id=e[2]+"."+e[42]),8&n[0]&&(r.item=e[3]),16&n[0]&&(r.desc=e[4]),1&n[0]&&(r.value=e[40]),32&n[0]&&(r.noForm=e[5]),2048&n[0]&&(r.praefix=e[11]),256&n[0]&&(r.recordId=e[8]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function er(e){let t,n,r,i=!e[10]&&Qn(e),o=[].concat(e[0]),s=[];for(let t=0;t<o.length;t+=1)s[t]=Jn(Yn(e,o,t));const a=e=>ye(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=P();for(let e=0;e<s.length;e+=1)s[e].c();n=B()},m(e,o){i&&i.m(e,o),R(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);R(e,n,o),r=!0},p(e,r){if(e[10]?i&&(pe(),ye(i,1,1,()=>{i=null}),ge()):i?(i.p(e,r),1024&r[0]&&we(i,1)):(i=Qn(e),i.c(),we(i,1),i.m(t.parentNode,t)),16785407&r[0]){let t;for(o=[].concat(e[0]),t=0;t<o.length;t+=1){const i=Yn(e,o,t);s[t]?(s[t].p(i,r),we(s[t],1)):(s[t]=Jn(i),s[t].c(),we(s[t],1),s[t].m(n.parentNode,n))}for(pe(),t=o.length;t<s.length;t+=1)a(t);ge()}},i(e){if(!r){we(i);for(let e=0;e<o.length;e+=1)we(s[e]);r=!0}},o(e){ye(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)ye(s[e]);r=!1},d(e){i&&i.d(e),e&&D(t),x(s,e),e&&D(n)}}}function tr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function nr(e){let t,n;return t=new e[18]({props:{title:e[14].designation,class:"eList",$$slots:{default:[ir]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),49480&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ir(e){let t,n,r,i,o;return n=new e[19]({props:{outline:!0,$$slots:{default:[rr]},$$scope:{ctx:e}}}),n.$on("click",e[25]),i=new Zt({props:{item:e[3],className:e[14].class,classId:e[6],rowId:e[15],recordId:e[8],inputList:e[21]()}}),i.$on("choose",e[23]),i.$on("back",e[25]),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),Ae(i.$$.fragment),U(t,"class","form--buttons")},m(e,s){R(e,t,s),$e(n,t,null),R(e,r,s),$e(i,e,s),o=!0},p(e,t){const r={};4096&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const o={};8&t[0]&&(o.item=e[3]),16384&t[0]&&(o.className=e[14].class),64&t[0]&&(o.classId=e[6]),32768&t[0]&&(o.rowId=e[15]),256&t[0]&&(o.recordId=e[8]),i.$set(o)},i(e){o||(we(n.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(n.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){e&&D(t),be(n),e&&D(r),be(i,e)}}}function or(e){let t,n,r=e[13]&&nr(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&we(r,1)):(r=nr(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function sr(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:tr,then:Kn,catch:Zn,value:39,blocks:[,,,]};function s(t){e[34](t)}ve(e[20](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[or]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[17]({props:a}),ee.push(()=>Ee(n,"open",s)),{c(){o.block.c(),t=P(),Ae(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,R(e,t,r),$e(n,e,r),i=!0},p(t,i){Ie(o,e=t,i);const s={};57672&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],le(()=>r=!1)),n.$set(s)},i(e){i||(we(o.block),we(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){ye(o.blocks[e])}ye(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&D(t),be(n,e)}}}function ar(e,n,r){const i=K(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,{id:h}=n,{item:f}=n,{record:m}=n,{values:p=[]}=n,{desc:g=""}=n,{noForm:w=!1}=n,{classId:y}=n,{eventId:v}=n,{recordId:I}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:$}=n,{praefix:b}=n,{selectionFields:S}=n,{formnovalidate:T}=n,{selection:N}=n,{deList:R}=n,{isTemplate:D}=n,{noList:x=!1}=n,O=!1;const{lookup:k,filter:M,constraint:P}=f.properties.multi;A=!0;const B=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(2,h=e.id),"item"in e&&r(3,f=e.item),"record"in e&&r(26,m=e.record),"values"in e&&r(0,p=e.values),"desc"in e&&r(4,g=e.desc),"noForm"in e&&r(5,w=e.noForm),"classId"in e&&r(6,y=e.classId),"eventId"in e&&r(7,v=e.eventId),"recordId"in e&&r(8,I=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(9,E=e.required),"disabled"in e&&r(1,A=e.disabled),"readonly"in e&&r(10,$=e.readonly),"praefix"in e&&r(11,b=e.praefix),"selectionFields"in e&&r(29,S=e.selectionFields),"formnovalidate"in e&&r(12,T=e.formnovalidate),"selection"in e&&r(30,N=e.selection),"deList"in e&&r(31,R=e.deList),"isTemplate"in e&&r(32,D=e.isTemplate),"noList"in e&&r(33,x=e.noList)},[p,A,h,f,g,w,y,v,I,E,$,b,T,O,d,u,o,s,a,l,async()=>{r(0,p=[].concat(p)),r(14,d=await t.getSchemaByClass(f.refClass))},async()=>{let e,n;if(k?(n=[{$match:{[k]:m[k]}}],e=await t.getSectionView(d.class,n)):e=await gm(d.class,d.id),!e?.length)return[];if(P&&e?.length){const{refClass:r,refStatus:i}=P;n=[{$match:{[d.class]:{$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 o=await t.getSectionView(r,n);e=e.filter(e=>!!o.find(t=>t.project==e._id))}if(M)for(const t in M)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},e=>()=>{$||(e=[].concat(e),r(13,O=!0),r(15,u=e))},({detail:e})=>{const t=e.row._id;r(0,p=[].concat(p)),Array.isArray(p)&&!p.find(e=>e===t)&&r(0,p=p.concat(e.row._id)),B()},({detail:e})=>{r(0,p=[].concat(p)),e.delete&&r(0,p=p.filter(t=>t!==e.value)),e.value=p,i("change",e),i("multi",{lookup:k,filter:M,name:f.name,value:p})},B,m,_,C,S,N,R,D,x,function(e){O=e,r(13,O)}]}class lr extends Te{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}",N(document.head,t)),Se(this,e,ar,sr,$,{id:2,item:3,record:26,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:27,refValue:28,required:9,disabled:1,readonly:10,praefix:11,selectionFields:29,formnovalidate:12,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const cr=/\d+/g,dr=/%[HMSpPdmyY%]/g;function ur(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(dr);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{cr.lastIndex=s;const o=cr.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 hr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:fr}=_e;function mr(e,t,n){const r=e.slice();return r[17]=t[n],r}function pr(e,t,n){const r=e.slice();return r[20]=t[n],r}function gr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function wr(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=vr(pr(e,m,t));const g=e=>ye(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&Ir(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[Cr]},$$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:[Er]},$$scope:{ctx:e}}}),{c(){t=O("form"),n=O("input"),i=P();for(let e=0;e<p.length;e+=1)p[e].c();o=P(),w&&w.c(),s=P(),a=O("div"),Ae(l.$$.fragment),c=P(),Ae(d.$$.fragment),U(n,"class",S(e[6])+" svelte-1phofh5"),U(n,"name","_id"),U(n,"type","hidden"),n.value=r=e[1]._id||"",U(t,"class","fTask svelte-1phofh5"),U(t,"id",e[6]),U(a,"class","form--buttons svelte-1phofh5")},m(r,m){R(r,t,m),N(t,n),N(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);N(t,o),w&&w.m(t,null),R(r,s,m),R(r,a,m),$e(l,a,null),N(a,c),$e(d,a,null),u=!0,h||(f=[L(t,"keydown",e[8]),L(t,"submit",F(e[10]))],h=!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=pr(e,m,n);p[n]?(p[n].p(r,i),we(p[n],1)):(p[n]=vr(r),p[n].c(),we(p[n],1),p[n].m(t,o))}for(pe(),n=m.length;n<p.length;n+=1)g(n);ge()}e[0].list?w?(w.p(e,i),1&i&&we(w,1)):(w=Ir(e),w.c(),we(w,1),w.m(t,null)):w&&(pe(),ye(w,1,1,()=>{w=null}),ge());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)we(p[e]);we(w),we(l.$$.fragment,e),we(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)ye(p[e]);ye(w),ye(l.$$.fragment,e),ye(d.$$.fragment,e),u=!1},d(e){e&&D(t),x(p,e),w&&w.d(),e&&D(s),e&&D(a),be(l),be(d),h=!1,E(f)}}}function yr(e){let t,n;return t=new Hd({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function vr(e){let t,n,r=br(!0,e[20]),i=r&&yr(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){1&n&&(r=br(!0,e[20])),r?i?(i.p(e,n),1&n&&we(i,1)):(i=yr(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Ir(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=_r(mr(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=mr(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=_r(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}function _r(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Lr({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(){Ae(t.$$.fragment),n=P(),Ae(r.$$.fragment)},m(e,o){$e(t,e,o),R(e,n,o),$e(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||(we(t.$$.fragment,e),we(r.$$.fragment,e),i=!0)},o(e){ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!1},d(e){be(t,e),e&&D(n),be(r,e)}}}function Cr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Er(e){let t;return{c(){t=M("Speichern")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Ar(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function $r(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Ar,then:wr,catch:gr,value:16,blocks:[,,,]};return ve(e[7](),i),{c(){t=P(),n=O("section"),i.block.c(),fr.title="Vorgaben",U(n,"class","sTask svelte-1phofh5")},m(e,o){R(e,t,o),R(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ie(i,e=t,n)},i(e){r||(we(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}r=!1},d(e){e&&D(t),e&&D(n),i.block.d(),i.token=null,i=null}}}const br=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Sr(e,r,o){let l,d,u;b(e,a,e=>o(11,d=e)),b(e,i,e=>o(12,u=e));const{Divider:h,Button:f,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 ur(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&&o(0,g=e.schema),"record"in e&&o(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&o(3,l=v)},[g,w,v,l,h,f,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&o(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));o(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),s.success("Die Vorgaben wurden gespeichert.",2e3),I()}]}const{document:Tr}=_e;function Nr(e,t,n){const r=e.slice();return r[28]=t[n],r}function Rr(e){let t,n;return t=new Hd({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),2&n[0]&&(r.item=e[28]),2&n[0]&&(r.listName=e[1].name),8&n[0]&&(r.eventId=e[3]),1&n[0]&&(r.record=e[0]),16&n[0]&&(r.disabled=e[4]),32&n[0]&&(r.required=e[5]),256&n[0]&&(r.currency=e[8]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Dr(e){let t,n,r=br(e[7],e[28]),i=r&&Rr(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(e,t,r),n=!0},p(e,n){130&n[0]&&(r=br(e[7],e[28])),r?i?(i.p(e,n),130&n[0]&&we(i,1)):(i=Rr(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function xr(e){let t,n,r,i=e[1].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Dr(Nr(e,i,t));const s=e=>ye(o[e],1,1,()=>{o[e]=null});return{c(){t=O("div");for(let e=0;e<o.length;e+=1)o[e].c();U(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){R(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(82367&a[0]){let n;for(i=e[1].item,n=0;n<i.length;n+=1){const r=Nr(e,i,n);o[n]?(o[n].p(r,a),we(o[n],1)):(o[n]=Dr(r),o[n].c(),we(o[n],1),o[n].m(t,null))}for(pe(),n=i.length;n<o.length;n+=1)s(n);ge()}(!r||6&a[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&U(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)we(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ye(o[e]);r=!1},d(e){e&&D(t),x(o,e)}}}function Or(e){let t,n,r=e[13](e[9])+"";return{c(){t=O("span"),n=M(r)},m(e,r){R(e,t,r),N(t,n)},p(e,t){512&t[0]&&r!==(r=e[13](e[9])+"")&&H(n,r)},d(e){e&&D(t)}}}function kr(e){let t,n,r;return n=new e[10]({props:{$$slots:{default:[Or]},$$scope:{ctx:e}}}),n.$on("click",function(){A(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)}),{c(){t=O("div"),Ae(n.$$.fragment),U(t,"class","accordion svelte-148ktt9"),U(t,"slot","handle")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p(t,r){e=t;const i={};512&r[0]|1&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Mr(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[kr,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[xr,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.open=e[6]),134218687&n[0]|1&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Pr(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[Mr]},$$scope:{ctx:e}}}),{c(){t=O("div"),Ae(n.$$.fragment),U(t,"class","formList")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p(e,t){const r={};1023&t[0]|1&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Br(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:h}=n,{disabled:f}=n,{required:w}=n,{open:y=!1}=n,{template:v={}}=n,{isTemplate:I=!1}=n,{currency:_}=n,{update:C=!1}=n,E=new Map;const A={};let $=d[a.name]||{};d[a.name]=$;const b=e=>A[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&r(1,a=e.list),"schema"in e&&r(18,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(2,u=e.classId),"eventId"in e&&r(3,h=e.eventId),"disabled"in e&&r(4,f=e.disabled),"required"in e&&r(5,w=e.required),"open"in e&&r(6,y=e.open),"template"in e&&r(19,v=e.template),"isTemplate"in e&&r(7,I=e.isTemplate),"currency"in e&&r(8,_=e.currency),"update"in e&&r(20,C=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&C&&d&&r(9,$=d[a.name]||{})},[d,a,u,h,f,w,y,I,_,$,i,o,s,e=>l.filter(t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format).map(t=>"object"===t.type?b(t.name):"boolean"===t.type?g(e[t.name]):"date"===t.type?m(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name]).filter(e=>!!e).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(A[n]=e.desc);const i=d[t];r(0,d[t]={...i,[n]:e.value},d),r(9,$=d[t])},e=>t=>{(()=>{const e=v[a.name]||{};for(const t in e)v[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=v[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`,i=document.querySelector(n);se().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)}).then(()=>i.scrollIntoView({behavior:"smooth",block:"end"}))},async({detail:{className:e,itemName:n,value:r}})=>{if(E.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&&E.set(e,o[0])},()=>{setTimeout(()=>{Array.from(E).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},l,v,C,function(t){Q(e,t)}]}class Lr extends Te{constructor(e){var t;super(),Tr.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}}",N(Tr.head,t)),Se(this,e,Br,Pr,$,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:Fr}=_e;function Vr(e){e[0]=e[23].list,e[22]=e[23].items}function Ur(e,t,n){const r=e.slice();return r[24]=t[n],r}function Hr(e,t,n){const r=e.slice();return r[27]=t[n],r}function Wr(e,t,n){const r=e.slice();return r[27]=t[n],r}function zr(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function jr(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[19](t)}Vr(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Gr]},$$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}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=qr(Wr(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(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=Wr(e,r,o);i[o]?i[o].p(s,t):(i[o]=qr(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&&D(t),x(i,e)}}}(e),C=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=Zr(Ur(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);R(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=Ur(e,n,o);r[o]?r[o].p(s,i):(r[o]=Zr(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){x(r,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){Vr(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],le(()=>a=!1)),s.$set(i),e[22]?.length&&_.p(e,t),e[0]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function Gr(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function qr(e){let t,n,r=e[27]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Xr(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Yr(Hr(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=P(),U(t,"class","pointer svelte-14hcfjl")},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);N(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Hr(e,r,s);i[s]?i[s].p(a,o):(i[s]=Yr(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&&D(t),x(i,e)}}}function Yr(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function Zr(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Xr(e);return{c(){r&&r.c(),t=B()},m(e,n){r&&r.m(e,n),R(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=Xr(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&D(t)}}}function Kr(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Qr(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Kr,then:jr,catch:zr,value:23,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Jr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Qr]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ei(e,n,r){const i=K(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:h}=n,{classId:f}=n,{list:p}=n,w="",y=f+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},I=t.getSchemaByClass(h);Y(()=>{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,h=e.className),"classId"in e&&r(17,f=e.classId),"list"in e&&r(0,p=e.list)},[p,w,i,o,s,a,l,d,y,v,e=>()=>i("choose",{row:e}),async()=>{const e=await I,t=e.display;let n=await Xt(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,w=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,w="")},u,h,f,()=>i("back"),function(e){w=e,r(1,w)}]}class ti extends Te{constructor(e){var t;super(),Fr.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}",N(Fr.head,t)),Se(this,e,ei,Jr,$,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ni}=_e;function ri(e,t,n){const r=e.slice();return r[11]=t[n],r}function ii(e,t,n){const r=e.slice();return r[3]=t[n],r}function oi(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function si(e){let t,n,r,i=e[7].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=ui(ii(e,i,t));const s=e=>ye(o[e],1,1,()=>{o[e]=null});let a=e[7].list&&hi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=P(),a&&a.c(),n=B()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);R(e,t,i),a&&a.m(e,i),R(e,n,i),r=!0},p(e,r){if(30327783&r[0]){let n;for(i=e[7].items,n=0;n<i.length;n+=1){const s=ii(e,i,n);o[n]?(o[n].p(s,r),we(o[n],1)):(o[n]=ui(s),o[n].c(),we(o[n],1),o[n].m(t.parentNode,t))}for(pe(),n=i.length;n<o.length;n+=1)s(n);ge()}e[7].list?a?(a.p(e,r),128&r[0]&&we(a,1)):(a=hi(e),a.c(),we(a,1),a.m(n.parentNode,n)):a&&(pe(),ye(a,1,1,()=>{a=null}),ge())},i(e){if(!r){for(let e=0;e<i.length;e+=1)we(o[e]);we(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ye(o[e]);ye(a),r=!1},d(e){x(o,e),e&&D(t),a&&a.d(e),e&&D(n)}}}function ai(e){let t,n,r,i;const o=[ci,li],s=[];function a(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=B()},m(e,n){~t&&s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){~t&&s[t].d(e),e&&D(r)}}}function li(e){let t,n;return t=new Hd({props:{classId:e[8],item:e[3],record:e[6],disabled:e[3].name===e[14]&&e[15]||e[0],eventId:e[5],currency:e[2],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.item=e[3]),64&n[0]&&(r.record=e[6]),129&n[0]&&(r.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(r.eventId=e[5]),4&n[0]&&(r.currency=e[2]),512&n[0]&&(r.changeValue=e[9]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ci(e){let t,n,r,i;n=new Hd({props:{classId:e[8],item:e[3],record:e[6],disabled:e[0]||!!e[1],required:!0,eventId:e[5],currency:e[2],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]),n.$on("record",e[23]),n.$on("objRecord",e[24]);let o=e[1]&&di(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"padding-top",".25em"),z(t,"background-color","lightyellow"),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};256&r[0]&&(i.classId=e[8]),128&r[0]&&(i.item=e[3]),64&r[0]&&(i.record=e[6]),3&r[0]&&(i.disabled=e[0]||!!e[1]),32&r[0]&&(i.eventId=e[5]),4&r[0]&&(i.currency=e[2]),512&r[0]&&(i.changeValue=e[9]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&we(o,1)):(o=di(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function di(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[22]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function ui(e){let t,n,r="list"!==e[3].type&&ai(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){"list"!==e[3].type?r?(r.p(e,n),128&n[0]&&we(r,1)):(r=ai(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function hi(e){let t,n,r=e[7].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=mi(ri(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(e,t,r),n=!0},p(e,n){if(485&n[0]){let s;for(r=e[7].list,s=0;s<r.length;s+=1){const o=ri(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=mi(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}function fi(e){let t,n,r,i;return t=new e[12]({props:{text:e[11].designation}}),r=new Lr({props:{classId:e[8],list:e[11],eventId:e[5],schema:e[11].item,record:e[6],disabled:e[0],currency:e[2],update:!0}}),{c(){Ae(t.$$.fragment),n=P(),Ae(r.$$.fragment)},m(e,o){$e(t,e,o),R(e,n,o),$e(r,e,o),i=!0},p(e,n){const i={};128&n[0]&&(i.text=e[11].designation),t.$set(i);const o={};256&n[0]&&(o.classId=e[8]),128&n[0]&&(o.list=e[11]),32&n[0]&&(o.eventId=e[5]),128&n[0]&&(o.schema=e[11].item),64&n[0]&&(o.record=e[6]),1&n[0]&&(o.disabled=e[0]),4&n[0]&&(o.currency=e[2]),r.$set(o)},i(e){i||(we(t.$$.fragment,e),we(r.$$.fragment,e),i=!0)},o(e){ye(t.$$.fragment,e),ye(r.$$.fragment,e),i=!1},d(e){be(t,e),e&&D(n),be(r,e)}}}function mi(e){let t,n,r="array"!==e[11].type&&fi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){"array"!==e[11].type?r?(r.p(e,n),128&n[0]&&we(r,1)):(r=fi(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function pi(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function gi(e){let t,n;return t=new ti({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.item=e[3]),16&n[0]&&(r.className=e[4]),256&n[0]&&(r.classId=e[8]),2048&n[0]&&(r.list=e[11]),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function wi(e){let t,n,r=e[10]&&gi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[10]?r?(r.p(e,n),1024&n[0]&&we(r,1)):(r=gi(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function yi(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:pi,then:si,catch:oi,value:54,blocks:[,,,]};function l(t){e[30](t)}ve(e[16](),a),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[wi]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),i=new e[13]({props:c}),ee.push(()=>Ee(i,"open",l)),{c(){a.block.c(),t=P(),Ae(n.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,R(e,t,o),$e(n,e,o),R(e,r,o),$e(i,e,o),s=!0},p(t,n){Ie(a,e=t,n);const r={};3352&n[0]|268435456&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&1024&n[0]&&(o=!0,r.open=e[10],le(()=>o=!1)),i.$set(r)},i(e){s||(we(a.block),we(n.$$.fragment,e),we(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){ye(a.blocks[e])}ye(n.$$.fragment,e),ye(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&D(t),be(n,e),e&&D(r),be(i,e)}}}function vi(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=K();let l,d,u,h,f,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:I}=n,{currency:_}=n,C={},E=[],A=[],$={},b=new Map,S=!1,T="";const N=y.checkOn,R=v,D=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?"!":""})})},x=()=>{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(9,$={});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 Im(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(9,$[t]="",$))}}};Y(()=>{k()});const k=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))})(),M())},M=()=>{setTimeout(()=>{Array.from(b).forEach(([e,t])=>{C[e]||r(6,C[e]=t._id,C)})},250)},P=async e=>{if(!e.value)return void L();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(11,T=i),r(10,S=!0)):(r(1,v=""),r(25,I=""),a("setRefValue",I))},B=()=>{r(10,S=!1)},L=()=>{r(1,v=""),r(25,I=v),r(6,C={}),a("setRefValue",I)};return e.$$set=e=>{"required"in e&&r(26,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(27,g=e.readonly),"id"in e&&r(28,w=e.id),"item"in e&&r(3,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(25,I=e.refValue),"currency"in e&&r(2,_=e.currency)},e.$$.update=()=>{134217729&e.$$.dirty[0]&&r(0,p=p||g),536871024&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:h,taskId:f})},[p,v,_,y,u,h,C,l,d,$,S,T,i,s,N,R,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(6,C=e),r(29,f=(await t.getTaskByDocId(e._id,!0))._id)}else r(6,C={})}catch{}return r(7,l=await t.getSchemaByClass(y.refClass)),r(8,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(4,u=l.class),l.identity.designation,r(5,h=l.id),["readonly","hidden","required"].map(D),x(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(6,C[t]=n,C),t===N)return P(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(6,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(6,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(b.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&&b.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(25,I=v),a("setRefValue",I),r(6,C=n[0])),B()},B,L,({detail:e})=>{r(6,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(6,C[e.listName][t.name]=t.value,C)},I,m,g,w,f,function(e){S=e,r(10,S)}]}class Ii extends Te{constructor(e){var t;super(),ni.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}",N(ni.head,t)),Se(this,e,vi,yi,$,{required:26,disabled:0,readonly:27,id:28,item:3,value:1,refValue:25,currency:2},[-1,-1])}}function _i(e){let t,n;return{c(){t=O("span"),n=M(e[4]),U(t,"class","item")},m(e,r){R(e,t,r),N(t,n)},p(e,t){16&t[0]&&H(n,e[4])},d(e){e&&D(t)}}}function Ci(e){let t,n,r,i=e[6]&&_i(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","pointer feather svelte-1fuww0c")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[17]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=P(),o&&o.c(),n=B()},m(e,s){i&&i.m(e,s),R(e,t,s),o&&o.m(e,s),R(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=_i(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||(we(o),r=!0)},o(e){ye(o),r=!1},d(e){i&&i.d(e),e&&D(t),o&&o.d(e),e&&D(n)}}}function Ei(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:[Ci]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=O("div"),Ae(n.$$.fragment),z(t,"position","relative"),z(t,"max-width","10em")},m(e,i){R(e,t,i),$e(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]|32&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Ai(e,t,r){const i=K(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:h}=t,{formnovalidate:f}=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:C,step:E,pattern:A,decimals:$=0,unit:b="",placeholder:S,hint:T,readonly:N,negative:R,required:D=!1,transfer:x}=I,O="";l=l?Number(l.toString().replace(",",".")):0,N=!0===N||void 0;const k=e=>Number(e.toString()).toFixed($).toString().replace(".",v);A||(A=$?`[0-9]+([${v}][0-9]{1,${$}})?`:"[0-9]*"),R&&(A="-?"+A);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,h=e.disabled),"formnovalidate"in e&&r(20,f=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&&!f),262144&e.$$.dirty[0]&&(e=>{r(9,O=k((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,h,m,D,y,A,N,O,o,w,E,S,x,({detail:e})=>i("blur",{value:k(e.value)}),({detail:e})=>{N||+l||r(9,O="")},({detail:e})=>{const t=[].concat(x.target);for(const e of t)i("record",{itemName:e,value:l}),i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,f,p,g]}class $i extends Te{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}",N(document.head,t)),Se(this,e,Ai,Ei,$,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:bi}=_e;function Si(e){e[34]=e[36].list,e[35]=e[36].items}function Ti(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function Ni(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function Ri(e,t,n){const r=e.slice();return r[40]=t[n],r}function Di(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function xi(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y,v;Si(e),n=new e[9]({props:{outline:!0,$$slots:{default:[Oi]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let I=!e[2]&&ki(e);function _(t){e[32](t)}let C={id:e[12]};void 0!==e[3]&&(C.value=e[3]),a=new e[7]({props:C}),ee.push(()=>Ee(a,"value",_)),a.$on("input",e[15]),u=new tt({props:{size:"18"}});let E=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&Pi(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=Bi(Ri(e,s,t));return{c(){t=O("thead"),n=O("tr"),o&&o.c(),r=P();for(let e=0;e<a.length;e+=1)a[e].c();U(n,"class","svelte-1m010ne"),U(t,"class","svelte-1m010ne")},m(e,s){R(e,t,s),N(t,n),o&&o.m(n,null),N(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&&(pe(),ye(o,1,1,()=>{o=null}),ge()):o?(o.p(e,t),4&t[0]&&we(o,1)):(o=Pi(e),o.c(),we(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=Ri(e,s,r);a[r]?a[r].p(i,t):(a[r]=Bi(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||(we(o),i=!0)},o(e){ye(o),i=!1},d(e){e&&D(t),o&&o.d(),x(a,e)}}}(e),A=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=Hi(Ti(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=B()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);R(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=Ti(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=Hi(o),i[s].c(),we(i[s],1),i[s].m(t.parentNode,t))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){x(i,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),I&&I.c(),i=P(),o=O("div"),s=M("Suchen: "),Ae(a.$$.fragment),c=P(),d=O("span"),Ae(u.$$.fragment),h=P(),f=O("div"),m=O("table"),E&&E.c(),p=P(),g=O("tbody"),A&&A.c(),U(t,"class","form--buttons svelte-1m010ne"),U(d,"class","feather pointer svelte-1m010ne"),z(o,"margin-bottom","1em"),z(o,"position","relative"),U(m,"striped",""),U(m,"class","svelte-1m010ne"),U(f,"class","eList svelte-1m010ne")},m(l,_){R(l,t,_),$e(n,t,null),N(t,r),I&&I.m(t,null),R(l,i,_),R(l,o,_),N(o,s),$e(a,o,null),N(o,c),N(o,d),$e(u,d,null),R(l,h,_),R(l,f,_),N(f,m),E&&E.m(m,null),N(m,p),N(m,g),A&&A.m(g,null),w=!0,y||(v=L(d,"click",e[17]),y=!0)},p(e,r){Si(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?I&&(pe(),ye(I,1,1,()=>{I=null}),ge()):I?(I.p(e,r),4&r[0]&&we(I,1)):(I=ki(e),I.c(),we(I,1),I.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],le(()=>l=!1)),a.$set(o),e[35]?.length&&E.p(e,r),e[34]?.length&&A.p(e,r)},i(e){w||(we(n.$$.fragment,e),we(I),we(a.$$.fragment,e),we(u.$$.fragment,e),we(E),we(A),w=!0)},o(e){ye(n.$$.fragment,e),ye(I),ye(a.$$.fragment,e),ye(u.$$.fragment,e),ye(E),ye(A),w=!1},d(e){e&&D(t),be(n),I&&I.d(),e&&D(i),e&&D(o),be(a),be(u),e&&D(h),e&&D(f),E&&E.d(),A&&A.d(),y=!1,v()}}}function Oi(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function ki(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[Mi]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Mi(e){let t;return{c(){t=M("Bestätigen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Pi(e){let t,n,r,i,o;return n=new Ge({props:{size:"20"}}),{c(){t=O("th"),Ae(n.$$.fragment),U(t,"class","svelte-1m010ne")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Bi(e){let t,n,r=e[40]+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-1m010ne")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Li(e){let t,n,r,i,o,s,a,l=e[0],c=Vi(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Ui(Ni(e,d,t));return{c(){t=O("tr"),c.c(),n=P();for(let e=0;e<u.length;e+=1)u[e].c();r=P(),U(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),U(t,"title","übernimmt den Wert direkt"),U(t,"class","svelte-1m010ne"),j(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){R(i,t,l),c.m(t,null),N(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);N(t,r),o=!0,s||(a=L(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&$(l,l=e[0])?(pe(),ye(c,1,1,I),ge(),c=Vi(e),c.c(),we(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=Ni(e,d,n);u[n]?u[n].p(i,a):(u[n]=Ui(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;"))&&U(t,"style",i),16385&a[0]&&j(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||(we(c),o=!0)},o(e){ye(c),o=!1},d(e){e&&D(t),c.d(e),x(u,e),s=!1,a()}}}function Fi(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"),Ae(n.$$.fragment),U(t,"title","Wählt den Wert aus"),U(t,"class","svelte-1m010ne")},m(e,i){R(e,t,i),$e(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||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function Vi(e){let t,n,r=!e[2]&&Fi(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,n){e[2]?r&&(pe(),ye(r,1,1,()=>{r=null}),ge()):r?(r.p(e,n),4&n[0]&&we(r,1)):(r=Fi(e),r.c(),we(r,1),r.m(t.parentNode,t))},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function Ui(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=M(r),U(t,"class","svelte-1m010ne")},m(e,r){R(e,t,r),N(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&&D(t)}}}function Hi(e){let t,n,r=e[16](e[37],e[3]),i=r&&Li(e);return{c(){i&&i.c(),t=B()},m(e,r){i&&i.m(e,r),R(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]&&we(i,1)):(i=Li(e),i.c(),we(i,1),i.m(t.parentNode,t)):i&&(pe(),ye(i,1,1,()=>{i=null}),ge())},i(e){n||(we(i),n=!0)},o(e){ye(i),n=!1},d(e){i&&i.d(e),e&&D(t)}}}function Wi(e){let t,n;return t=new e[6]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zi(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Wi,then:xi,catch:Di,value:36,blocks:[,,,]};return ve(e[14](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function ji(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[zi]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Gi(e,n,r){const i=K(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:h}=n,{id:f}=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:C}=n,{status:E}=n,{single:A}=n;p||=[];let $="",b=h+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const T=w+y+v+"checkbox",N=(e,t)=>e>t?1:t>e?-1:0;Y(()=>{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,h=e.classId),"id"in e&&r(23,f=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,C=e.uniqueView),"status"in e&&r(30,E=e.status),"single"in e&&r(2,A=e.single)},[p,m,A,$,S,i,o,s,a,l,d,u,b,T,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if(I){if(f){const n=h.split("-")[1].slice(0,-4),r="input."+h+"[name='_id']",o=document.querySelector(r).value;i={[y]:f},E&&(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 N(r(e),r(t))})}}else C?f&&(i={[y]:f,status:!0},Object.entries(C).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 N(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,f,_),e=e.sort((e,t)=>N(e,t))):(e=await t.getSection(w,y,f,!1,E),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))}));else i={},f&&!Array.isArray(f)&&(i._id=f),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,$=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,$="")},e=>()=>{const t=document.getElementsByName(T),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(T).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;A?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,h,f,g,w,y,I,_,C,E,()=>i("back"),function(e){$=e,r(3,$)}]}class qi extends Te{constructor(e){var t;super(),bi.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}",N(bi.head,t)),Se(this,e,Gi,ji,$,{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:Xi}=_e;function Yi(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=O("span"),n=M("("),r=M(s),i=M(")"),U(t,"class",o=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){R(e,t,o),N(t,n),N(t,r),N(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&U(t,"class",o)},d(e){e&&D(t)}}}function Zi(e){let t;return{c(){t=O("div"),U(t,"class","load-more-options"),U(t,"slot","load-more-options-message")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Ki(e){let t,n,r,i;const o=[eo,Ji,Qi],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=B()},m(e,n){~t&&s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){~t&&s[t].d(e),e&&D(r)}}}function Qi(e){let t,n,r,i,o;return n=new Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[26]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ji(e){let t,n,r,i,o;return n=new Ye({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title",e[17].title||"Generieren"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[25]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function eo(e){let t,n,r,i,o;return n=new tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Löschen"),U(t,"class","feather pointer svelte-1rbaejz")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[27]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function to(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[no]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(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],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function no(e){let t,n;return t=new qi({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ro(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&Yi(e);function u(t){e[35](t)}function h(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:io,minSearchLength:"3",$$slots:{"load-more-options-message":[Zi]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),r=new e[12]({props:f}),ee.push(()=>Ee(r,"selection",u)),ee.push(()=>Ee(r,"maxOptions",h)),r.$on("change",e[22]);let m=!e[1]&&Ki(e),p=e[10]&&to(e);return{c(){t=O("div"),d&&d.c(),n=P(),Ae(r.$$.fragment),s=P(),m&&m.c(),a=P(),p&&p.c(),l=B(),z(t,"position","relative")},m(e,i){R(e,t,i),d&&d.m(t,null),N(t,n),$e(r,t,null),N(t,s),m&&m.m(t,null),R(e,a,i),p&&p.m(e,i),R(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=Yi(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],le(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],le(()=>o=!1)),r.$set(a),e[1]?m&&(pe(),ye(m,1,1,()=>{m=null}),ge()):m?(m.p(e,s),2&s[0]&&we(m,1)):(m=Ki(e),m.c(),we(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&we(p,1)):(p=to(e),p.c(),we(p,1),p.m(l.parentNode,l)):p&&(pe(),ye(p,1,1,()=>{p=null}),ge())},i(e){c||(we(r.$$.fragment,e),we(m),we(p),c=!0)},o(e){ye(r.$$.fragment,e),ye(m),ye(p),c=!1},d(e){e&&D(t),d&&d.d(),be(r),m&&m.d(),e&&D(a),p&&p.d(e),e&&D(l)}}}async function*io(e){yield[{name:e}]}function oo(e,n,r){const i=K(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:h}=n,{noForm:f=!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:C,hint:E,readonly:A,required:$=!1,lookup:b="",view:S=!1,multi:T,max:N=1e3,generate:R=!1,status:D=!0,refDoc:x}=_;const[O,k]=b.split(":");let M=!1,P=h.map&&h.map(e=>({name:e}))||[];m||=A,m&&(C="");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:T.view,lookup:b,name:d.name,value:n})};Y(async()=>{i("multi",{view:T.view,lookup:b,name:d.name,value:h});const e=document.getElementById(l);e.classList.add(a),!A&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||N;(T.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:T.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[k]:u[k]},n=await t.getSectionView(O,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},H=(e=!1)=>{if(m||!T.required)return;const t=T.maxItem;if(!t||T.unique)return;r(9,N=!1!==e?e:v||u[t]||0);const n=P?.length!=N,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,h=e.value),"noForm"in e&&r(28,f=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,h=P.map&&P.map(e=>e.name)||[]),H()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===T.maxItem&&H(n)})(g),536870976&e.$$.dirty[0]&&r(6,$=$&&!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(H,250)}})(I)},[h,m,a,l,d,u,$,P,C,N,M,o,s,A,b,S,T,R,D,x,O,k,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[T.maxItem];if(!e)return;let n={};k&&(n={[k]:u[k]}),D&&(n.status=!0);const r=[].concat(u[T.view]||[]);r.length&&(n[T.view]={$in:r});const i=await t.getSectionView(O,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:[]}})},f,p,g,w,y,v,I,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){N=e,r(9,N)},function(e){M=e,r(10,M)}]}class so extends Te{constructor(e){var t;super(),Xi.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}",N(Xi.head,t)),Se(this,e,oo,ro,$,{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 ao(e){let t,n,r;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function lo(e){let t,n,r,i,o;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function co(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[12]);const a=[lo,ao],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}const uo=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)});function ho(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:h}=t,{record:f}=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,h=e.value),"record"in e&&n(10,f=e.record),"item"in e&&n(11,m=e.item)},[i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;const e=u.includes(".")?f[u.split(".")[0]]:f,t=await uo(e);window.open(t,"_blank")},f,m,function(t){Q(e,t)}]}class fo extends Te{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}",N(document.head,t)),Se(this,e,ho,co,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:mo}=_e;function po(e){let t;return{c(){t=O("div"),U(t,"class","load-more-options"),U(t,"slot","load-more-options-message")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function go(e){let t,n,r;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-wpjws5")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function wo(e){let t,n,r,i,o;return n=new vt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-wpjws5")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[8]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function yo(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":[po]},$$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}),ee.push(()=>Ee(n,"value",l)),ee.push(()=>Ee(n,"selection",c)),ee.push(()=>Ee(n,"searchQuery",d)),n.$on("change",e[6]);let h=e[5]&&function(e){let t,n,r,i;const o=[wo,go],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),s=P(),h&&h.c(),z(t,"position","relative"),U(t,"class","inputAutoComplete")},m(e,r){R(e,t,r),$e(n,t,null),N(t,s),h&&h.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]),16&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],le(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],le(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],le(()=>o=!1)),n.$set(s),e[5]&&h.p(e,t)},i(e){a||(we(n.$$.fragment,e),we(h),a=!0)},o(e){ye(n.$$.fragment,e),ye(h),a=!1},d(e){e&&D(t),be(n),h&&h.d()}}}function vo(e,t,n){const{Autocomplete:r}=c,i=K();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:h}=t,{noForm:f=!1}=t,{disabled:m}=t,{formnovalidate:p}=t;const{autocomplete:{input:g,min:w,url:y,output:v},format:I}=a.properties,_=[].concat(g),{name:C}=v,E="map"===I;let A,$=h,b=!1;Y(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",N),e.addEventListener("keyup",T),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},T=e=>{8===e.keyCode&&""===$&&n(0,h="")},N=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(h.startsWith(e[0].name))return;n(3,$=n(0,h=e[0].name)),x(h)}else e.find(e=>($||"").startsWith(e.name))||h||n(3,$=" ");else h||n(3,$="")},R=async(e="")=>{const t=await fetch(y+"?"+D()+"&name=%5E"+e.trim());if(!t.ok)return;const n=t.headers.get("Content-Type").split(";")[0];let r=[];try{if("text/json"===n){const e=await t.text();r=JSON.parse(e||[])}else"application/json"===n&&(r=await t.json())}catch{}return r.map(e=>({name:e[C]}))},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,h=e.value),"noForm"in e&&n(14,f=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[h,s,A,$,r,E,({detail:{value:e}})=>{e.length&&n(3,$=n(0,h=e[0].name)),n(2,A=[]),x(h)},async function*(e){if(b||h&&e.startsWith(h))return n(0,h=e),void x(h);const t=await R(e);if(!t?.length)return n(0,h=e),void x(h);1===t.length?(n(3,$=n(0,h=t[0].name)),n(2,A=[]),x(h)):yield t},async()=>{if(!h)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await uo(e);window.open(t,"_blank")},o,a,l,d,u,f,m,p,function(e){h=e,n(0,h)},function(e){A=e,n(2,A)},function(e){$=e,n(3,$)}]}class Io extends Te{constructor(e){var t;super(),mo.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}",N(mo.head,t)),Se(this,e,vo,yo,$,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:_o}=_e;function Co(e){e[26]=e[28].list,e[27]=e[28].items}function Eo(e,t,n){const r=e.slice();return r[29]=t[n],r}function Ao(e,t,n){const r=e.slice();return r[32]=t[n],r}function $o(e,t,n){const r=e.slice();return r[32]=t[n],r}function bo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function So(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g,w,y;function v(t){e[23](t)}Co(e),n=new e[7]({props:{outline:!0,$$slots:{default:[To]},$$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}),ee.push(()=>Ee(s,"value",v)),s.$on("input",e[12]),d=new tt({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]=No($o(e,r,t));return{c(){t=O("thead"),n=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();U(n,"class","svelte-14hcfjl"),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(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=$o(e,r,o);i[o]?i[o].p(s,t):(i[o]=No(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&&D(t),x(i,e)}}}(e),C=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=xo(Eo(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=B()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);R(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=Eo(e,n,o);r[o]?r[o].p(s,i):(r[o]=xo(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){x(r,e),e&&D(t)}}}(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),i=O("div"),o=M("Suchen: "),Ae(s.$$.fragment),l=P(),c=O("span"),Ae(d.$$.fragment),u=P(),h=O("div"),f=O("table"),_&&_.c(),m=P(),p=O("tbody"),C&&C.c(),U(t,"class","form--buttons svelte-14hcfjl"),U(c,"class","feather pointer svelte-14hcfjl"),z(i,"margin-bottom","1em"),z(i,"position","relative"),U(f,"striped",""),U(f,"class","svelte-14hcfjl"),U(h,"class","eList svelte-14hcfjl")},m(a,v){R(a,t,v),$e(n,t,null),R(a,r,v),R(a,i,v),N(i,o),$e(s,i,null),N(i,l),N(i,c),$e(d,c,null),R(a,u,v),R(a,h,v),N(h,f),_&&_.m(f,null),N(f,m),N(f,p),C&&C.m(p,null),g=!0,w||(y=L(c,"click",e[14]),w=!0)},p(e,t){Co(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],le(()=>a=!1)),s.$set(i),e[27]?.length&&_.p(e,t),e[26]?.length&&C.p(e,t)},i(e){g||(we(n.$$.fragment,e),we(s.$$.fragment,e),we(d.$$.fragment,e),g=!0)},o(e){ye(n.$$.fragment,e),ye(s.$$.fragment,e),ye(d.$$.fragment,e),g=!1},d(e){e&&D(t),be(n),e&&D(r),e&&D(i),be(s),be(d),e&&D(u),e&&D(h),_&&_.d(),C&&C.d(),w=!1,y()}}}function To(e){let t;return{c(){t=M("Abbrechen")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function No(e){let t,n,r=e[32]?.designation+"";return{c(){t=O("th"),n=M(r),U(t,"class","svelte-14hcfjl")},m(e,r){R(e,t,r),N(t,n)},p:I,d(e){e&&D(t)}}}function Ro(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=Do(Ao(e,r,t));return{c(){t=O("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=P(),U(t,"class","pointer svelte-14hcfjl"),j(t,"active",e[29]._id===e[0])},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);N(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=Ao(e,r,s);i[s]?i[s].p(a,o):(i[s]=Do(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]&&j(t,"active",e[29]._id===e[0])},d(e){e&&D(t),x(i,e)}}}function Do(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=O("td"),n=M(o),U(t,"class","svelte-14hcfjl")},m(o,s){R(o,t,s),N(t,n),r||(i=L(t,"click",V(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&D(t),r=!1,i()}}}function xo(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&Ro(e);return{c(){r&&r.c(),t=B()},m(e,n){r&&r.m(e,n),R(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=Ro(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&D(t)}}}function Oo(e){let t,n;return t=new e[5]({}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p:I,i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ko(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Oo,then:So,catch:bo,value:28,blocks:[,,,]};return ve(e[11](),o),{c(){Ae(t.$$.fragment),n=P(),r=B(),o.block.c()},m(e,s){$e(t,e,s),R(e,n,s),R(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ie(o,e=t,n)},i(e){i||(we(t.$$.fragment,e),we(o.block),i=!0)},o(e){ye(t.$$.fragment,e);for(let e=0;e<3;e+=1){ye(o.blocks[e])}i=!1},d(e){be(t,e),e&&D(n),e&&D(r),o.block.d(e),o.token=null,o=null}}}function Mo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ko]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Po(e,n,i){const o=K(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:h}=n,{className:f}=n,{classId:p}=n,{rowId:w}=n,{viewName:y}=n,{viewValue:v}=n,{recordId:I}=n,{filter:_}=n,C="",E=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?g(n):m(e[`_${t.name}`]||e[t.name]||"")},$=t.getSchemaByClass(f);Y(()=>{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 $;e.eventId===t.id&&_m(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,h=e.item),"className"in e&&i(16,f=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,w=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)},[w,C,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await $,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 Xt(o,e,i)}},({detail:{value:e}})=>{i(1,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(1,C="")},h,f,p,y,v,I,_,()=>o("back"),function(e){C=e,i(1,C)}]}class Bo extends Te{constructor(e){var t;super(),_o.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}",N(_o.head,t)),Se(this,e,Po,Mo,$,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Lo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Fo(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}),ee.push(()=>Ee(n,"value",s));let l=!e[6]&&Vo(e);return{c(){t=O("div"),Ae(n.$$.fragment),i=P(),l&&l.c(),z(t,"position","relative")},m(e,r){R(e,t,r),$e(n,t,null),N(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],le(()=>r=!1)),n.$set(o),e[6]?l&&(pe(),ye(l,1,1,()=>{l=null}),ge()):l?(l.p(e,i),64&i&&we(l,1)):(l=Vo(e),l.c(),we(l,1),l.m(t,null))},i(e){o||(we(n.$$.fragment,e),we(l),o=!0)},o(e){ye(n.$$.fragment,e),ye(l),o=!1},d(e){e&&D(t),be(n),l&&l.d()}}}function Vo(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-wbrqzu")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[17]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Uo(e){return{c:I,m:I,p:I,i:I,o:I,d:I}}function Ho(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Wo]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),ee.push(()=>Ee(t,"open",i)),{c(){Ae(t.$$.fragment)},m(e,n){$e(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],le(()=>n=!1)),t.$set(i)},i(e){r||(we(t.$$.fragment,e),r=!0)},o(e){ye(t.$$.fragment,e),r=!1},d(e){be(t,e)}}}function Wo(e){let t,n;return t=new Bo({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(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function zo(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Uo,then:Fo,catch:Lo,value:27,blocks:[,,,]};ve(e[16](),i);let o=e[8]&&Ho(e);return{c(){i.block.c(),t=P(),o&&o.c(),n=B()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,R(e,t,s),o&&o.m(e,s),R(e,n,s),r=!0},p(t,[r]){Ie(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&we(o,1)):(o=Ho(e),o.c(),we(o,1),o.m(n.parentNode,n)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){r||(we(i.block),we(o),r=!0)},o(e){for(let e=0;e<3;e+=1){ye(i.blocks[e])}ye(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&D(t),o&&o.d(e),e&&D(n)}}}function jo(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:h}=t,{formnovalidate:f}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:I=!1,view:_}=p,C=!1;const E=()=>{n(8,C=!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,h=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,h,f,C,g,r,i,w,v,I,_,async()=>(n(9,g=l[_.selection]),!0),()=>{n(8,C=!0)},({detail:e})=>{n(0,d=e.row[_.value?_.value:"_id"]),E()},E,m,function(e){d=e,n(0,d)},function(e){C=e,n(8,C)}]}class Go extends Te{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}",N(document.head,t)),Se(this,e,jo,zo,$,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function qo(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Xo(e){let t;return{c(){t=O("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function Yo(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){R(e,t,n)},d(e){e&&D(t)}}}function Zo(e){let t,n,r,i,o=e[12]+"";return{c(){t=O("option"),n=M(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){R(e,t,r),N(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&&D(t)}}}function Ko(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Yo:Xo}let r=n(e),i=r(e);return{c(){i.c(),t=B()},m(e,n){i.m(e,n),R(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&&D(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=Zo(qo(e,a,t));return{c(){t=O("select"),s&&s.c(),n=B();for(let e=0;e<l.length;e+=1)l[e].c();U(t,"class",r=S(e[3]||e[4])+" svelte-5xpzvo"),U(t,"id",e[2]),U(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){R(r,t,a),s&&s.m(t,null),N(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=L(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=qo(e,a,r);l[r]?l[r].p(i,n):(l[r]=Zo(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=S(e[3]||e[4])+" svelte-5xpzvo")&&U(t,"class",r),4&n&&U(t,"id",e[2]),4&n&&U(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:I,o:I,d(e){e&&D(t),s&&s.d(),x(l,e),i=!1,o()}}}function Qo(e,t,n){const r=K();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:h,readonly:f}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===h&&(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"===h&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===h&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,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,h,f,e=>r("blur",{value:e.srcElement.value}),o]}class Jo extends Te{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}",N(document.head,t)),Se(this,e,Qo,Ko,$,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function es(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 Be({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"title","Übernehmen"),U(t,"class","pointer feather")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[12]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}(e);return{c(){t=O("input"),r=P(),Ae(i.$$.fragment),o=P(),d&&d.c(),s=B(),U(t,"type","string"),U(t,"class",n=e[3]||e[4]),U(t,"id",e[1]),U(t,"name",e[1]),t.hidden=!0},m(n,u){R(n,t,u),W(t,e[0]),R(n,r,u),$e(i,n,u),R(n,o,u),d&&d.m(n,u),R(n,s,u),a=!0,l||(c=L(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&U(t,"class",n),(!a||2&r)&&U(t,"id",e[1]),(!a||2&r)&&U(t,"name",e[1]),1&r&&W(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||(we(i.$$.fragment,e),we(d),a=!0)},o(e){ye(i.$$.fragment,e),ye(d),a=!1},d(e){e&&D(t),e&&D(r),be(i,e),e&&D(o),d&&d.d(e),e&&D(s),l=!1,c()}}}let ts=new Map;function ns(e,n,r){const i=K(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:h=!1}=n,{classId:f}=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,C=l.properties?.noCalendar||!1,E=l.properties?.transfer,A=({detail:e})=>{try{r(0,s=hr(e.value,s)),void 0!==u&&""!==u&&ts.set(_,new Date(s.valueOf())),$(s)}catch{r(0,s=void 0)}},$=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=hr(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,h=e.noForm),"classId"in e&&r(4,f=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&&!E&&ts.has(_)&&r(0,s=ts.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&&A({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=hr(d[l.name],s))}catch{}},[s,a,u,h,f,p,g,w,o,C,E,A,()=>{i("record",{target:E.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 rs extends Te{constructor(e){super(),Se(this,e,ns,es,$,{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 is(e){let t;return{c(){t=M("Stunden")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function os(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[is]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ss(e){let t;return{c(){t=M("Minuten")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function as(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ss]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ls(e){let t;return{c(){t=M("Jetzt")},m(e,n){R(e,t,n)},d(e){e&&D(t)}}}function cs(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[ls]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ds(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":[cs],"minutes-label":[as],"hours-label":[os]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=O("input"),r=P(),Ae(i.$$.fragment),o=P(),Ae(s.$$.fragment),U(t,"type","string"),U(t,"class",n=e[2]||e[3]),U(t,"id",e[1]),U(t,"name",e[1]),t.hidden=!0},m(n,d){R(n,t,d),W(t,e[0]),R(n,r,d),$e(i,n,d),R(n,o,d),$e(s,n,d),a=!0,l||(c=L(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&U(t,"class",n),(!a||2&r)&&U(t,"id",e[1]),(!a||2&r)&&U(t,"name",e[1]),1&r&&W(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||(we(i.$$.fragment,e),we(s.$$.fragment,e),a=!0)},o(e){ye(i.$$.fragment,e),ye(s.$$.fragment,e),a=!1},d(e){e&&D(t),e&&D(r),be(i,e),e&&D(o),be(s,e),l=!1,c()}}}function us(e,t,n){const r=K(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const h=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))),h(a)},({detail:e})=>{n(0,a=hr(e.value,a)),h(a)},function(){a=this.value,n(0,a)}]}class hs extends Te{constructor(e){super(),Se(this,e,us,ds,$,{value:0,id:1,noForm:2,classId:3})}}function fs(e){let t,n,r,i,o,s,a,l,c,d,u,h,f,m,p,g;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[12]),{c(){t=O("input"),o=P(),s=O("input"),d=P(),Ae(u.$$.fragment),h=M(" /\n"),Ae(f.$$.fragment),U(t,"type","string"),U(t,"class",n=e[1]||e[2]),U(t,"id",r=e[0]+"_from"),U(t,"name",i=e[0]+"_from"),t.hidden=!0,U(s,"type","string"),U(s,"class",a=e[1]||e[2]),U(s,"id",l=e[0]+"_to"),U(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){R(n,t,r),W(t,e[7]),R(n,o,r),R(n,s,r),W(s,e[8]),R(n,d,r),$e(u,n,r),R(n,h,r),$e(f,n,r),m=!0,p||(g=[L(t,"input",e[15]),L(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&U(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&U(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&U(t,"name",i),128&o&&W(t,e[7]),(!m||6&o&&a!==(a=e[1]||e[2]))&&U(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&U(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&U(s,"name",c),256&o&&W(s,e[8]);const d={};32&o&&(d.format=e[5]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),128&o&&(d.value=e[7]),u.$set(d);const h={};64&o&&(h.format=e[6]),8&o&&(h.required=e[3]),16&o&&(h.disabled=e[4]),256&o&&(h.value=e[8]),f.$set(h)},i(e){m||(we(u.$$.fragment,e),we(f.$$.fragment,e),m=!0)},o(e){ye(u.$$.fragment,e),ye(f.$$.fragment,e),m=!1},d(e){e&&D(t),e&&D(o),e&&D(s),e&&D(d),be(u,e),e&&D(h),be(f,e),p=!1,E(g)}}}function ms(e,t,n){const r=K(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:h}=t;const{noCalendar:f,preset:m}=a.properties||{};let p="%d.%m.%Y",g="%d.%m.%Y",w=o?.from,y=o?.to;if(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&&(w=e),t&&(y=t)}"Invalid Date"===w?.toString()&&(w=void 0),"Invalid Date"===y?.toString()&&(y=void 0),h&&(void 0===w&&(p=""),void 0===y&&(g=""));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,h=e.disabled)},[s,l,d,u,h,p,g,w,y,i,f,({detail:e})=>{n(7,w=hr(e.value,w)),y&&w&&y.valueOf()-w.valueOf()<0&&n(7,w=void 0),r("change",{value:w,range:"_from"})},({detail:e})=>{n(8,y=hr(e.value,y)),y&&w&&y.valueOf()-w.valueOf()<0&&n(8,y=void 0),r("change",{value:y,range:"_to"})},o,a,function(){w=this.value,n(7,w)},function(){y=this.value,n(8,y)}]}class ps extends Te{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}",N(document.head,t)),Se(this,e,ms,fs,$,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var gs={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 ws(e){return ws="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},ws(e)}function ys(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 vs(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 vs(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 vs(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 Is={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=ys(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=ys(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function _s(e){return!isNaN(parseInt(e))&&isFinite(e)}function Cs(e){return e%2==0}function Es(e){return _s(e)&&!Number.isInteger(e)}function As(e){return Math.abs(e)%1==.5}function $s(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 bs(e){return void 0===e}function Ss(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===ws(e[1])){var r=Ss(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function Ts(){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 As(e)&&Cs(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return As(e)?Cs(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return As(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return As(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return As(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 Es(t)||Es(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 Ns=Ts();function Rs(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"!==ws(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return $s(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return Ss(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function Ds(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function xs(e){Ds(function(e){return _s(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Os(e){Ds(Number.isInteger(e),"You must provide an integer.",TypeError)}var ks=Ts(),Ms=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;Os(r),Os(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})},h=function(e){Ds(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;Os(e);var n=this.getPrecision(),r=e>n,i=r?ks.multiply:ks.divide,o=r?[e,n]:[n,e],s=Math.pow(10,ks.subtract.apply(ks,o));return u.call(this,{amount:ks.round(i(this.getAmount(),s),t),precision:e})},add:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ks.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:ks.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:ks.round(ks.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:ks.round(ks.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return xs(e),this.multiply(ks.divide(e,100),t)},allocate:function(e){var t=this;!function(e){Ds(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 ks.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(ks.divide(ks.multiply(t.getAmount(),e),n));return r=ks.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=ks.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,h=n.roundingMode,f=void 0===h?l:h,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:f});return Rs(m).getExchangeRate(this.getCurrency(),e).then(function(n){return Ds(!bs(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:ks.round(ks.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){h.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!==ks.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==ks.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!bs(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return bs(this.getMatches().find(e))?0:this.getMatches()[Ns.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 bs(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!bs(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 ks.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 ks.divide(ks.round(ks.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},gs,Is),Ps={},Bs={};!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}(Bs);const Ls=Bs,Fs={allowBooleanAttributes:!1,unpairedTags:[]};function Vs(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Us(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 Ys("InvalidXml","XML declaration allowed only at the start of the document.",Qs(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Hs(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}Ps.validate=function(e,t){t=Object.assign({},Fs,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=Us(e,o),o.err)return o}else{if("<"!==e[o]){if(Vs(e[o]))continue;return Ys("InvalidChar","char '"+e[o]+"' is not expected.",Qs(e,o))}{let s=o;if(o++,"!"===e[o]){o=Hs(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--),!Ks(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Ys("InvalidTag",t,Qs(e,o))}const c=js(e,o);if(!1===c)return Ys("InvalidAttr","Attributes for '"+l+"' have open quote.",Qs(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=qs(d,t);if(!0!==i)return Ys(i.err.code,i.err.msg,Qs(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Ys("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Qs(e,o));if(d.trim().length>0)return Ys("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Qs(e,s));if(0===n.length)return Ys("InvalidTag","Closing tag '"+l+"' has not been opened.",Qs(e,s));{const t=n.pop();if(l!==t.tagName){let n=Qs(e,t.tagStartPos);return Ys("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Qs(e,s))}0==n.length&&(i=!0)}}else{const a=qs(d,t);if(!0!==a)return Ys(a.err.code,a.err.msg,Qs(e,o-d.length+a.err.line));if(!0===i)return Ys("InvalidXml","Multiple possible root nodes found.",Qs(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=Hs(e,o);continue}if("?"!==e[o+1])break;if(o=Us(e,++o),o.err)return o}else if("&"===e[o]){const t=Xs(e,o);if(-1==t)return Ys("InvalidChar","char '&' is not expected.",Qs(e,o));o=t}else if(!0===i&&!Vs(e[o]))return Ys("InvalidXml","Extra text at the end",Qs(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Ys("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Qs(e,n[0].tagStartPos)):!(n.length>0)||Ys("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ys("InvalidXml","Start tag expected.",1)};const Ws='"',zs="'";function js(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Ws||e[t]===zs)""===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 Gs=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function qs(e,t){const n=Ls.getAllMatches(e,Gs),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Ys("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Js(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Ys("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Js(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Ys("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Js(n[e]));const i=n[e][2];if(!Zs(i))return Ys("InvalidAttr","Attribute '"+i+"' is an invalid name.",Js(n[e]));if(r.hasOwnProperty(i))return Ys("InvalidAttr","Attribute '"+i+"' is repeated.",Js(n[e]));r[i]=1}return!0}function Xs(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 Ys(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function Zs(e){return Ls.isName(e)}function Ks(e){return Ls.isName(e)}function Qs(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Js(e){return e.startIndex+e[1].length}var ea={};const ta={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}};ea.buildOptions=function(e){return Object.assign({},ta,e)},ea.defaultOptions=ta;var na=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 ra=Bs;function ia(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 oa(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function sa(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 aa(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 la(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 ca(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 da(e){if(ra.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var ua=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&&sa(e,t))t+=7,[entityName,val,t]=ia(e,t+1),-1===val.indexOf("&")&&(n[da(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&aa(e,t))t+=8;else if(i&&la(e,t))t+=8;else if(i&&ca(e,t))t+=9;else{if(!oa)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const ha=/^[-+]?0x[a-fA-F0-9]+$/,fa=/^([\-\+])?(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 ma={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var pa=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 ga=Bs,wa=na,ya=ua,va=function(e,t={}){if(t=Object.assign({},ma,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&&ha.test(n))return Number.parseInt(n,16);{const r=fa.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}},Ia=pa;function _a(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 Ca(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 ka(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?ka(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Ea(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 Aa=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function $a(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=ga.getAllMatches(e,Aa),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:ka(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 ba=function(e){e=e.replace(/\r\n?/g,"\n");const t=new wa("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=Da(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=xa(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 wa(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=Da(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=ya(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=Da(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=xa(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 h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.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 wa(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 wa(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 wa(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 Sa(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 Ta=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 Na(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 Ra(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 Da(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function xa(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 Oa(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=Da(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=Da(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=Da(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=Da(e,"]]>",n,"StopNode is not closed.")-2}else{const r=xa(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function ka(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:va(e,n))}return ga.isExist(e)?e:""}var Ma=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=_a,this.parseXml=ba,this.parseTextData=Ca,this.resolveNameSpace=Ea,this.buildAttributesMap=$a,this.isItStopNode=Ra,this.replaceEntitiesValue=Ta,this.readStopNodeData=Oa,this.saveTextToParentTag=Na,this.addChild=Sa,this.ignoreAttributesFn=Ia(this.options.ignoreAttributes)}},Pa={};function Ba(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=La(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=Ba(s[a],t,l);const n=Va(e,t);s[":@"]?Fa(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 La(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function Fa(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 Va(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])}Pa.prettify=function(e,t){return Ba(e,t)};const{buildOptions:Ua}=ea,Ha=Ma,{prettify:Wa}=Pa,za=Ps;var ja=class{constructor(e){this.externalEntities={},this.options=Ua(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=za.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ha(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Wa(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 Ga(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=qa(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Ya(c,t)||(e=t.tagValueProcessor(l,e),e=Za(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=Xa(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}${Xa(a[":@"],t)}`,h=Ga(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":h&&0!==h.length||!t.suppressEmptyNode?h&&h.endsWith(">")?i+=u+`>${h}${r}</${l}>`:(i+=u+">",h&&""!==r&&(h.includes("/>")||h.includes("</"))?i+=r+t.indentBy+h+r:i+=h,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function qa(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 Xa(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=Za(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Ya(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 Za(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 Ka=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Ga(e,t,"",n)},Qa=pa,Ja={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 el(e){this.options=Object.assign({},Ja,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Qa(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=rl),this.processTextOrObjNode=tl,this.options.format?(this.indentate=nl,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function tl(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 nl(e){return this.options.indentBy.repeat(e)}function rl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}el.prototype.build=function(e){return this.options.preserveOrder?Ka(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},el.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}},el.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},el.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}},el.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},el.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}},el.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 il={XMLParser:ja,XMLValidator:Ps,XMLBuilder:el},ol=[],sl=0;sl<256;++sl)ol.push((sl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class al extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ll extends al{constructor(e){super(e)}}class cl extends al{constructor(e){super(e)}}const dl=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}},ul=e=>{if(e)return e.FinInstnId?.BIC?{bic:e.FinInstnId.BIC}:e.FinInstnId?.BICFI?{bic:e.FinInstnId.BICFI}:e.FinInstnId?{abaRoutingNumber:(e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId.MmbId).toString()}:void 0},hl=(e,t="USD")=>{const n=Ms({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},fl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},ml=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=hl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,h=e.TxsSummry?.TtlCdtNtries.Sum,f=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=dl(e.Acct),g=ul(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(pl):e.Bal&&(w=[pl(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(gl):e.Ntry&&(y=[gl(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:h,numOfDebits:f,sumOfDebits:m,balances:w,entries:y}},pl=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=hl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:fl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},gl=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=fl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=hl(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=yl(e.BkTxCd);let h=e.NtryDtls||[];Array.isArray(h)||(h=[h]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:h.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(wl)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},wl=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(),h=e.RmtInf?.Strd?.AddtlRmtInf;let f,m,p,g,w,y,v,I;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm),e.RltdPties?.DbtrAcct&&(p=dl(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=ul(e.RltdAgts.DbtrAgt)),(m||p||g)&&(f={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm),e.RltdPties?.CdtrAcct&&(v=dl(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&(I=ul(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:f,creditor:w,invoiceRef:u,invoiceRefAdd:h}},yl=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 vl{_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 il.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=vl.getParser().parse(e);if(!t.Document)throw new ll("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new cl("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=>ml(e)):[ml(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new vl({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 Il(e){let t,n,r,i,o;function s(t){e[13](t)}let a={class:e[0],id:e[1],name:e[2],accept:".xml",max:"1",beforeChange:e[9]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function _l(e){let t,n;return t=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ae(t.$$.fragment)},m(e,r){$e(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||(we(t.$$.fragment,e),n=!0)},o(e){ye(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Cl(e){let t,n,r,i;const o=[_l,Il],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function El(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=n;const m="camt53"===u.properties?.type;let p=[],g=d[u.name]||"",w=!!d._id;const y=async(e,n,r,i,o,s)=>{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a&&console.log("bill",s,o,a),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}return""},v=async(e,n,r)=>{if("credit"!==e)return"";let i=C(n);if(i.startsWith("R-")||(i=""),!i&&r){if(r=r.toString(),i=C(r.replaceAll(" ","")),i.startsWith("R-")||(i=""),!i&&r.includes("R-")){i="R-"+r.split("R-")[1].slice(0,8)}if(!i&&r.includes("2025")){i="R-2025"+r.split("2025")[1].slice(0,4)}}if(!i)return"";const o=await t.getSectionView("invoice",{invoiceId:i});return o?.length?o[0]._id:""},I=async e=>{if(!e)return{};const n=await t.getSectionView("incomingPayment",{invoice:e});return n?.length?{incomingPayment:n[0]._id,paymentDate:n[0].date}:{}},_=async(e,t,n)=>{const r=await(async e=>vl.fromXML(e))(t);for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=r[e.properties.source];"date"===e.name&&(t=t.toISOString().slice(0,10)),s("record",{itemName:e.name,value:t})}const i=[],{refItem:o,value:a}=e.process.filter;for(const t of r[e.source])for(const e of t.entries){if(e[o]!==a)continue;let n="SALA"===e.bankTransactionCode?.domainSubFamilyCode,r=!1;for(const o of e.transactions){const s=await v(e.creditDebitIndicator,o.invoiceRef,o.remittanceInformation),{incomingPayment:a,paymentDate:l}=await I(s),c=await y(e.creditDebitIndicator,n,o.paymentInformationId,o.invoiceRef,o.amount,o.creditor?.account?.iban),d={accountServicerReferenceId:o.accountServicerReferenceId,messageId:o.messageId,account:t.account.iban,creditDebitIndicator:e.creditDebitIndicator,bookingDate:e.bookingDate,amount:o.amount,currency:o.currency,debtor:o.debtor?.name||"",debtorAccount:o.debtor?.account?.iban||"",creditor:o.creditor?.name||"",creditorAccount:o.creditor?.account?.iban||"",paymentInformationId:o.paymentInformationId,invoiceRef:o.invoiceRef,invoiceRefAdd:o.invoiceRefAdd,remittanceInformation:o.remittanceInformation,returnAdditionalInformation:o.returnAdditionalInformation,additionalInformation:e.additionalInformation,invoice:s,incomingPayment:a,isSalary:n,bill:c};if(n){if(r)continue;d.amount=e.amount/100,r=!0}i.push(d)}}i.length&&s("record",{itemName:e.name,value:i})},C=e=>{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};return e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(10,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(12,u=e.item),"id"in e&&r(1,h=e.id),"name"in e&&r(2,f=e.name)},[a,h,f,p,g,i,o,w,async()=>{const{list:e}=u.properties,n=p[0],i=await t.getEvent(l);if(n){r(4,g=n.name);const t=await n.text();if(m)return((e,t)=>{t.output.class[0].list.map(n=>_(n,e,t))})(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),a=[],l=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(l.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:C(t),information:n.RmtInf?.Ustrd||""};a.push(r)}}a.length&&s("record",{itemName:e,value:a})}},()=>{r(3,p)},l,d,u,function(e){p=e,r(3,p)}]}class Al extends Te{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}",N(document.head,t)),Se(this,e,El,Cl,$,{classId:0,eventId:10,record:11,item:12,id:1,name:2})}}const $l=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=bl(10,n[31]),t.amountVat=Sl(!0,bl(32,n[31]),t.amount)||Sl(!1,bl(33,n[31]),t.amount),t):t},bl=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},Sl=(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:Tl}=_e;function Nl(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}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function Rl(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]&&Dl(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(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&&we(o,1)):(o=Dl(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function Dl(e){let t,n,r,i,o;return n=new De({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-o0hiko")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function xl(e){let t,n,r,i;const o=[Rl,Nl],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}let Ol;function kl(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=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=$l(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 Y(()=>{if(Ol)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){Ol=PDF_QR_JS}}),Z(()=>{}),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,h=e.id),"name"in e&&r(2,f=e.name)},[a,h,f,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}}),Ol.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 Ml extends Te{constructor(e){var t;super(),Tl.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}",N(Tl.head,t)),Se(this,e,kl,xl,$,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Pl}=_e;function Bl(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}),ee.push(()=>Ee(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(){Ae(t.$$.fragment),r=P(),Ae(i.$$.fragment)},m(e,n){$e(t,e,n),R(e,r,n),$e(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],le(()=>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||(we(t.$$.fragment,e),we(i.$$.fragment,e),o=!0)},o(e){ye(t.$$.fragment,e),ye(i.$$.fragment,e),o=!1},d(e){be(t,e),e&&D(r),be(i,e)}}}function Ll(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]&&Fl(e);return{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o&&o.c(),z(t,"position","relative")},m(e,s){R(e,t,s),$e(n,t,null),N(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&&we(o,1)):(o=Fl(e),o.c(),we(o,1),o.m(t,null)):o&&(pe(),ye(o,1,1,()=>{o=null}),ge())},i(e){i||(we(n.$$.fragment,e),we(o),i=!0)},o(e){ye(n.$$.fragment,e),ye(o),i=!1},d(e){e&&D(t),be(n),o&&o.d()}}}function Fl(e){let t,n,r,i,o;const s=[Ul,Vl],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=B()},m(e,t){a[n].m(e,t),R(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(pe(),ye(a[o],1,1,()=>{a[o]=null}),ge(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),we(r,1),r.m(i.parentNode,i))},i(e){o||(we(r),o=!0)},o(e){ye(r),o=!1},d(e){a[n].d(e),e&&D(i)}}}function Vl(e){let t,n,r,i,o;return n=new De({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-o0hiko")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[10]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function Ul(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:zl,then:Wl,catch:Hl,value:23};return ve(e[11](),n),{c(){t=B(),n.block.c()},m(e,r){R(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ie(n,e=t,r)},i:I,o:I,d(e){e&&D(t),n.block.d(e),n.token=null,n=null}}}function Hl(e){return{c:I,m:I,p:I,d:I}}function Wl(e){let t,n,r,i;return{c(){t=O("video"),n=O("source"),i=M("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&U(n,"src",r),U(n,"type","video/mp4"),U(t,"width","500"),t.controls=!0,z(t,"margin-top","1em")},m(e,r){R(e,t,r),N(t,n),N(t,i)},p:I,d(e){e&&D(t)}}}function zl(e){return{c:I,m:I,p:I,d:I}}function jl(e){let t,n,r,i;const o=[Ll,Bl],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=B()},m(e,n){s[t].m(e,n),R(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(pe(),ye(s[l],1,1,()=>{s[l]=null}),ge(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),we(n,1),n.m(r.parentNode,r))},i(e){i||(we(n),i=!0)},o(e){ye(n),i=!1},d(e){s[t].d(e),e&&D(r)}}}function Gl(e,n,r){const{FileDropzone:i,TextField:o}=c,s=K();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:h}=n,{name:f}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Y(()=>{(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)})()}),Z(()=>{}),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,h=e.id),"name"in e&&r(2,f=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,h,f,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 ql extends Te{constructor(e){var t;super(),Pl.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}",N(Pl.head,t)),Se(this,e,Gl,jl,$,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function Xl(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:Yl,placeholder:Zl,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=O("div"),Ae(n.$$.fragment),z(t,"max-width","4em")},m(e,i){R(e,t,i),$e(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||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}const Yl="([01][0-9]|2[0-3]):([0-5][0-9])",Zl="";function Kl(e,t,n){const r=K(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:h}=t;const f=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,h=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:f(e.value)}),r("checkRange",{idx:h,fieldId:o,value:e.value})},s,h]}class Ql extends Te{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}",N(document.head,t)),Se(this,e,Kl,Xl,$,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Jl}=_e;function ec(e,t,n){const r=e.slice();return r[20]=t[n],r}function tc(e,t,n){const r=e.slice();return r[23]=t[n],r[25]=n,r}function nc(e){let t,n,r=e[2](e[20],e[23])+"",i=e[25]&&function(){let e;return{c(){e=M(", ")},m(t,n){R(t,e,n)},d(t){t&&D(e)}}}();return{c(){t=O("span"),i&&i.c(),n=M(r),U(t,"class","lookupValue")},m(e,r){R(e,t,r),i&&i.m(t,null),N(t,n)},p(e,t){3&t&&r!==(r=e[2](e[20],e[23])+"")&&H(n,r)},d(e){e&&D(t),i&&i.d()}}}function rc(e){let t,n,r,i,o,s,a,l,c=e[0],d=[];for(let t=0;t<c.length;t+=1)d[t]=nc(tc(e,c,t));return i=new it({props:{size:"18"}}),{c(){t=O("div");for(let e=0;e<d.length;e+=1)d[e].c();n=P(),r=O("span"),Ae(i.$$.fragment),o=P(),U(r,"class","feather pointer svelte-1r8jgd4"),U(t,"class","lookupItem svelte-1r8jgd4")},m(c,u){R(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);N(t,n),N(t,r),$e(i,r,null),N(t,o),s=!0,a||(l=L(r,"click",function(){A(e[3](e[20]._id))&&e[3](e[20]._id).apply(this,arguments)}),a=!0)},p(r,i){if(e=r,7&i){let r;for(c=e[0],r=0;r<c.length;r+=1){const o=tc(e,c,r);d[r]?d[r].p(o,i):(d[r]=nc(o),d[r].c(),d[r].m(t,n))}for(;r<d.length;r+=1)d[r].d(1);d.length=c.length}},i(e){s||(we(i.$$.fragment,e),s=!0)},o(e){ye(i.$$.fragment,e),s=!1},d(e){e&&D(t),x(d,e),be(i),a=!1,l()}}}function ic(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=rc(ec(e,r,t));const o=e=>ye(i[e],1,1,()=>{i[e]=null});return{c(){t=O("div");for(let e=0;e<i.length;e+=1)i[e].c();U(t,"class","lookup svelte-1r8jgd4")},m(e,r){R(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(15&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=ec(e,r,s);i[s]?(i[s].p(o,n),we(i[s],1)):(i[s]=rc(o),i[s].c(),we(i[s],1),i[s].m(t,null))}for(pe(),s=r.length;s<i.length;s+=1)o(s);ge()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)we(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)ye(i[e]);n=!1},d(e){e&&D(t),x(i,e)}}}function oc(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:h}=o.properties;let f=d.split(","),[p,g]=c.split(":"),w=[];const[y,v]=g.split("."),I=(e,t)=>{const[n,r]=t.split(".");return r?e[n][r]:""},_=(e=!0)=>{se().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 Y(_),e.$$set=e=>{"id"in e&&r(4,i=e.id),"item"in e&&r(5,o=e.item),"praefix"in e&&r(6,s=e.praefix),"record"in e&&r(7,a=e.record),"notifyList"in e&&r(8,l=e.notifyList)},e.$$.update=()=>{256&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==p)return;if(r(1,w=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[p])return _();const o=!f.some(e=>e.includes(":")),s=v?v+"."+p:p;let l={[s]:a[p]||a._id};if(h&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":h}}]),r(1,w=await t.getSectionView(y,l,o)),!o&&w.length){const e=f.find(e=>e.includes(":")),t=e.split(":")[0];r(1,w=w.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,f=f.map(e=>e.split(":")[1]))}_(!w.length)})(l)},[f,w,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||I(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)},i,o,s,a,l]}class sc extends Te{constructor(e){var t;super(),Jl.getElementById("svelte-1r8jgd4-style")||((t=O("style")).id="svelte-1r8jgd4-style",t.textContent=".feather.svelte-1r8jgd4{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1r8jgd4{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1r8jgd4{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}",N(Jl.head,t)),Se(this,e,oc,ic,$,{id:4,item:5,praefix:6,record:7,notifyList:8})}}function ac(e){let t,n,r;return n=new dt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function lc(e){let t,n,r,i,o;return n=new dt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[9]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function cc(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=[lc,ac],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function dc(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:h}=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,h=e.value)},[i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;let e=h;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){Q(e,t)}]}class uc extends Te{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}",N(document.head,t)),Se(this,e,dc,cc,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function hc(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function fc(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[11]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function mc(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[12]);const a=[fc,hc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function pc(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:h}=t,{pattern:f}=t,{placeholder:m}=t;f||="(\\+(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})$",m||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,i=e.inputClass),"disabled"in e&&n(3,o=e.disabled),"formnovalidate"in e&&n(4,s=e.formnovalidate),"readonly"in e&&n(5,a=e.readonly),"required"in e&&n(6,l=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,h=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,m=e.placeholder)},[f,m,i,o,s,a,l,d,u,h,r,async()=>{if(!h)return;let e="tel:"+h;window.open(e,"_self")},function(t){Q(e,t)}]}class gc extends Te{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}",N(document.head,t)),Se(this,e,pc,mc,$,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function wc(e){let t,n,r;return n=new gt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather2 svelte-9up2nn")},m(e,i){R(e,t,i),$e(n,t,null),r=!0},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n)}}}function yc(e){let t,n,r,i,o;return n=new gt({props:{size:"18"}}),{c(){t=O("span"),Ae(n.$$.fragment),U(t,"class","feather pointer svelte-9up2nn")},m(s,a){R(s,t,a),$e(n,t,null),r=!0,i||(o=L(t,"click",e[12]),i=!0)},p:I,i(e){r||(we(n.$$.fragment,e),r=!0)},o(e){ye(n.$$.fragment,e),r=!1},d(e){e&&D(t),be(n),i=!1,o()}}}function vc(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=[yc,wc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=O("div"),Ae(n.$$.fragment),r=P(),o.c(),z(t,"position","relative")},m(e,o){R(e,t,o),$e(n,t,null),N(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):(pe(),ye(l[d],1,1,()=>{l[d]=null}),ge(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),we(o,1),o.m(t,null))},i(e){s||(we(n.$$.fragment,e),we(o),s=!0)},o(e){ye(n.$$.fragment,e),ye(o),s=!1},d(e){e&&D(t),be(n),l[i].d()}}}function Ic(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:h}=t,{multiple:f}=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,h=e.value),"multiple"in e&&n(8,f=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,h,f,m,p,r,async()=>{if(!h)return;let e="mailto:"+h;window.open(e,"_self")},function(t){Q(e,t)}]}class _c extends Te{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}",N(document.head,t)),Se(this,e,Ic,vc,$,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const Cc=["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 Ec(e){let t;return{c(){t=O("textarea"),U(t,"id",e[0]),z(t,"visibility","hidden")},m(n,r){R(n,t,r),e[20](t)},p(e,n){1&n&&U(t,"id",e[0])},d(n){n&&D(t),e[20](null)}}}function Ac(e){let t;return{c(){t=O("div"),U(t,"id",e[0])},m(n,r){R(n,t,r),e[19](t)},p(e,n){1&n&&U(t,"id",e[0])},d(n){n&&D(t),e[19](null)}}}function $c(e){let t;function n(e,t){return e[1]?Ac:Ec}let r=n(e),i=r(e);return{c(){t=O("div"),i.c(),U(t,"class",e[2])},m(n,r){R(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&&U(t,"class",e[2])},i:I,o:I,d(n){n&&D(t),i.d(),e[21](null)}}}const bc=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let Sc=(()=>{let e={listeners:[],scriptId:bc("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 Tc(e,t,n){let r,i,o,{id:s=bc("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:h="7"}=t,{scriptSrc:f}=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 C=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},E=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},A=K(),$=()=>{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",()=>{E(e,l),C(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)=>{Cc.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,A),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=$())||void 0===e||e.init(t)};return Y(()=>{if(null!==$())b();else{const e=f||`https://cdn.tiny.cloud/1/${d}/tinymce/${h}/tinymce.min.js`;Sc.load(r.ownerDocument,e,()=>{b()})}}),Z(()=>{var e;o&&(null===(e=$())||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,h=e.channel),"scriptSrc"in e&&n(12,f=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),C(o,c)),o&&l!==I&&(n(17,I=l),E(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,h,f,m,p,o,v,I,_,function(e){ee[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){ee[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){ee[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class Nc extends Te{constructor(e){super(),Se(this,e,Tc,$c,$,{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 Rc(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 Nc({props:c}),ee.push(()=>Ee(n,"value",l)),{c(){t=O("div"),Ae(n.$$.fragment),i=P(),o=O("input"),U(o,"class",s=e[1]||e[2]),U(o,"id",e[3]),U(o,"name",e[3]),o.value=e[0],o.hidden=!0,z(t,"min-height","10em"),z(t,"margin-top","-1em")},m(e,r){R(e,t,r),$e(n,t,null),N(t,i),N(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],le(()=>r=!1)),n.$set(i),(!a||6&t&&s!==(s=e[1]||e[2]))&&U(o,"class",s),(!a||8&t)&&U(o,"id",e[3]),(!a||8&t)&&U(o,"name",e[3]),(!a||1&t&&o.value!==e[0])&&(o.value=e[0])},i(e){a||(we(n.$$.fragment,e),a=!0)},o(e){ye(n.$$.fragment,e),a=!1},d(e){e&&D(t),be(n)}}}function Dc(e){let t,n,r=e[6]&&Rc(e);return{c(){r&&r.c(),t=B()},m(e,i){r&&r.m(e,i),R(e,t,i),n=!0},p(e,[n]){e[6]?r?(r.p(e,n),64&n&&we(r,1)):(r=Rc(e),r.c(),we(r,1),r.m(t.parentNode,t)):r&&(pe(),ye(r,1,1,()=>{r=null}),ge())},i(e){n||(we(r),n=!0)},o(e){ye(r),n=!1},d(e){r&&r.d(e),e&&D(t)}}}function xc(e,t,r){const i=K();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:h}=t,{readonly:f}=t;const m=(e,t)=>{if(!s)return;if(!e)return;if(!e.includes("{{"))return;const n=t.employee;if(n)try{Im("employee",n).then(t=>{if(!t)return;const n=e.replace("{{employee.firstName}}",t.firstName).replace("{{employee.lastName}}",t.lastName);i("blur",{value:n})})}catch(e){}},p={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 Y(()=>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,h=e.disabled),"readonly"in e&&r(5,f=e.readonly)},e.$$.update=()=>{257&e.$$.dirty&&(a||u)&&m(a,u)},[a,l,c,d,h,f,s,p,u,function(e){a=e,r(0,a)}]}class Oc extends Te{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}",N(document.head,t)),Se(this,e,xc,Dc,$,{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