@enablerr-ui/detail 0.2.636 → 0.2.638

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 +1 @@
1
- System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,i,o,r,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Storage,n=e.Request,i=e.task_notification,o=e.currentRoles,r=e.TextArea,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.636");const f=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}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,i)=>{let[o,r]=i.split(".");if(e.list?.find((({name:e})=>e===o))&&r&&void 0!==n[o]){const e=`${o}_${r}`;n[e]=n[o][r],o=e}return t.find((e=>e===o))||t.push(o),t}),[]).map((e=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")},g=(e,t)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)??""}catch{return""}};function v(){}function y(e){return e()}function w(){return Object.create(null)}function b(e){e.forEach(y)}function k(e){return"function"==typeof e}function x(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function I(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return v;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function C(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode.removeChild(e)}function N(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function q(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function E(e){return document.createTextNode(e)}function F(){return E(" ")}function D(){return E("")}function z(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function T(e){return function(t){return t.preventDefault(),e.call(this,t)}}function A(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function B(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function O(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function V(e,t){e.value=null==t?"":t}function M(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function W(e,t,n){e.classList[n?"add":"remove"](t)}let R;function P(e){R=e}function H(){if(!R)throw new Error("Function called outside component initialization");return R}function Q(e){H().$$.on_mount.push(e)}function Y(e){H().$$.on_destroy.push(e)}function G(){const e=H();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);i.slice().forEach((t=>{t.call(e,o)}))}}}function U(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const J=[],K=[],Z=[],X=[],ee=Promise.resolve();let te=!1;function ne(){te||(te=!0,ee.then(ae))}function ie(){return ne(),ee}function oe(e){Z.push(e)}function re(e){X.push(e)}let le=!1;const se=new Set;function ae(){if(!le){le=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];P(t),ce(t.$$)}for(P(null),J.length=0;K.length;)K.pop()();for(let e=0;e<Z.length;e+=1){const t=Z[e];se.has(t)||(se.add(t),t())}Z.length=0}while(J.length);for(;X.length;)X.pop()();te=!1,le=!1,se.clear()}}function ce(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(oe)}}const de=new Set;let ue;function me(){ue={r:0,c:[],p:ue}}function fe(){ue.r||b(ue.c),ue=ue.p}function pe(e,t){e&&e.i&&(de.delete(e),e.i(t))}function $e(e,t,n,i){if(e&&e.o){if(de.has(e))return;de.add(e),ue&&ue.c.push((()=>{de.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function he(e,t){const n=t.token={};function i(e,i,o,r){if(t.token!==n)return;t.resolved=r;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=r);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==i&&e&&(me(),$e(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),fe())})):t.block.d(1),s.c(),pe(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[i]=s),a&&ae()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=H();if(e.then((e=>{P(n),i(t.then,1,t.value,e),P(null)}),(e=>{if(P(n),i(t.catch,2,t.error,e),P(null),!t.hasCatch)throw e})),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}var o}function ge(e,t,n){const i=t.slice(),{resolved:o}=e;e.current===e.then&&(i[e.value]=o),e.current===e.catch&&(i[e.error]=o),e.block.p(i,n)}const ve="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ye(e,t){$e(e,1,1,(()=>{t.delete(e.key)}))}function we(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function be(e){e&&e.c()}function ke(e,t,n,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=e.$$;o&&o.m(t,n),i||oe((()=>{const t=r.map(y).filter(k);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(oe)}function xe(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(e,t,n,i,o,r,l=[-1]){const s=R;P(e);const a=e.$$={fragment:null,ctx:null,props:r,update:v,not_equal:o,bound:w(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:w(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const r=i.length?i[0]:n;return a.ctx&&o(a.ctx[t],a.ctx[t]=r)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](r),c&&function(e,t){-1===e.$$.dirty[0]&&(J.push(e),ne(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!i&&i(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(j)}else a.fragment&&a.fragment.c();t.intro&&pe(e.$$.fragment),ke(e,t.target,t.anchor,t.customElement),ae()}P(s)}class Se{$destroy(){xe(this,1),this.$destroy=v}$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 _e(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("polyline"),o=L("line"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"points","8 12 12 16 16 12"),B(o,"x1","12"),B(o,"y1","8"),B(o,"x2","12"),B(o,"y2","16"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-arrow-down-circle "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-arrow-down-circle "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ce(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class je extends Se{constructor(e){super(),Ie(this,e,Ce,_e,x,{size:0,strokeWidth:1,class:2})}}function Ne(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),B(i,"points","22 4 12 14.01 9 11.01"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-check-circle "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-check-circle "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function qe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Le extends Se{constructor(e){super(),Ie(this,e,qe,Ne,x,{size:0,strokeWidth:1,class:2})}}function Ee(e){let t,n,i;return{c(){t=L("svg"),n=L("path"),B(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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",i="feather feather-command "+e[2])},m(e,i){C(e,t,i),_(t,n)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-command "+e[2])&&B(t,"class",i)},i:v,o:v,d(e){e&&j(t)}}}function Fe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class De extends Se{constructor(e){super(),Ie(this,e,Fe,Ee,x,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,i,o;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),B(n,"points","9 10 4 15 9 20"),B(i,"d","M20 4v7a4 4 0 0 1-4 4H4"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Te(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ae extends Se{constructor(e){super(),Ie(this,e,Te,ze,x,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("line"),o=L("line"),B(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),B(i,"x1","18"),B(i,"y1","9"),B(i,"x2","12"),B(i,"y2","15"),B(o,"x1","12"),B(o,"y1","9"),B(o,"x2","18"),B(o,"y2","15"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-delete "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Oe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ve extends Se{constructor(e){super(),Ie(this,e,Oe,Be,x,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),o=L("line"),B(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),B(i,"points","15 3 21 3 21 9"),B(o,"x1","10"),B(o,"y1","14"),B(o,"x2","21"),B(o,"y2","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-external-link "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-external-link "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function We(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Re extends Se{constructor(e){super(),Ie(this,e,We,Me,x,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("line"),o=L("path"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"x1","2"),B(i,"y1","12"),B(i,"x2","22"),B(i,"y2","12"),B(o,"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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-globe "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-globe "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function He(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Qe extends Se{constructor(e){super(),Ie(this,e,He,Pe,x,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(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"),B(i,"points","22,6 12,13 2,6"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-mail "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-mail "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ge(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ue extends Se{constructor(e){super(),Ie(this,e,Ge,Ye,x,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("circle"),B(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),B(i,"cx","12"),B(i,"cy","10"),B(i,"r","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-map-pin "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-map-pin "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ke(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ze extends Se{constructor(e){super(),Ie(this,e,Ke,Je,x,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("line"),o=L("path"),B(n,"points","23 7 23 1 17 1"),B(i,"x1","16"),B(i,"y1","8"),B(i,"x2","23"),B(i,"y2","1"),B(o,"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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-phone-outgoing "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-phone-outgoing "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function et(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class tt extends Se{constructor(e){super(),Ie(this,e,et,Xe,x,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),o=L("rect"),B(n,"points","6 9 6 2 18 2 18 9"),B(i,"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"),B(o,"x","6"),B(o,"y","14"),B(o,"width","12"),B(o,"height","8"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-printer "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-printer "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function it(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class ot extends Se{constructor(e){super(),Ie(this,e,it,nt,x,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,i,o;return{c(){t=L("svg"),n=L("circle"),i=L("line"),B(n,"cx","11"),B(n,"cy","11"),B(n,"r","8"),B(i,"x1","21"),B(i,"y1","21"),B(i,"x2","16.65"),B(i,"y2","16.65"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-search "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function lt(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class st extends Se{constructor(e){super(),Ie(this,e,lt,rt,x,{size:0,strokeWidth:1,class:2})}}const{document:at}=ve;function ct(e){e[45]=e[46].items}function dt(e,t,n){const i=e.slice();return i[47]=t[n],i[49]=n,i}function ut(e,t,n){const i=e.slice();return i[50]=t[n],i}function mt(e,t,n){const i=e.slice();return i[50]=t[n],i}function ft(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function pt(e){let t,n,i,o,r,l;ct(e);let s=e[5]?.length&&$t(e),a=e[45]?.length&&gt(e),c=e[5]?.length&&wt(e);return{c(){s&&s.c(),t=F(),n=q("div"),i=q("table"),a&&a.c(),o=F(),r=q("tbody"),c&&c.c(),B(i,"striped",""),B(i,"class","svelte-v0ogws"),B(n,"class","eList svelte-v0ogws")},m(e,d){s&&s.m(e,d),C(e,t,d),C(e,n,d),_(n,i),a&&a.m(i,null),_(i,o),_(i,r),c&&c.m(r,null),l=!0},p(e,n){ct(e),e[5]?.length?s?(s.p(e,n),32&n[0]&&pe(s,1)):(s=$t(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[45]?.length?a?a.p(e,n):(a=gt(e),a.c(),a.m(i,o)):a&&(a.d(1),a=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&pe(c,1)):(c=wt(e),c.c(),pe(c,1),c.m(r,null)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe())},i(e){l||(pe(s),pe(c),l=!0)},o(e){$e(s),$e(c),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),a&&a.d(),c&&c.d()}}}function $t(e){let t,n,i,o,r,l,s,a,c,d,u,m=e[6]&&ht(e);function f(t){e[29](t)}let p={id:e[10]};return void 0!==e[3]&&(p.value=e[3]),o=new e[8]({props:p}),K.push((()=>we(o,"value",f))),o.$on("input",e[14]),a=new Ve({props:{size:"18"}}),{c(){m&&m.c(),t=F(),n=q("div"),i=E("Suchen: "),be(o.$$.fragment),l=F(),s=q("span"),be(a.$$.fragment),B(s,"class","feather pointer svelte-v0ogws"),M(n,"margin-bottom","1em"),M(n,"position","relative")},m(r,f){m&&m.m(r,f),C(r,t,f),C(r,n,f),_(n,i),ke(o,n,null),_(n,l),_(n,s),ke(a,s,null),c=!0,d||(u=z(s,"click",e[16]),d=!0)},p(e,n){e[6]?m?64&n[0]&&pe(m,1):(m=ht(e),m.c(),pe(m,1),m.m(t.parentNode,t)):m&&(me(),$e(m,1,1,(()=>{m=null})),fe());const i={};!r&&8&n[0]&&(r=!0,i.value=e[3],re((()=>r=!1))),o.$set(i)},i(e){c||(pe(m),pe(o.$$.fragment,e),pe(a.$$.fragment,e),c=!0)},o(e){$e(m),$e(o.$$.fragment,e),$e(a.$$.fragment,e),c=!1},d(e){m&&m.d(e),e&&j(t),e&&j(n),xe(o),xe(a),d=!1,u()}}}function ht(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gt(e){let t,n,i,o=e[4]&&e[0]&&vt(),r=e[45],l=[];for(let t=0;t<r.length;t+=1)l[t]=yt(mt(e,r,t));return{c(){t=q("thead"),n=q("tr"),o&&o.c(),i=F();for(let e=0;e<l.length;e+=1)l[e].c();B(n,"class","svelte-v0ogws"),B(t,"class","svelte-v0ogws")},m(e,r){C(e,t,r),_(t,n),o&&o.m(n,null),_(n,i);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=vt(),o.c(),o.m(n,i)):o&&(o.d(1),o=null),8196&t[0]){let i;for(r=e[45],i=0;i<r.length;i+=1){const o=mt(e,r,i);l[i]?l[i].p(o,t):(l[i]=yt(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),o&&o.d(),N(l,e)}}}function vt(e){let t;return{c(){t=q("th"),B(t,"class","svelte-v0ogws")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function yt(e){let t,n,i=e[50]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,t){4&t[0]&&i!==(i=e[50]?.designation+"")&&O(n,i)},d(e){e&&j(t)}}}function wt(e){let t,n,i=[],o=new Map,r=e[5];const l=e=>e[47]._id;for(let t=0;t<r.length;t+=1){let n=dt(e,r,t),s=l(n);o.set(s,i[t]=It(s,n))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,o){for(let t=0;t<i.length;t+=1)i[t].m(e,o);C(e,t,o),n=!0},p(e,n){178239&n[0]&&(r=e[5],me(),i=function(e,t,n,i,o,r,l,s,a,c,d,u){let m=e.length,f=r.length,p=m;const $={};for(;p--;)$[e[p].key]=p;const h=[],g=new Map,v=new Map;for(p=f;p--;){const e=u(o,r,p),s=n(e);let a=l.get(s);a?i&&a.p(e,t):(a=c(s,e),a.c()),g.set(s,h[p]=a),s in $&&v.set(s,Math.abs(p-$[s]))}const y=new Set,w=new Set;function b(e){pe(e,1),e.m(s,d),l.set(e.key,e),d=e.first,f--}for(;m&&f;){const t=h[f-1],n=e[m-1],i=t.key,o=n.key;t===n?(d=t.first,m--,f--):g.has(o)?!l.has(i)||y.has(i)?b(t):w.has(o)?m--:v.get(i)>v.get(o)?(w.add(i),b(t)):(y.add(o),m--):(a(n,l),m--)}for(;m--;){const t=e[m];g.has(t.key)||a(t,l)}for(;f;)b(h[f-1]);return h}(i,n,l,1,e,r,o,t.parentNode,ye,It,t,dt),fe())},i(e){if(!n){for(let e=0;e<r.length;e+=1)pe(i[e]);n=!0}},o(e){for(let e=0;e<i.length;e+=1)$e(i[e]);n=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&j(t)}}}function bt(e){let t,n,i,o,r,l,s=e[4]&&e[0]&&kt(e),a=e[45],c=[];for(let t=0;t<a.length;t+=1)c[t]=xt(ut(e,a,t));return{c(){t=q("tr"),s&&s.c(),n=F();for(let e=0;e<c.length;e+=1)c[e].c();i=F(),B(t,"class","pointer svelte-v0ogws"),W(t,"active",e[47]._id===e[1])},m(a,d){C(a,t,d),s&&s.m(t,null),_(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);_(t,i),o=!0,r||(l=z(t,"click",A((function(){k(e[12](e[47],e[49]))&&e[12](e[47],e[49]).apply(this,arguments)}))),r=!0)},p(o,r){if((e=o)[4]&&e[0]?s?(s.p(e,r),17&r[0]&&pe(s,1)):(s=kt(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),10276&r[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=ut(e,a,n);c[n]?c[n].p(o,r):(c[n]=xt(o),c[n].c(),c[n].m(t,i))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}34&r[0]&&W(t,"active",e[47]._id===e[1])},i(e){o||(pe(s),o=!0)},o(e){$e(s),o=!1},d(e){e&&j(t),s&&s.d(),N(c,e),r=!1,l()}}}function kt(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=q("td"),be(n.$$.fragment),B(t,"class","editRow svelte-v0ogws"),M(t,"color","#326173")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",A((function(){k(e[17](e[47]))&&e[17](e[47]).apply(this,arguments)}))),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function xt(e){let t,n,i,o=e[11](e[47],e[50])+"";return{c(){t=q("td"),n=E(o),B(t,"class",i=S(e[50].type)+" svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,r){36&r[0]&&o!==(o=e[11](e[47],e[50])+"")&&O(n,o),4&r[0]&&i!==(i=S(e[50].type)+" svelte-v0ogws")&&B(t,"class",i)},d(e){e&&j(t)}}}function It(e,t){let n,i,o,r=t[15](t[47],t[45],t[3]),l=r&&bt(t);return{key:e,first:null,c(){n=D(),l&&l.c(),i=D(),this.first=n},m(e,t){C(e,n,t),l&&l.m(e,t),C(e,i,t),o=!0},p(e,n){t=e,44&n[0]&&(r=t[15](t[47],t[45],t[3])),r?l?(l.p(t,n),44&n[0]&&pe(l,1)):(l=bt(t),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe())},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(n),l&&l.d(e),e&&j(i)}}}function St(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _t(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:St,then:pt,catch:ft,value:46,blocks:[,,,]};return he(n=e[2]&&e[13](),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,4&i[0]&&n!==(n=e[2]&&e[13]())&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}const Ct=e("getDisplayItems",((e,t,n)=>{if(!e)return;let i=[];return e.forEach((e=>{if("_total"===e)return void i.push({name:"_total",designation:"Betrag",type:"number"});const[o,r]=e.split(".");let l=t.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,n=n.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e)))),l||(l=t.items.find((e=>e.name===o))),i.find((e=>e?.name===o))||i.push(l)})),i.length?i:t.items}));function jt(e,o,r){let l;let s=JSON.parse(t.getItem("Locale")).id;const a=G(),{Loading:d,TextField:m}=c,{currentTasks:p}=u;I(e,p,(e=>r(33,l=e)));let h,g,v,y,{inputList:w}=o,{eventId:b}=o,{prevEventId:k}=o,{className:x}=o,{rowId:S}=o,{filterForReady:_=!1}=o,{refStatus:C}=o,{showEdit:j=!1}=o,{praefix:N=""}=o,{selectionFields:q=!1}=o,{deList:L}=o,{stopAggregation:E=!1}=o,{inputSearch:F=""}=o,D=!0,z=F,T=x+Math.floor(9e3*Math.random()+1e3).toString()+"search",A=!1,B=!0;const O=(e,t)=>{if(!t)return;let n=e[t.name];if("number"===t.type&&Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}return"number"===t.type&&(n=Number(n)?n.toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||0,maximumFractionDigits:t.decimals||0}):""),"number"===t.type?n:"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},V=n.getSchemaByClass(x),M=async(e,t)=>{if(C)return r(18,C=[].concat(C)),e.filter((e=>!!C.find((t=>e._task.status===t))));if("Information"===t.state.task)return e;if(k){const t=await n.getEvent(k);if("report"===t?.output?.type)return e;if(t?.input?.class?.length&&t.input.class[0].name===x)return"Information"===t.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))},W=(e,t)=>{if(e){const n="string"==typeof e?e:Object.keys(e)[0],i=new Intl.Collator(s,{numeric:!0});return t.sort(((e,t)=>i.compare(e[n],t[n])))}return t},R=async e=>{let t,i=0;B=!1;const o=e=>new Promise((t=>setTimeout(t,e)));for(;i++<200&&!E&&!(t=await P(e));)await o(500);r(6,A=!1),E&&n.readTasksByAggregationId(e,!0),t&&(r(5,v=W(g.displaySort,t.data)),window.setTimeout((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),B=!0}),100))},P=async e=>await n.readTasksByAggregationId(e),H=async(e,t,n,i)=>{const{value:o,refClass:r}=i,[l,s]=n.split("."),a=o?.get(N),c=a&&await ta(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let i=e?.find((e=>e._id===n[t]))||{};i={...i};for(const e in i)n[e]&&(i[e]=n[e]);for(const e in n)n[e]&&(i[e]=n[e]);return Xs(r+i._id.toString(),i),i})):e};Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(T)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await V;e.eventId===t.id&&(na(t.class,e.eventId),r(2,D=!r(2,D=!1)))}));return e.$$set=e=>{"inputList"in e&&r(20,w=e.inputList),"eventId"in e&&r(21,b=e.eventId),"prevEventId"in e&&r(22,k=e.prevEventId),"className"in e&&r(23,x=e.className),"rowId"in e&&r(1,S=e.rowId),"filterForReady"in e&&r(24,_=e.filterForReady),"refStatus"in e&&r(18,C=e.refStatus),"showEdit"in e&&r(0,j=e.showEdit),"praefix"in e&&r(25,N=e.praefix),"selectionFields"in e&&r(26,q=e.selectionFields),"deList"in e&&r(27,L=e.deList),"stopAggregation"in e&&r(19,E=e.stopAggregation),"inputSearch"in e&&r(28,F=e.inputSearch)},[j,S,D,z,h,v,A,d,m,p,T,O,(e,t)=>n=>{r(19,E=!0);const i=B?e:y[t];a("choose",{row:i})},async()=>{g=await V,r(4,h=(e=>!l?.length||!!l.find((t=>t===e)))(g.id)),r(5,v=y=W(g.displaySort,w||await Ks(g.class,g.id))),500===v?.length&&(r(6,A=!0),n.getTasksList(g.id,!1,!0).then((({aggregationId:e})=>R(e))));let e,t=!1,i="";const o=q&&q?.find((e=>g.class===e.refClass.split(":")[0])),s=o?.value?.get&&o.value.get(N);if(s){const[l,a]=o.refClass.split(":");g.class===l&&r(5,v=await H(v,l,a,o)),t=o.parentClass?.find((e=>"quantity"===e.name)),i=o.className,e=await n.getCountedSection(i,a.split(".")[0],s,l,"quantity")}r(0,j&&=!o),o||!_&&!C||r(5,v=await M(v,g));const{display:c}=g;let d=Ct(c,g,v);return!j&&t?(d=d.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),r(5,v=v.map((t=>{const n=e.find((e=>e._id===t._id));return n&&(t.ist=n.quantity.$numberDecimal),t}))),e.map((e=>{if(!v.find((t=>t._id===e._id))){const t=y.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,v.push(t)}})),a("init",v)):L&&r(5,v=v.filter((e=>!L.find((t=>t._id===e._id))))),{items:d}},({detail:{value:e}})=>{r(3,z=e)},(e,t,n)=>{if(!n)return!0;n=n.toLowerCase();let i=!1;for(const o of t){const t=O(e,o).toLowerCase();!i&&t.includes(n)&&(i=!0)}return i},()=>{r(3,z="")},e=>{window.open(`/task/${e._task.event}/${e._task._id}/task?view=standalone`,"_blank")},C,E,w,b,k,x,_,N,q,L,F,function(e){z=e,r(3,z)}]}class Nt extends Se{constructor(e){var t;super(),at.getElementById("svelte-v0ogws-style")||((t=q("style")).id="svelte-v0ogws-style",t.textContent=".feather.svelte-v0ogws.svelte-v0ogws{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-v0ogws.svelte-v0ogws{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-v0ogws .editRow.svelte-v0ogws{width:1em}.eList.svelte-v0ogws table.svelte-v0ogws{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-v0ogws table thead.svelte-v0ogws{position:sticky;top:0;background:#326173;color:white}.eList.svelte-v0ogws table thead tr.svelte-v0ogws{height:2.3em}.eList.svelte-v0ogws table tbody tr.svelte-v0ogws{height:2.75em !important}th.svelte-v0ogws.svelte-v0ogws,td.svelte-v0ogws.svelte-v0ogws{padding-left:0.4em;padding-right:0.4em}td.number.svelte-v0ogws.svelte-v0ogws{text-align:end}tr.pointer.svelte-v0ogws.svelte-v0ogws:hover{background-color:#DAE1E5}tr.active.svelte-v0ogws.svelte-v0ogws{color:#326173;background-color:#fcebd5}",_(at.head,t)),Ie(this,e,jt,_t,x,{inputList:20,eventId:21,prevEventId:22,className:23,rowId:1,filterForReady:24,refStatus:18,showEdit:0,praefix:25,selectionFields:26,deList:27,stopAggregation:19,inputSearch:28},[-1,-1])}}function qt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Lt(e){let t,n,i=e[41]&&Et(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[41]?i?(i.p(e,n),8&n[0]&&pe(i,1)):(i=Et(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Et(e){let t,n;return t=new e[21]({props:{title:e[16]?"Auswahl":e[0],class:"eList "+(e[14]?"form":""),$$slots:{default:[Wt]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};65537&n[0]&&(i.title=e[16]?"Auswahl":e[0]),16384&n[0]&&(i.class="eList "+(e[14]?"form":"")),2097150&n[0]|2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ft(e){let t,n;return t=new oa({props:{schema:e[2],recID:e[1],readonly:e[15]}}),t.$on("choose",(function(){k(e[30](e[41]))&&e[30](e[41]).apply(this,arguments)})),t.$on("back",e[27]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};4&i[0]&&(o.schema=e[2]),2&i[0]&&(o.recID=e[1]),32768&i[0]&&(o.readonly=e[15]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Dt(e){let t,n,i,o,r,l,s;t=new e[22]({props:{text:e[16]?"Zusätzliche Auswahl":""}});const a=[Tt,zt],c=[];function d(e,t){return e[16]?0:1}return i=d(e),o=c[i]=a[i](e),l=new Nt({props:{inputSearch:e[12],eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],stopAggregation:e[20],showEdit:e[8]}}),l.$on("edit",e[31]),l.$on("choose",e[34]),l.$on("init",e[32]),{c(){be(t.$$.fragment),n=F(),o.c(),r=F(),be(l.$$.fragment)},m(e,o){ke(t,e,o),C(e,n,o),c[i].m(e,o),C(e,r,o),ke(l,e,o),s=!0},p(e,n){const s={};65536&n[0]&&(s.text=e[16]?"Zusätzliche Auswahl":""),t.$set(s);let u=i;i=d(e),i===u?c[i].p(e,n):(me(),$e(c[u],1,1,(()=>{c[u]=null})),fe(),o=c[i],o?o.p(e,n):(o=c[i]=a[i](e),o.c()),pe(o,1),o.m(r.parentNode,r));const m={};4096&n[0]&&(m.inputSearch=e[12]),4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),1048576&n[0]&&(m.stopAggregation=e[20]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(pe(t.$$.fragment,e),pe(o),pe(l.$$.fragment,e),s=!0)},o(e){$e(t.$$.fragment,e),$e(o),$e(l.$$.fragment,e),s=!1},d(e){xe(t,e),e&&j(n),c[i].d(e),e&&j(r),xe(l,e)}}}function zt(e){let t,n,i,o;n=new e[23]({props:{outline:!0,$$slots:{default:[At]},$$scope:{ctx:e}}}),n.$on("click",e[28]);let r=e[25]&&e[10]&&Bt(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),r&&r.c(),B(t,"class","form--buttons svelte-jb5mrh")},m(e,l){C(e,t,l),ke(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};2048&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[25]&&e[10]?r?(r.p(e,i),1024&i[0]&&pe(r,1)):(r=Bt(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),xe(n),r&&r.d()}}}function Tt(e){let t,n,i,o,r,l,s=e[19]&&Vt(e);return i=new e[23]({props:{outline:!0,$$slots:{default:[Mt]},$$scope:{ctx:e}}}),i.$on("click",e[28]),r=new e[22]({props:{text:"Liste aus "+e[13]}}),{c(){s&&s.c(),t=F(),n=q("div"),be(i.$$.fragment),o=F(),be(r.$$.fragment),B(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),C(e,t,a),C(e,n,a),ke(i,n,null),C(e,o,a),ke(r,e,a),l=!0},p(e,n){e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Vt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe());const o={};2048&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o);const l={};8192&n[0]&&(l.text="Liste aus "+e[13]),r.$set(l)},i(e){l||(pe(s),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),xe(i),e&&j(o),xe(r,e)}}}function At(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Bt(e){let t,n;return t=new e[23]({props:{filled:!0,$$slots:{default:[Ot]},$$scope:{ctx:e}}}),t.$on("click",e[29]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ot(e){let t;return{c(){t=E("Neu")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Vt(e){let t,n;return t=new zl({props:{item:e[17],record:{_id:"",[e[17].name]:""},noForm:"true",classId:"sel_"+e[17].name,eventId:e[18],required:!1,hidden:!1,readonly:!1,deList:e[19]}}),t.$on("notify",e[33]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};131072&n[0]&&(i.item=e[17]),131072&n[0]&&(i.record={_id:"",[e[17].name]:""}),131072&n[0]&&(i.classId="sel_"+e[17].name),262144&n[0]&&(i.eventId=e[18]),524288&n[0]&&(i.deList=e[19]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Mt(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Wt(e){let t,n,i,o;const r=[Dt,Ft],l=[];function s(e,t){return e[41].length&&!e[14]?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Rt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Pt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Rt,then:Lt,catch:qt,value:41,blocks:[,,,]};return he(n=e[26](e[3]),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,8&i[0]&&n!==(n=e[26](e[3]))&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}function Ht(e,t,i){let o;const{Dialog:r,Divider:l,Button:s}=c,a=G(),{currentTasks:d}=u;I(e,d,(e=>i(37,o=e)));let{title:m}=t,{schema:f}=t,{recID:p}=t,{isOpening:$=!0}=t,{filterForReady:h=!1}=t,{refStatus:g}=t,{praefix:v=""}=t,{selectionFields:y=!1}=t,{showEdit:w=!0}=t,{deList:b}=t,{newAllowed:k=!0}=t,{prevEventId:x}=t,{inputSearch:S}=t,_=f.id;f.class;let C,j,N,q,L,E,F,D="",z=!1,T=!1;m??=f.identity.designation;const A=!o?.length||o.find((e=>e===_));return e.$$set=e=>{"title"in e&&i(0,m=e.title),"schema"in e&&i(2,f=e.schema),"recID"in e&&i(1,p=e.recID),"isOpening"in e&&i(3,$=e.isOpening),"filterForReady"in e&&i(4,h=e.filterForReady),"refStatus"in e&&i(5,g=e.refStatus),"praefix"in e&&i(6,v=e.praefix),"selectionFields"in e&&i(7,y=e.selectionFields),"showEdit"in e&&i(8,w=e.showEdit),"deList"in e&&i(9,b=e.deList),"newAllowed"in e&&i(10,k=e.newAllowed),"prevEventId"in e&&i(11,x=e.prevEventId),"inputSearch"in e&&i(12,S=e.inputSearch)},[m,p,f,$,h,g,v,y,w,b,k,x,S,D,z,C,N,L,E,F,T,r,l,s,d,A,async e=>{if(!e)return!1;const t=await Ks(f.class,f.id);if(j=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),i(16,N=j?.value?.get&&j.value.get(v)),N){q=j.refClass;const[e,t]=q.split(":"),[o]=t.split(".");i(17,L=j.parentClass.find((t=>t.name===e)));const r=await n.getSchemaByClass(L.refClass);i(18,E=r.id),i(13,D=j.parentClass.find((e=>e.name===o)).designation)}return t},()=>{i(14,z=!1),p||a("back"),w||a("back")},()=>{i(20,T=!0),i(14,z=!1),a("back")},()=>{i(20,T=!0),i(1,p=!1),i(15,C=!1),i(14,z=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,i]=t.split(".");let o=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));if(o){e[`${n}_${i}`]=e[n][i]}})),a("choose",{row:e})},({detail:e})=>{i(15,C=!!e._task.visum||"Closed"===e._task.status),i(1,p=e._docId),i(14,z=!0)},({detail:e})=>{N&&i(19,F=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){U(e,t)}]}class Qt extends Se{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Ht,Pt,x,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11,inputSearch:12},[-1,-1])}}const{document:Yt}=ve;function Gt(e){e[27]=e[29].list,e[28]=e[29].items}function Ut(e,t,n){const i=e.slice();return i[30]=t[n],i}function Jt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Kt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Zt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Xt(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Gt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[en]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[28]?.length&&function(e){let t,n,i,o,r=e[28],l=[];for(let t=0;t<r.length;t+=1)l[t]=tn(Kt(e,r,t));return{c(){t=q("thead"),n=q("tr"),i=q("th"),o=F();for(let e=0;e<l.length;e+=1)l[e].c();B(i,"class","svelte-14hcfjl"),B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,r){C(e,t,r),_(t,n),_(n,i),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(r=e[28],i=0;i<r.length;i+=1){const o=Kt(e,r,i);l[i]?l[i].p(o,t):(l[i]=tn(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),N(l,e)}}}(e),k=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=rn(Ut(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(44547&n[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const r=Ut(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=rn(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=F(),c=q("span"),be(d.$$.fragment),u=F(),m=q("div"),f=q("table"),b&&b.c(),p=F(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Gt(e);const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[28]?.length&&b.p(e,t),e[27]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),pe(k),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),$e(k),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function en(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function tn(e){let t,n,i=e[33]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function nn(e){let t,n,i,o,r,l,s,a;i=new Re({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=on(Jt(e,c,t));return{c(){t=q("tr"),n=q("td"),be(i.$$.fragment),o=F();for(let e=0;e<d.length;e+=1)d[e].c();r=F(),B(n,"class","editRow svelte-14hcfjl"),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[30]._id===e[0])},m(c,u){C(c,t,u),_(t,n),ke(i,n,null),_(t,o);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,r),l=!0,s||(a=z(n,"click",e[15](e[30])),s=!0)},p(n,i){if(e=n,3584&i[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const o=Jt(e,c,n);d[n]?d[n].p(o,i):(d[n]=on(o),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&i[0]&&W(t,"active",e[30]._id===e[0])},i(e){l||(pe(i.$$.fragment,e),l=!0)},o(e){$e(i.$$.fragment,e),l=!1},d(e){e&&j(t),xe(i),N(d,e),s=!1,a()}}}function on(e){let t,n,i,o,r=e[9](e[30],e[33])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[30]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function rn(e){let t,n,i=e[13](e[30],e[28],e[1]),o=i&&nn(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){2&n[0]&&(i=e[13](e[30],e[28],e[1])),i?o?(o.p(e,n),2&n[0]&&pe(o,1)):(o=nn(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function ln(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sn(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:ln,then:Xt,catch:Zt,value:29,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=F(),i=D(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function an(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[sn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};3&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function cn(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{classId:p}=t,{className:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,k="",x=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(h);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&na(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(16,m=e.item),"classId"in e&&o(17,p=e.classId),"className"in e&&o(18,h=e.className),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(19,v=e.viewName),"viewValue"in e&&o(20,y=e.viewValue),"recordId"in e&&o(21,w=e.recordId),"filter"in e&&o(22,b=e.filter)},[g,k,r,l,s,a,d,u,x,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S;let t=[];if(m.lookup){const e="."+p+"#"+m.lookup,i=document.querySelector(e),o=i?.value||w;if(o){const e=await ta(m.lookup,o);if(e){const i=e[m.name]?.map((e=>e[m.name]));i&&(t=await n.getSectionView(m.name,{_id:{$in:i}},!0))}}}else{const i="."+p+"#"+v.split(":")[0],o=document.querySelector(i);let r={[v]:o?.value||w};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};r={...r,...e}}}catch{}}r[v]&&(t=await n.getSectionView(e.class,r,!0)),b&&(t=t.filter((e=>e._id!=b)))}const i=e.display;return{list:t,items:Ct(i,e,t)}},({detail:{value:e}})=>{o(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,k="")},e=>async()=>{const t=await n.getTaskByDocId(e._id),i=`/task/${t.event}/${t._id}/task?view=standalone`;window.open(i)},m,p,h,v,y,w,b,()=>r("back"),function(e){k=e,o(1,k)}]}class dn extends Se{constructor(e){var t;super(),Yt.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(Yt.head,t)),Ie(this,e,cn,an,x,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:un}=ve;function mn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function fn(e){let t,n,i=e[57]&&function(e){let t,n,i,o,l,s,a,c,d,u,m,f,p,$,h,g,v,y,w;function b(t){e[44](t)}function k(t){e[45](t)}let x={class:"full-width",id:e[27],rows:"1",required:e[1],disabled:e[3],placeholder:e[28],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[2]&&(x.value=e[2]);void 0!==e[22]&&(x.overwrite=e[22]);n=new r({props:x}),K.push((()=>we(n,"value",b))),K.push((()=>we(n,"overwrite",k))),n.$on("click",e[30]()),n.$on("onFocus",e[30](e[27]));const I=[$n,pn],N=[];function L(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(s=L(e))&&(a=N[s]=I[s](e));let E=(!e[3]||e[14])&&hn(e);function T(t){e[46](t)}let A={class:"tModal",noClickaway:!0,$$slots:{default:[wn]},$$scope:{ctx:e}};void 0!==e[16]&&(A.open=e[16]);p=new e[24]({props:A}),K.push((()=>we(p,"open",T)));let O=e[17]&&bn(e);return{c(){t=q("div"),be(n.$$.fragment),l=F(),a&&a.c(),c=F(),d=q("input"),m=F(),E&&E.c(),f=F(),be(p.$$.fragment),h=F(),O&&O.c(),g=D(),B(d,"class",u=S(e[7]||e[8])+" svelte-jox15l"),B(d,"id",e[5]),B(d,"name",e[5]),d.value=e[0],d.hidden=!0,M(t,"position","relative")},m(i,o){C(i,t,o),ke(n,t,null),_(t,l),~s&&N[s].m(t,null),_(t,c),_(t,d),_(t,m),E&&E.m(t,null),C(i,f,o),ke(p,i,o),C(i,h,o),O&&O.m(i,o),C(i,g,o),v=!0,y||(w=z(t,"keydown",e[31]),y=!0)},p(e,r){const l={};2&r[0]&&(l.required=e[1]),8&r[0]&&(l.disabled=e[3]),!i&&4&r[0]&&(i=!0,l.value=e[2],re((()=>i=!1))),!o&&4194304&r[0]&&(o=!0,l.overwrite=e[22],re((()=>o=!1))),n.$set(l);let m=s;s=L(e),s===m?~s&&N[s].p(e,r):(a&&(me(),$e(N[m],1,1,(()=>{N[m]=null})),fe()),~s?(a=N[s],a?a.p(e,r):(a=N[s]=I[s](e),a.c()),pe(a,1),a.m(t,c)):a=null),(!v||384&r[0]&&u!==(u=S(e[7]||e[8])+" svelte-jox15l"))&&B(d,"class",u),(!v||32&r[0])&&B(d,"id",e[5]),(!v||32&r[0])&&B(d,"name",e[5]),(!v||1&r[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[14]?E?(E.p(e,r),16392&r[0]&&pe(E,1)):(E=hn(e),E.c(),pe(E,1),E.m(t,null)):E&&(me(),$e(E,1,1,(()=>{E=null})),fe());const f={};3260241&r[0]|134217728&r[1]&&(f.$$scope={dirty:r,ctx:e}),!$&&65536&r[0]&&($=!0,f.open=e[16],re((()=>$=!1))),p.$set(f),e[17]?O?(O.p(e,r),131072&r[0]&&pe(O,1)):(O=bn(e),O.c(),pe(O,1),O.m(g.parentNode,g)):O&&(me(),$e(O,1,1,(()=>{O=null})),fe())},i(e){v||(pe(n.$$.fragment,e),pe(a),pe(E),pe(p.$$.fragment,e),pe(O),v=!0)},o(e){$e(n.$$.fragment,e),$e(a),$e(E),$e(p.$$.fragment,e),$e(O),v=!1},d(e){e&&j(t),xe(n),~s&&N[s].d(),E&&E.d(),e&&j(f),xe(p,e),e&&j(h),O&&O.d(e),e&&j(g),y=!1,w()}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[57]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function pn(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[36]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function $n(e){let t,n,i,o,r;return n=new st({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=[z(t,"click",e[30](!0)),z(t,"choose",e[33])],o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,b(r)}}}function hn(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[35]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function gn(e){let t,n,i,o;const r=[yn,vn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function vn(e){let t,n;return t=new Qt({props:{title:e[6].designation,newAllowed:e[20],prevEventId:e[9],schema:e[15],recID:e[0],isOpening:e[16],filterForReady:e[21],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11],inputSearch:e[32]()}}),t.$on("choose",e[33]),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.title=e[6].designation),1048576&n[0]&&(i.newAllowed=e[20]),512&n[0]&&(i.prevEventId=e[9]),32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),65536&n[0]&&(i.isOpening=e[16]),2097152&n[0]&&(i.filterForReady=e[21]),64&n[0]&&(i.refStatus=e[6].refStatus),4096&n[0]&&(i.selectionFields=e[12]),8192&n[0]&&(i.deList=e[13]),2048&n[0]&&(i.praefix=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yn(e){let t,n;return t=new dn({props:{item:e[6],className:e[15].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[33]),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.item=e[6]),32768&n[0]&&(i.className=e[15].class),256&n[0]&&(i.classId=e[8]),1&n[0]&&(i.rowId=e[0]),1024&n[0]&&(i.recordId=e[10]),16&n[0]&&(i.viewName=e[4]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function wn(e){let t,n,i=e[16]&&gn(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[16]?i?(i.p(e,n),65536&n[0]&&pe(i,1)):(i=gn(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function bn(e){let t,n,i;function o(t){e[47](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[xn]},$$scope:{ctx:e}};return void 0!==e[17]&&(r.open=e[17]),t=new e[24]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};294913&i[0]|134217728&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&131072&i[0]&&(n=!0,o.open=e[17],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function kn(e){let t,n;return t=new oa({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xn(e){let t,n;return t=new e[23]({props:{title:e[18],$$slots:{default:[kn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};262144&n[0]&&(i.title=e[18]),32769&n[0]|134217728&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function In(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Sn(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:In,then:fn,catch:mn,value:57,blocks:[,,,]};return he(e[29](),i),{c(){t=D(),i.block.c()},m(e,o){C(e,t,o),i.block.m(e,i.anchor=o),i.mount=()=>t.parentNode,i.anchor=t,n=!0},p(t,n){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(e),i.token=null,i=null}}}function _n(e,t,i){let r,l,s;I(e,o,(e=>i(43,r=e)));const a=G(),{Dialog:d,Modal:m}=c,{currentTasks:f,loggedIn:p}=u;I(e,f,(e=>i(49,l=e))),I(e,p,(e=>i(50,s=e)));let{id:$}=t,{item:g}=t,{value:v=""}=t,{desc:y=""}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:k}=t,{recordId:x}=t,{withRefValue:S=!1}=t,{refValue:_=""}=t,{required:C}=t,{disabled:j}=t,{readonly:N}=t,{praefix:q}=t,{selectionFields:L}=t,{formnovalidate:E}=t,{selection:F}=t,{deList:D}=t,{isTemplate:z}=t,{noList:T=!1}=t;const A="comment_"+$;let B,O,V,M,W,R,P=!1,H=!0,Q=!0,Y=!0;N||=x&&g.asInput,j||=N,!F&&g.selection&&1===g.selection.split(":").length&&(F=g.selection);const U=N||j||g.lookup||F&&!g.constraint?"":"Suchbegriff ⏎",J=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},K=e=>{e&&(i(2,y=h(V,e)),a("setRefDesc",y.split(" •")[0]),a("change",{value:v,description:y}),a("task",{row:e,eventId:V.id}))},Z=()=>{i(16,P=!1),i(17,B=!1)};return e.$$set=e=>{"id"in e&&i(5,$=e.id),"item"in e&&i(6,g=e.item),"value"in e&&i(0,v=e.value),"desc"in e&&i(2,y=e.desc),"noForm"in e&&i(7,w=e.noForm),"classId"in e&&i(8,b=e.classId),"eventId"in e&&i(9,k=e.eventId),"recordId"in e&&i(10,x=e.recordId),"withRefValue"in e&&i(37,S=e.withRefValue),"refValue"in e&&i(38,_=e.refValue),"required"in e&&i(1,C=e.required),"disabled"in e&&i(3,j=e.disabled),"readonly"in e&&i(39,N=e.readonly),"praefix"in e&&i(11,q=e.praefix),"selectionFields"in e&&i(12,L=e.selectionFields),"formnovalidate"in e&&i(40,E=e.formnovalidate),"selection"in e&&i(4,F=e.selection),"deList"in e&&i(13,D=e.deList),"isTemplate"in e&&i(14,z=e.isTemplate),"noList"in e&&i(41,T=e.noList)},e.$$.update=()=>{if(2&e.$$.dirty[0]|512&e.$$.dirty[1]&&i(1,C=C&&!E),192&e.$$.dirty[1]&&S&&i(0,v=_),32833&e.$$.dirty[0]|1024&e.$$.dirty[1]&&v&&V&&Promise.resolve(Zs(g.refClass,V.id,v,!!g.lookup||T)).then(K),65&e.$$.dirty[0]|6144&e.$$.dirty[1]&&v&&M&&g.name===M.input?.at(0)&&M.inputLookup?.length){const{domain:e}=M.inputLookup[0]||{};"user"===e&&(r.some((e=>M.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0))}32769&e.$$.dirty[0]&&!v&&V&&K({})},[v,C,y,j,F,$,g,w,b,k,x,q,L,D,z,V,P,B,O,W,H,Q,Y,d,m,f,p,A,U,async()=>{try{const e=await n.getEvent(k);if(R="report"===e.output.type,i(21,Q=!g.asInput),i(20,H=e.output?.class[0].name!==g.refClass),i(15,V=await n.getSchemaByClass(g.refClass)),J(V),i(19,W=(e=>!l?.length||!!l.find((t=>t===e)))(V.id)),i(42,M=await n.getSchema(k)),k&&x&&v&&!j&&M.input?.find((e=>e===g.refClass))&&i(3,j=!0),g.properties?.query?.lookup){const{domain:e,value:t}=g.properties.query.lookup;if("user"===e){const e=s.user,o={[t]:e},l=await n.getSectionView(g.refClass,o);if(l?.length){const[{_id:e}]=l;e&&(i(38,_=e),i(37,S=!0))}r.some((e=>V.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0)}}return i(18,O=V.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if(!0===e&&i(16,P=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(g.lookup||F&&!g.constraint||v)&&i(16,P=!0)},e=>{13==e.which&&(e.preventDefault(),i(16,P=!0))},()=>{if(v)return"";const e=document.getElementById(A);return e?.value||""},({detail:e})=>{i(0,v=e.row._id),Z()},Z,()=>{(R||W)&&(i(0,v=""),i(2,y=""),i(22,Y=!0),a("change",{value:v,description:y}),a("task",{row:{_task:{event:V.id,_id:!1}}}))},async()=>{if(!v)return;const e=await Zs(g.refClass,V.id,v);if(!e._task)return;const t=e._task.task_id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},S,_,N,E,T,M,r,function(e){y=e,i(2,y)},function(e){Y=e,i(22,Y)},function(e){P=e,i(16,P)},function(e){B=e,i(17,B)}]}class Cn extends Se{constructor(e){var t;super(),un.getElementById("svelte-jox15l-style")||((t=q("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(un.head,t)),Ie(this,e,_n,Sn,x,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:37,refValue:38,required:1,disabled:3,readonly:39,praefix:11,selectionFields:12,formnovalidate:40,selection:4,deList:13,isTemplate:14,noList:41},[-1,-1])}}const jn=/\d+/g,Nn=/%[HMSpPdmyY%]/g;function qn(e,t,n){const i=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(Nn);let l=0,s=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,2).toUpperCase();if("AM"===t)o=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;o=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{jn.lastIndex=l;const r=jn.exec(e);if(null==r)return n;switch(t[s]){case"H":a.setHours(parseInt(r[0])+12*o);break;case"M":a.setMinutes(r[0]);break;case"S":a.setSeconds(r[0]);break;case"d":a.setDate(r[0]);break;case"m":a.setMonth(r[0]-1);break;case"y":a.setFullYear(100*i+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}l+=r[0].length}s++}return isNaN(a.valueOf())?n:a}function Ln(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:En}=ve;function Fn(e,t,n){const i=e.slice();return i[17]=t[n],i}function Dn(e,t,n){const i=e.slice();return i[20]=t[n],i}function zn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Tn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Bn(Dn(e,p,t));const h=e=>$e($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&On(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[Mn]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[Wn]},$$scope:{ctx:e}}}),{c(){t=q("form"),n=q("input"),o=F();for(let e=0;e<$.length;e+=1)$[e].c();r=F(),g&&g.c(),l=F(),s=q("div"),be(a.$$.fragment),c=F(),be(d.$$.fragment),B(n,"class",S(e[6])+" svelte-1phofh5"),B(n,"name","_id"),B(n,"type","hidden"),n.value=i=e[1]._id||"",B(t,"class","fTask svelte-1phofh5"),B(t,"id",e[6]),B(s,"class","form--buttons svelte-1phofh5")},m(i,p){C(i,t,p),_(t,n),_(t,o);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,r),g&&g.m(t,null),C(i,l,p),C(i,s,p),ke(a,s,null),_(s,c),ke(d,s,null),u=!0,m||(f=[z(t,"keydown",e[8]),z(t,"submit",T(e[10]))],m=!0)},p(e,o){if((!u||2&o&&i!==(i=e[1]._id||""))&&(n.value=i),75&o){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const i=Dn(e,p,n);$[n]?($[n].p(i,o),pe($[n],1)):($[n]=Bn(i),$[n].c(),pe($[n],1),$[n].m(t,r))}for(me(),n=p.length;n<$.length;n+=1)h(n);fe()}e[0].list?g?(g.p(e,o),1&o&&pe(g,1)):(g=On(e),g.c(),pe(g,1),g.m(t,null)):g&&(me(),$e(g,1,1,(()=>{g=null})),fe());const l={};8388608&o&&(l.$$scope={dirty:o,ctx:e}),a.$set(l);const s={};4&o&&(s.disabled=e[2]),8388608&o&&(s.$$scope={dirty:o,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)pe($[e]);pe(g),pe(a.$$.fragment,e),pe(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)$e($[e]);$e(g),$e(a.$$.fragment,e),$e(d.$$.fragment,e),u=!1},d(e){e&&j(t),N($,e),g&&g.d(),e&&j(l),e&&j(s),xe(a),xe(d),m=!1,b(f)}}}function An(e){let t,n;return t=new zl({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.item=e[20]),1&n&&(i.selection=e[20].selection),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),1&n&&(i.eventId=e[0].id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Bn(e){let t,n,i=Hn(!0,e[20]),o=i&&An(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){1&n&&(i=Hn(!0,e[20])),i?o?(o.p(e,n),1&n&&pe(o,1)):(o=An(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function On(e){let t,n,i=e[0].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Vn(Fn(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(75&n){let l;for(i=e[0].list,l=0;l<i.length;l+=1){const r=Fn(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Vn(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Vn(e){let t,n,i,o;return t=new e[4]({props:{text:e[17].designation}}),i=new ii({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=F(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};1&n&&(o.text=e[17].designation),t.$set(o);const r={};1&n&&(r.list=e[17]),1&n&&(r.eventId=e[0].id),1&n&&(r.schema=e[17].item),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function Mn(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Wn(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Rn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Pn(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Rn,then:Tn,catch:zn,value:16,blocks:[,,,]};return he(e[7](),o),{c(){t=F(),n=q("section"),o.block.c(),En.title="Vorgaben",B(n,"class","sTask svelte-1phofh5")},m(e,r){C(e,t,r),C(e,n,r),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,i=!0},p(t,[n]){ge(o,e=t,n)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),e&&j(n),o.block.d(),o.token=null,o=null}}}const Hn=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Qn(e,i,r){let a,d,u;I(e,s,(e=>r(11,d=e))),I(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(t.getItem("Locale"));let{schema:h}=i,{record:g}=i,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const w=()=>window.history.back(),b=(e,t,n=!1)=>{const i=t.id,o=e.find((e=>e.name===i));let r=t.value;if(!n&&o&&o.properties?.multi&&(r=g[i]),r&&o&&o.type.startsWith("date"))try{return qn(r,"%d.%m.%Y").toISOString()}catch{return new Date(r).toISOString()}if(o&&"boolean"===o.type&&(r=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{r=Number(r.replace(e,".")).toString()}catch{}}return r};return e.$$set=e=>{"schema"in e&&r(0,h=e.schema),"record"in e&&r(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&r(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await n.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&r(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));r(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},w,async e=>{const t={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const n=e.id||e.name;if(n)if(n.includes(".")){const[i,o]=n.split("."),r=h.list.find((e=>e.name===i));t[n]=b(r.item,e)}else t[n]=b(h.items,e)})),await n.saveTemplate(h.class,t),l.success("Die Vorgaben wurden gespeichert.",2e3),w()}]}const{document:Yn}=ve;function Gn(e,t,n){const i=e.slice();return i[28]=t[n],i}function Un(e){let t,n;return t=new zl({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(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),2&n[0]&&(i.item=e[28]),2&n[0]&&(i.listName=e[1].name),8&n[0]&&(i.eventId=e[3]),1&n[0]&&(i.record=e[0]),16&n[0]&&(i.disabled=e[4]),32&n[0]&&(i.required=e[5]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Jn(e){let t,n,i=Hn(e[7],e[28]),o=i&&Un(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){130&n[0]&&(i=Hn(e[7],e[28])),i?o?(o.p(e,n),130&n[0]&&pe(o,1)):(o=Un(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function Kn(e){let t,n,i,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Jn(Gn(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));return{c(){t=q("div");for(let e=0;e<r.length;e+=1)r[e].c();B(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){C(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,s){if(82367&s[0]){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const i=Gn(e,o,n);r[n]?(r[n].p(i,s),pe(r[n],1)):(r[n]=Jn(i),r[n].c(),pe(r[n],1),r[n].m(t,null))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}(!i||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&B(t,"id",n)},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);i=!1},d(e){e&&j(t),N(r,e)}}}function Zn(e){let t,n,i=e[13](e[9])+"";return{c(){t=q("span"),n=E(i)},m(e,i){C(e,t,i),_(t,n)},p(e,t){512&t[0]&&i!==(i=e[13](e[9])+"")&&O(n,i)},d(e){e&&j(t)}}}function Xn(e){let t,n,i;return n=new e[10]({props:{$$slots:{default:[Zn]},$$scope:{ctx:e}}}),n.$on("click",(function(){k(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","accordion svelte-148ktt9"),B(t,"slot","handle")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(t,i){e=t;const o={};512&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function ei(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Xn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Kn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.open=e[6]),134218687&n[0]|1&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ti(e){let t,n,i;return n=new e[11]({props:{$$slots:{default:[ei]},$$scope:{ctx:e}}}),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","formList")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};1023&t[0]|1&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function ni(e,t,i){const{Button:o,Accordion:r,AccordionSection:l}=c;let{list:s}=t,{schema:a}=t,{record:d}=t,{classId:u}=t,{eventId:m}=t,{disabled:h}=t,{required:g}=t,{open:v=!1}=t,{template:y={}}=t,{isTemplate:w=!1}=t,{currency:b}=t,{update:k=!1}=t,x=new Map;const I={};let S=d[s.name]||{};d[s.name]=S;const _=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),C=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&i(1,s=e.list),"schema"in e&&i(18,a=e.schema),"record"in e&&i(0,d=e.record),"classId"in e&&i(2,u=e.classId),"eventId"in e&&i(3,m=e.eventId),"disabled"in e&&i(4,h=e.disabled),"required"in e&&i(5,g=e.required),"open"in e&&i(6,v=e.open),"template"in e&&i(19,y=e.template),"isTemplate"in e&&i(7,w=e.isTemplate),"currency"in e&&i(8,b=e.currency),"update"in e&&i(20,k=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&k&&d&&i(9,S=d[s.name]||{})},[d,s,u,m,h,g,v,w,b,S,o,r,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format)).map((t=>"object"===t.type?_(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(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&&(I[n]=e.desc);const o=d[t];i(0,d[t]={...o,[n]:e.value},d),i(9,S=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&i(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,o=document.querySelector(n);ie().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(C)})).then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:t,value:i}})=>{if(x.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===className+"."+s.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&x.set(e,r[0])},()=>{setTimeout((()=>{Array.from(x).forEach((([e,t])=>{d[s.name][e]||i(0,d[s.name][e]=t._id,d)}))}),500)},a,y,k,function(t){U(e,t)}]}class ii extends Se{constructor(e){var t;super(),Yn.getElementById("svelte-148ktt9-style")||((t=q("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}}",_(Yn.head,t)),Ie(this,e,ni,ti,x,{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:oi}=ve;function ri(e){e[0]=e[23].list,e[22]=e[23].items}function li(e,t,n){const i=e.slice();return i[24]=t[n],i}function si(e,t,n){const i=e.slice();return i[27]=t[n],i}function ai(e,t,n){const i=e.slice();return i[27]=t[n],i}function ci(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function di(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}ri(e),n=new e[7]({props:{outline:!0,$$slots:{default:[ui]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[22]?.length&&function(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=mi(ai(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[22],r=0;r<i.length;r+=1){const l=ai(e,i,r);o[r]?o[r].p(l,t):(o[r]=mi(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}(e),k=e[0]?.length&&function(e){let t,n=e[0],i=[];for(let t=0;t<n.length;t+=1)i[t]=$i(li(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11778&o[0]){let r;for(n=e[0],r=0;r<n.length;r+=1){const l=li(e,n,r);i[r]?i[r].p(l,o):(i[r]=$i(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){N(i,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=F(),c=q("span"),be(d.$$.fragment),u=F(),m=q("div"),f=q("table"),b&&b.c(),p=F(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){ri(e);const i={};2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[22]?.length&&b.p(e,t),e[0]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function ui(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function mi(e){let t,n,i=e[27]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function fi(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=pi(si(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=F(),B(t,"class","pointer svelte-14hcfjl")},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[22],l=0;l<i.length;l+=1){const s=si(e,i,l);o[l]?o[l].p(s,r):(o[l]=pi(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}function pi(e){let t,n,i,o,r=e[9](e[24],e[27])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[24]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function $i(e){let t,n=e[13](e[24],e[22],e[1]),i=n&&fi(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[24],e[22],e[1])),n?i?i.p(e,o):(i=fi(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function hi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gi(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:hi,then:di,catch:ci,value:23,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=F(),i=D(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function vi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[gi]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2&n[0]|2&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yi(e,t,i){const o=G(),{Dialog:r,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=t,{className:m}=t,{classId:p}=t,{list:h}=t,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},w=n.getSchemaByClass(m);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&i(15,u=e.item),"className"in e&&i(16,m=e.className),"classId"in e&&i(17,p=e.classId),"list"in e&&i(0,h=e.list)},[h,g,o,r,l,s,a,d,v,y,e=>()=>o("choose",{row:e}),async()=>{const e=await w,t=e.display;let n=Ct(t,e,h);return{list:h,items:n}},({detail:{value:e}})=>{i(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(y(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,g="")},u,m,p,()=>o("back"),function(e){g=e,i(1,g)}]}class wi extends Se{constructor(e){var t;super(),oi.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(oi.head,t)),Ie(this,e,yi,vi,x,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:bi}=ve;function ki(e,t,n){const i=e.slice();return i[11]=t[n],i}function xi(e,t,n){const i=e.slice();return i[3]=t[n],i}function Ii(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Si(e){let t,n,i,o=e[7].items,r=[];for(let t=0;t<o.length;t+=1)r[t]=qi(xi(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));let s=e[7].list&&Li(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F(),s&&s.c(),n=D()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);C(e,t,o),s&&s.m(e,o),C(e,n,o),i=!0},p(e,i){if(5161959&i[0]){let n;for(o=e[7].items,n=0;n<o.length;n+=1){const l=xi(e,o,n);r[n]?(r[n].p(l,i),pe(r[n],1)):(r[n]=qi(l),r[n].c(),pe(r[n],1),r[n].m(t.parentNode,t))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}e[7].list?s?(s.p(e,i),128&i[0]&&pe(s,1)):(s=Li(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);pe(s),i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);$e(s),i=!1},d(e){N(r,e),e&&j(t),s&&s.d(e),e&&j(n)}}}function _i(e){let t,n,i,o;const r=[ji,Ci],l=[];function s(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Ci(e){let t,n;return t=new zl({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(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};256&n[0]&&(i.classId=e[8]),128&n[0]&&(i.item=e[3]),64&n[0]&&(i.record=e[6]),129&n[0]&&(i.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(i.eventId=e[5]),4&n[0]&&(i.currency=e[2]),512&n[0]&&(i.changeValue=e[9]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ji(e){let t,n,i,o;n=new zl({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]);let r=e[1]&&Ni(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),r&&r.c(),M(t,"padding-top",".25em"),M(t,"background-color","lightyellow"),M(t,"position","relative")},m(e,l){C(e,t,l),ke(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};256&i[0]&&(o.classId=e[8]),128&i[0]&&(o.item=e[3]),64&i[0]&&(o.record=e[6]),3&i[0]&&(o.disabled=e[0]||!!e[1]),32&i[0]&&(o.eventId=e[5]),4&i[0]&&(o.currency=e[2]),512&i[0]&&(o.changeValue=e[9]),n.$set(o),e[1]?r?(r.p(e,i),2&i[0]&&pe(r,1)):(r=Ni(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),xe(n),r&&r.d()}}}function Ni(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[22]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function qi(e){let t,n,i="list"!==e[3].type&&_i(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[3].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=_i(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Li(e){let t,n,i=e[7].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Fi(ki(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(485&n[0]){let l;for(i=e[7].list,l=0;l<i.length;l+=1){const r=ki(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Fi(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Ei(e){let t,n,i,o;return t=new e[12]({props:{text:e[11].designation}}),i=new ii({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(){be(t.$$.fragment),n=F(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};128&n[0]&&(o.text=e[11].designation),t.$set(o);const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.list=e[11]),32&n[0]&&(r.eventId=e[5]),128&n[0]&&(r.schema=e[11].item),64&n[0]&&(r.record=e[6]),1&n[0]&&(r.disabled=e[0]),4&n[0]&&(r.currency=e[2]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function Fi(e){let t,n,i="array"!==e[11].type&&Ei(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"array"!==e[11].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Ei(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Di(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function zi(e){let t,n;return t=new wi({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8&n[0]&&(i.item=e[3]),16&n[0]&&(i.className=e[4]),256&n[0]&&(i.classId=e[8]),2048&n[0]&&(i.list=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ti(e){let t,n,i=e[10]&&zi(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[10]?i?(i.p(e,n),1024&n[0]&&pe(i,1)):(i=zi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ai(e){let t,n,i,o,r,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Di,then:Si,catch:Ii,value:52,blocks:[,,,]};function a(t){e[28](t)}he(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Ti]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),o=new e[13]({props:c}),K.push((()=>we(o,"open",a))),{c(){s.block.c(),t=F(),be(n.$$.fragment),i=F(),be(o.$$.fragment)},m(e,r){s.block.m(e,s.anchor=r),s.mount=()=>t.parentNode,s.anchor=t,C(e,t,r),ke(n,e,r),C(e,i,r),ke(o,e,r),l=!0},p(t,n){ge(s,e=t,n);const i={};3352&n[0]|67108864&n[1]&&(i.$$scope={dirty:n,ctx:e}),!r&&1024&n[0]&&(r=!0,i.open=e[10],re((()=>r=!1))),o.$set(i)},i(e){l||(pe(s.block),pe(n.$$.fragment,e),pe(o.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){$e(s.blocks[e])}$e(n.$$.fragment,e),$e(o.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&j(t),xe(n,e),e&&j(i),xe(o,e)}}}function Bi(e,t,i){const{Divider:o,FormField:r,Modal:l}=c,s=G();let a,d,u,m,f,{required:p}=t,{disabled:$}=t,{readonly:h}=t,{id:g}=t,{item:v}=t,{value:y}=t,{refValue:w}=t,{currency:b}=t,k={},x=[],I=[],S={},_=new Map,C=!1,j="";const N=v.checkOn,q=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");x.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))},E=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},F=async e=>{const t=x.filter((t=>t.refObj===e));if(t?.length){i(9,S={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:l}=e;if(!n)break;let s,a,c=!o&&k[n];const u=k[n];u&&o&&(c=(await ta(n,u))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&i(9,S[t]="",S))}}};Q((()=>{D()}));const D=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 x)e.add(t.refObj||u);Array.from(e).forEach((e=>F(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(_).forEach((([e,t])=>{k[e]||i(6,k[e]=t._id,k)}))}),250)},T=async e=>{if(!e.value)return void B();const t={[e.itemName]:{$regex:`(?i)${e.value}`}},o=await n.getSectionView(u,t);o?.length?(i(11,j=o),i(10,C=!0)):(i(1,y=""),i(23,w=""),s("setRefValue",w))},A=()=>{i(10,C=!1)},B=()=>{i(1,y=""),i(23,w=y),i(6,k={}),s("setRefValue",w)};return e.$$set=e=>{"required"in e&&i(24,p=e.required),"disabled"in e&&i(0,$=e.disabled),"readonly"in e&&i(25,h=e.readonly),"id"in e&&i(26,g=e.id),"item"in e&&i(3,v=e.item),"value"in e&&i(1,y=e.value),"refValue"in e&&i(23,w=e.refValue),"currency"in e&&i(2,b=e.currency)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&i(0,$=$||h),134217840&e.$$.dirty[0]&&k&&s("safeReference",{record:k,class:u,event:m,taskId:f})},[$,y,b,v,u,m,k,a,d,S,C,j,o,l,N,q,async()=>{try{if(y){const e=await n.getTask(v.refClass,y);delete e._task,i(6,k=e),i(27,f=(await n.getTaskByDocId(e._id))._id)}else i(6,k={})}catch{}return i(7,a=await n.getSchemaByClass(v.refClass)),i(8,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),i(4,u=a.class),a.identity.designation,i(5,m=a.id),["readonly","hidden","required"].map(L),E(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(i(6,k[t]=n,k),t===N)return T(e);F(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:t,lookup:o,view:r}=e,[l]=o.split(":"),s=(await n.getSectionView(l,{[r]:{$in:t}})).map((e=>e._id));for(const e of a.input.slice(1)){i(6,k[e]=[],k);const t=await n.getSchemaByClass(e);t.id;let o=await n.getTasks(t.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),o?.length){const t=o.map((e=>e._id)),r=await n.getSectionView(e,{_id:{$in:t}});for(const t of r)t[e]=t._id;i(6,k[e]=r,k)}}},async({detail:{className:e,itemName:t,value:i}})=>{if(_.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===u))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&_.set(e,r[0])},async({detail:e})=>{const t=await n.getSectionView(u,{_id:e.row._id});t?.length&&(i(1,y=t[0]._id),i(23,w=y),s("setRefValue",w),i(6,k=t[0])),A()},A,B,w,p,h,g,f,function(e){C=e,i(10,C)}]}class Oi extends Se{constructor(e){var t;super(),bi.getElementById("svelte-16mo2c-style")||((t=q("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(bi.head,t)),Ie(this,e,Bi,Ai,x,{required:24,disabled:0,readonly:25,id:26,item:3,value:1,refValue:23,currency:2},[-1,-1])}}function Vi(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=q("span"),n=E(e[4]),B(t,"class","item")},m(e,i){C(e,t,i),_(t,n)},p(e,t){16&t[0]&&O(n,e[4])},d(e){e&&j(t)}}}(e);return{c(){n&&n.c(),t=D()},m(e,i){n&&n.m(e,i),C(e,t,i)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&j(t)}}}function Mi(e){let t,n,i;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[Vi]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=q("div"),be(n.$$.fragment),M(t,"position","relative"),M(t,"max-width","10em")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};6&t[0]&&(i.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(i.id=e[0]),1&t[0]&&(i.name=e[0]),256&t[0]&&(i.value=e[8]),64&t[0]&&(i.pattern=e[6]),128&t[0]&&(i.readonly=e[7]),8&t[0]&&(i.disabled=e[3]),32&t[0]&&(i.required=e[5]),16&t[0]|2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Wi(e,n,i){let o;const r=G(),{TextField:l}=c;let{id:s}=n,{item:a}=n,{value:d}=n,{noForm:u=!1}=n,{classId:m}=n,{disabled:f}=n,{formnovalidate:p}=n,{currency:$}=n,{praefix:h}=n,{notifyList:g}=n;const v=JSON.parse(t.getItem("Locale")),y=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),w=Number("1.1").toLocaleString(v.id).substring(1,2),{properties:b={}}=a;let{min:k,max:x,step:I,pattern:S,decimals:_=0,unit:C="",placeholder:j,hint:N,readonly:q,negative:L,required:E=!1}=b;q=!0===q||void 0;S||(S=_?`[0-9]+([${w}][0-9]{1,${_}})?`:"[0-9]*"),L&&(S="-?"+S);return e.$$set=e=>{"id"in e&&i(0,s=e.id),"item"in e&&i(16,a=e.item),"value"in e&&i(17,d=e.value),"noForm"in e&&i(1,u=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,f=e.disabled),"formnovalidate"in e&&i(18,p=e.formnovalidate),"currency"in e&&i(4,$=e.currency),"praefix"in e&&i(19,h=e.praefix),"notifyList"in e&&i(20,g=e.notifyList)},e.$$.update=()=>{262176&e.$$.dirty[0]&&i(5,E=E&&!p),131072&e.$$.dirty[0]&&i(8,o=Number(d.toString().replace(w,".")).toFixed(_).toString().replace(".",w)),1048576&e.$$.dirty[0]&&(async e=>{if(void 0===h)return;const t=a.properties?.value?.formula;"$multiply"===t?.operator&&r("formula",{item:a})})()},[s,u,m,f,$,E,S,q,o,l,v,y,I,j,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{q||Number(d.toString().replace(w,"."))||i(8,o="")},a,d,p,h,g]}class Ri extends Se{constructor(e){super(),Ie(this,e,Wi,Mi,x,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4,praefix:19,notifyList:20},[-1,-1])}}const{document:Pi}=ve;function Hi(e){e[33]=e[35].list,e[34]=e[35].items}function Qi(e,t,n){const i=e.slice();return i[36]=t[n],i[38]=n,i}function Yi(e,t,n){const i=e.slice();return i[39]=t[n],i[41]=n,i}function Gi(e,t,n){const i=e.slice();return i[39]=t[n],i}function Ui(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ji(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Hi(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Ki]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let w=!e[1]&&Zi(e);function b(t){e[31](t)}let k={id:e[11]};void 0!==e[2]&&(k.value=e[2]),s=new e[6]({props:k}),K.push((()=>we(s,"value",b))),s.$on("input",e[14]),u=new Ve({props:{size:"18"}});let x=e[34]?.length&&function(e){let t,n,i,o,r=!e[1]&&eo(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=to(Gi(e,l,t));return{c(){t=q("thead"),n=q("tr"),r&&r.c(),i=F();for(let e=0;e<s.length;e+=1)s[e].c();B(n,"class","svelte-1m010ne"),B(t,"class","svelte-1m010ne")},m(e,l){C(e,t,l),_(t,n),r&&r.m(n,null),_(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null);o=!0},p(e,t){if(e[1]?r&&(me(),$e(r,1,1,(()=>{r=null})),fe()):r?(r.p(e,t),2&t[0]&&pe(r,1)):(r=eo(e),r.c(),pe(r,1),r.m(n,i)),8192&t[0]){let i;for(l=e[34],i=0;i<l.length;i+=1){const o=Gi(e,l,i);s[i]?s[i].p(o,t):(s[i]=to(o),s[i].c(),s[i].m(n,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=l.length}},i(e){o||(pe(r),o=!0)},o(e){$e(r),o=!1},d(e){e&&j(t),r&&r.d(),N(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=lo(Qi(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(569359&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=Qi(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=lo(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),w&&w.c(),o=F(),r=q("div"),l=E("Suchen: "),be(s.$$.fragment),c=F(),d=q("span"),be(u.$$.fragment),m=F(),f=q("div"),p=q("table"),x&&x.c(),$=F(),h=q("tbody"),I&&I.c(),B(t,"class","form--buttons svelte-1m010ne"),B(d,"class","feather pointer svelte-1m010ne"),M(r,"margin-bottom","1em"),M(r,"position","relative"),B(p,"striped",""),B(p,"class","svelte-1m010ne"),B(f,"class","eList svelte-1m010ne")},m(a,b){C(a,t,b),ke(n,t,null),_(t,i),w&&w.m(t,null),C(a,o,b),C(a,r,b),_(r,l),ke(s,r,null),_(r,c),_(r,d),ke(u,d,null),C(a,m,b),C(a,f,b),_(f,p),x&&x.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=z(d,"click",e[16]),v=!0)},p(e,i){Hi(e);const o={};8192&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[1]?w&&(me(),$e(w,1,1,(()=>{w=null})),fe()):w?(w.p(e,i),2&i[0]&&pe(w,1)):(w=Zi(e),w.c(),pe(w,1),w.m(t,null));const r={};!a&&4&i[0]&&(a=!0,r.value=e[2],re((()=>a=!1))),s.$set(r),e[34]?.length&&x.p(e,i),e[33]?.length&&I.p(e,i)},i(e){g||(pe(n.$$.fragment,e),pe(w),pe(s.$$.fragment,e),pe(u.$$.fragment,e),pe(x),pe(I),g=!0)},o(e){$e(n.$$.fragment,e),$e(w),$e(s.$$.fragment,e),$e(u.$$.fragment,e),$e(x),$e(I),g=!1},d(e){e&&j(t),xe(n),w&&w.d(),e&&j(o),e&&j(r),xe(s),xe(u),e&&j(m),e&&j(f),x&&x.d(),I&&I.d(),v=!1,y()}}}function Ki(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Zi(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Xi]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Xi(e){let t;return{c(){t=E("Bestätigen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function eo(e){let t,n,i,o,r;return n=new Le({props:{size:"20"}}),{c(){t=q("th"),be(n.$$.fragment),B(t,"class","svelte-1m010ne")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[18](e[33])),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function to(e){let t,n,i=e[39]+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function no(e){let t,n,i,o,r,l,s,a=e[0],c=oo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=ro(Yi(e,d,t));return{c(){t=q("tr"),c.c(),n=F();for(let e=0;e<u.length;e+=1)u[e].c();i=F(),B(t,"style",o=e[1]?"cursor: default;":"cursor: zoom-in;"),B(t,"title","übernimmt den Wert direkt"),B(t,"class","svelte-1m010ne"),W(t,"active",e[0].includes(e[36]))},m(o,a){C(o,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,i),r=!0,l||(s=z(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&x(a,a=e[0])?(me(),$e(c,1,1,v),fe(),c=oo(e),c.c(),pe(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const o=Yi(e,d,n);u[n]?u[n].p(o,s):(u[n]=ro(o),u[n].c(),u[n].m(t,i))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!r||2&s[0]&&o!==(o=e[1]?"cursor: default;":"cursor: zoom-in;"))&&B(t,"style",o),8193&s[0]&&W(t,"active",e[0].includes(e[36]))},i(e){r||(pe(c),r=!0)},o(e){$e(c),r=!1},d(e){e&&j(t),c.d(e),N(u,e),l=!1,s()}}}function io(e){let t,n,i;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=q("td"),be(n.$$.fragment),B(t,"title","Wählt den Wert aus"),B(t,"class","svelte-1m010ne")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};1&t[0]&&(i.checked=e[0].includes(e[36])),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function oo(e){let t,n,i=!e[1]&&io(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[1]?i&&(me(),$e(i,1,1,(()=>{i=null})),fe()):i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=io(e),i.c(),pe(i,1),i.m(t.parentNode,t))},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ro(e){let t,n,i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=q("td"),n=E(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p(e,t){8&t[0]&&i!==(i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&O(n,i)},d(e){e&&j(t)}}}function lo(e){let t,n,i=e[15](e[36],e[2]),o=i&&no(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){4&n[0]&&(i=e[15](e[36],e[2])),i?o?(o.p(e,n),4&n[0]&&pe(o,1)):(o=no(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function so(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ao(e){let t,n,i,o;t=new e[9]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:so,then:Ji,catch:Ui,value:35,blocks:[,,,]};return he(e[13](),r),{c(){be(t.$$.fragment),n=F(),i=D(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function co(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ao]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};15&n[0]|8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function uo(e,t,i){const o=G(),{Loading:r,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=t,{id:f}=t,{selection:p}=t,{refDoc:$}=t,{tableName:h}=t,{idName:g}=t,{target:v}=t,{view:y}=t,{unique:w}=t,{uniqueView:b}=t,{status:k}=t,{single:x}=t;p||=[];let I="",S=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",_=[];const C=h+g+v+"checkbox",j=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&i(21,m=e.classId),"id"in e&&i(22,f=e.id),"selection"in e&&i(0,p=e.selection),"refDoc"in e&&i(23,$=e.refDoc),"tableName"in e&&i(24,h=e.tableName),"idName"in e&&i(25,g=e.idName),"target"in e&&i(20,v=e.target),"view"in e&&i(26,y=e.view),"unique"in e&&i(27,w=e.unique),"uniqueView"in e&&i(28,b=e.uniqueView),"status"in e&&i(29,k=e.status),"single"in e&&i(1,x=e.single)},[p,x,I,_,o,r,l,s,a,d,u,S,C,async()=>{let e=[],t=[],o={};if(i(3,_=[]),g)if(y){if(f){const t=m.split("-")[1].slice(0,-4),i="input."+m+"[name='_id']",r=document.querySelector(i).value;o={[g]:f},k&&(o.$or=[{status:!0},{[t]:r}]),e=await n.getSectionView(h,o),e=e.sort(((e,n)=>{const i=e=>(e[t]||"z").toString()+e[v];return j(i(e),i(n))}))}}else b?f&&(o={[g]:f,status:!0},Object.entries(b).map((([e,n])=>{n?.length&&(o[e]={$in:n}),t.push(e)})),e=await n.getSectionView(h,o),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})),i(3,_=e.map((e=>{const n=[e[v]];return t.map((t=>n.push(e[t]))),n})))):w?(e=await n.getSection(h,g,f,w),e=e.sort(((e,t)=>j(e,t)))):(e=await n.getSection(h,g,f,!1,k),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})));else o={},f&&!Array.isArray(f)&&(o._id=f),e=await n.getSectionView(h,o);const r=await n.getSchemaByClass(h),l=[];if($){const t=r.items[0].name,n=r.items[1].name,o=r.list[0].name,l=e.find((e=>e[t]===$));l&&(e=l[o]),i(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(i(20,v=r.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(", ")),l.push(t||[])}else l.push(t||[])}));const s=r.items.find((e=>e.name===v))?.designation;return t=t.map((e=>r.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...t]}},({detail:{value:e}})=>{i(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{i(2,I="")},e=>()=>{const t=document.getElementsByName(C),n=[];t.forEach(((t,i)=>{t.checked&&n.push(e[+t.attributes.data.value])})),o("choose",{list:n})},e=>()=>{document.getElementsByName(C).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(x?o("choose",{list:[].concat(e)}):(i(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),o("choose",{list:p})))},v,m,f,$,h,g,y,w,b,k,()=>o("back"),function(e){I=e,i(2,I)}]}class mo extends Se{constructor(e){var t;super(),Pi.getElementById("svelte-1m010ne-style")||((t=q("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}",_(Pi.head,t)),Ie(this,e,uo,co,x,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:fo}=ve;function po(e){let t,n,i,o,r,l=e[7].length+"";return{c(){t=q("span"),n=E("("),i=E(l),o=E(")"),B(t,"class",r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&O(i,l),2&n[0]&&r!==(r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&B(t,"class",r)},d(e){e&&j(t)}}}function $o(e){let t;return{c(){t=q("div"),B(t,"class","load-more-options"),B(t,"slot","load-more-options-message")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ho(e){let t,n,i,o;const r=[yo,vo,go],l=[];function s(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=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function go(e){let t,n,i,o,r;return n=new je({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title","Übernehmen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[26]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function vo(e){let t,n,i,o,r;return n=new De({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title",e[17].title||"Generieren"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[25]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function yo(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title","Löschen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[27]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function wo(e){let t,n,i;function o(t){e[37](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[bo]},$$scope:{ctx:e}};return void 0!==e[10]&&(r.open=e[10]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};53&i[0]|32768&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&1024&i[0]&&(n=!0,o.open=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function bo(e){let t,n;return t=new mo({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],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),1&n[0]&&(i.selection=e[0]),16&n[0]&&(i.unique=e[16].unique&&e[4].name),32&n[0]&&(i.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(i.id=e[5][e[21]||e[20]]),16&n[0]&&(i.target=e[4].name),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ko(e){let t,n,i,o,r,l,s,a,c,d=!e[16].single&&e[7].length&&po(e);function u(t){e[35](t)}function m(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:xo,minSearchLength:"3",$$slots:{"load-more-options-message":[$o]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),i=new e[12]({props:f}),K.push((()=>we(i,"selection",u))),K.push((()=>we(i,"maxOptions",m))),i.$on("change",e[22]);let p=!e[1]&&ho(e),$=e[10]&&wo(e);return{c(){t=q("div"),d&&d.c(),n=F(),be(i.$$.fragment),l=F(),p&&p.c(),s=F(),$&&$.c(),a=D(),M(t,"position","relative")},m(e,o){C(e,t,o),d&&d.m(t,null),_(t,n),ke(i,t,null),_(t,l),p&&p.m(t,null),C(e,s,o),$&&$.m(e,o),C(e,a,o),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=po(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!o&&128&l[0]&&(o=!0,s.selection=e[7],re((()=>o=!1))),!r&&512&l[0]&&(r=!0,s.maxOptions=e[9],re((()=>r=!1))),i.$set(s),e[1]?p&&(me(),$e(p,1,1,(()=>{p=null})),fe()):p?(p.p(e,l),2&l[0]&&pe(p,1)):(p=ho(e),p.c(),pe(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&pe($,1)):($=wo(e),$.c(),pe($,1),$.m(a.parentNode,a)):$&&(me(),$e($,1,1,(()=>{$=null})),fe())},i(e){c||(pe(i.$$.fragment,e),pe(p),pe($),c=!0)},o(e){$e(i.$$.fragment,e),$e(p),$e($),c=!1},d(e){e&&j(t),d&&d.d(),xe(i),p&&p.d(),e&&j(s),$&&$.d(e),e&&j(a)}}}async function*xo(e){yield[{name:e}]}function Io(e,t,i){const o=G(),{Modal:r,Autocomplete:l}=c;let{classId:s}=t,{id:a}=t,{item:d}=t,{record:u}=t,{value:m}=t,{noForm:f=!1}=t,{disabled:p}=t,{formnovalidate:$}=t,{numberInput:h}=t,{praefix:g}=t,{toDelete:v}=t,{reqQuantity:y}=t,{notifyList:w}=t;const{properties:b={}}=d;let{placeholder:k,hint:x,readonly:I,required:S=!1,lookup:_="",view:C=!1,multi:j,max:N=1e3,generate:q=!1,status:L=!0,refDoc:E}=b;const[F,D]=_.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(k="");Q((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&_&&e.addEventListener("focus",A)}));const A=()=>{if(_){document.getElementById(a).blur();const e=y||N;(j.unique||T.length<e)&&i(10,z=!0)}},B=()=>{i(10,z&&=!1)},O=({detail:e})=>{i(7,T=e.list.map((e=>({name:e})))),o("blur",{value:e.list}),o("multi",{view:j.view,lookup:_,name:d.name,value:e.list}),B()},V=async()=>{const e={[D]:u[D]},t=await n.getSectionView(F,e),i=Array.from({length:t.length},((e,n)=>t[n][d.name]));O({detail:{list:i}})},M=(e=!1)=>{if(p||!j.required)return;const t=j.maxItem;if(!t||j.unique)return;i(9,N=!1!==e?e:y||u[t]||0);const n=T.length!=N,r=document.getElementById(a);r?.classList?.toggle("invalid",n),o("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"item"in e&&i(4,d=e.item),"record"in e&&i(5,u=e.record),"value"in e&&i(0,m=e.value),"noForm"in e&&i(28,f=e.noForm),"disabled"in e&&i(1,p=e.disabled),"formnovalidate"in e&&i(29,$=e.formnovalidate),"numberInput"in e&&i(30,h=e.numberInput),"praefix"in e&&i(31,g=e.praefix),"toDelete"in e&&i(32,v=e.toDelete),"reqQuantity"in e&&i(33,y=e.reqQuantity),"notifyList"in e&&i(34,w=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&i(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&i(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&i(7,T=[]),128&e.$$.dirty[0]&&T&&(i(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:i}=e;void 0!==g&&g!==i||t&&t.name===j.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&i(6,S=S&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:t,value:r}=e||{};if(!r)return;if(d.refItem?.split(".")[0]!==t)return;const[l,s]=d.refItem.split("."),a=await n.getTask(l,r);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];o("record",{itemName:"quantity",value:u?.length||0}),i(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(w)},[m,p,s,a,d,u,S,T,k,N,z,r,l,I,_,C,j,q,L,E,F,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),i(7,T=t.map((e=>({name:e.trim()})))),o("blur",{value:T.map((e=>e.name))}),o("multi",{view:j.view,lookup:_,value:T.map((e=>e.name))})},B,O,()=>{const e=u[q.itemQuantity]||y;if(!e)return;const t=q.prefix||"",n=u[q.variable]||"",i=q.len||5,o=Array.from({length:e},((e,o)=>t+n+"-"+o.toString().padStart(i,"0")));O({detail:{list:o}})},async()=>{if(!0===C)return V();const e=y||u[j.maxItem];if(!e)return;let t={};D&&(t={[D]:u[D]}),L&&(t.status=!0);const i=[].concat(u[j.view]||[]);i.length&&(t[j.view]={$in:i});const o=await n.getSectionView(F,t),r=Array.from({length:e<o.length?e:o.length},((e,t)=>o[t][d.name]));O({detail:{list:r}})},()=>{O({detail:{list:[]}})},f,$,h,g,v,y,w,function(e){T=e,i(7,T),i(5,u),i(4,d),i(32,v)},function(e){N=e,i(9,N)},function(e){z=e,i(10,z)}]}class So extends Se{constructor(e){var t;super(),fo.getElementById("svelte-1rbaejz-style")||((t=q("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}",_(fo.head,t)),Ie(this,e,Io,ko,x,{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])}}const{document:_o}=ve;function Co(e){e[26]=e[28].list,e[27]=e[28].items}function jo(e,t,n){const i=e.slice();return i[29]=t[n],i}function No(e,t,n){const i=e.slice();return i[32]=t[n],i}function qo(e,t,n){const i=e.slice();return i[32]=t[n],i}function Lo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Eo(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}Co(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Fo]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Do(qo(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[27],r=0;r<i.length;r+=1){const l=qo(e,i,r);o[r]?o[r].p(l,t):(o[r]=Do(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}(e),k=e[26]?.length&&function(e){let t,n=e[26],i=[];for(let t=0;t<n.length;t+=1)i[t]=Ao(jo(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11779&o[0]){let r;for(n=e[26],r=0;r<n.length;r+=1){const l=jo(e,n,r);i[r]?i[r].p(l,o):(i[r]=Ao(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){N(i,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=F(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=F(),c=q("span"),be(d.$$.fragment),u=F(),m=q("div"),f=q("table"),b&&b.c(),p=F(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Co(e);const i={};64&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[27]?.length&&b.p(e,t),e[26]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function Fo(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Do(e){let t,n,i=e[32]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function zo(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=To(No(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=F(),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[29]._id===e[0])},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const s=No(e,i,l);o[l]?o[l].p(s,r):(o[l]=To(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}2049&r[0]&&W(t,"active",e[29]._id===e[0])},d(e){e&&j(t),N(o,e)}}}function To(e){let t,n,i,o,r=e[9](e[29],e[32])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[29]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Ao(e){let t,n=e[13](e[29],e[27],e[1]),i=n&&zo(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[29],e[27],e[1])),n?i?i.p(e,o):(i=zo(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function Bo(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Oo(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Bo,then:Eo,catch:Lo,value:28,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=F(),i=D(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function Vo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Oo]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};3&n[0]|64&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Mo(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{className:p}=t,{classId:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,k="",x=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(p);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&na(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(15,m=e.item),"className"in e&&o(16,p=e.className),"classId"in e&&o(17,h=e.classId),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(18,v=e.viewName),"viewValue"in e&&o(19,y=e.viewValue),"recordId"in e&&o(20,w=e.recordId),"filter"in e&&o(21,b=e.filter)},[g,k,r,l,s,a,d,u,x,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S,t="."+h+"#"+v;document.querySelector(t);let i={[v]:y},o=[];i[v]&&(o=await n.getSectionView(e.class,i,!0)),b&&(o=o.filter((e=>e._id!=b)));const r=e.display;return{list:o,items:Ct(r,e,o)}},({detail:{value:e}})=>{o(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,k="")},m,p,h,v,y,w,b,()=>r("back"),function(e){k=e,o(1,k)}]}class Wo extends Se{constructor(e){var t;super(),_o.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(_o.head,t)),Ie(this,e,Mo,Vo,x,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Ro(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Po(e){let t,n,i,o,r;function l(t){e[21](t)}let s={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]&&(s.value=e[0]),n=new e[10]({props:s}),K.push((()=>we(n,"value",l)));let a=!e[6]&&Ho(e);return{c(){t=q("div"),be(n.$$.fragment),o=F(),a&&a.c(),M(t,"position","relative")},m(e,i){C(e,t,i),ke(n,t,null),_(t,o),a&&a.m(t,null),r=!0},p(e,o){const r={};4&o&&(r.id=e[2]),8&o&&(r.name=e[3].name),34&o&&(r.inputClass=e[5]||e[1]),64&o&&(r.disabled=e[6]),128&o&&(r.formnovalidate=e[7]),!i&&1&o&&(i=!0,r.value=e[0],re((()=>i=!1))),n.$set(r),e[6]?a&&(me(),$e(a,1,1,(()=>{a=null})),fe()):a?(a.p(e,o),64&o&&pe(a,1)):(a=Ho(e),a.c(),pe(a,1),a.m(t,null))},i(e){r||(pe(n.$$.fragment,e),pe(a),r=!0)},o(e){$e(n.$$.fragment,e),$e(a),r=!1},d(e){e&&j(t),xe(n),a&&a.d()}}}function Ho(e){let t,n,i,o,r;return n=new st({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-wbrqzu")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[17]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Qo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Yo(e){let t,n,i;function o(t){e[22](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[Go]},$$scope:{ctx:e}};return void 0!==e[8]&&(r.open=e[8]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};268435994&i&&(o.$$scope={dirty:i,ctx:e}),!n&&256&i&&(n=!0,o.open=e[8],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Go(e){let t,n;return t=new Wo({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.item=e[3]),8&n&&(i.className=e[3].refClass),2&n&&(i.classId=e[1]),16&n&&(i.recordId=e[4]._id),512&n&&(i.viewValue=e[9]),16&n&&(i.filter=e[4]._id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Uo(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Qo,then:Po,catch:Ro,value:27,blocks:[,,,]};he(e[16](),o);let r=e[8]&&Yo(e);return{c(){o.block.c(),t=F(),r&&r.c(),n=D()},m(e,l){o.block.m(e,o.anchor=l),o.mount=()=>t.parentNode,o.anchor=t,C(e,t,l),r&&r.m(e,l),C(e,n,l),i=!0},p(t,[i]){ge(o,e=t,i),e[8]?r?(r.p(e,i),256&i&&pe(r,1)):(r=Yo(e),r.c(),pe(r,1),r.m(n.parentNode,n)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){i||(pe(o.block),pe(r),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}$e(r),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&j(t),r&&r.d(e),e&&j(n)}}}function Jo(e,t,n){const{TextField:i,Modal:o}=c;let{classId:r}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:w=!1,view:b}=$,k=!1;const x=()=>{n(8,k=!1)};return e.$$set=e=>{"classId"in e&&n(1,r=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,r,l,s,a,u,m,f,k,h,i,o,g,y,w,b,async()=>(n(9,h=a[b.selection]),!0),()=>{n(8,k=!0)},({detail:e})=>{n(0,d=e.row[b.value?b.value:"_id"]),x()},x,p,function(e){d=e,n(0,d)},function(e){k=e,n(8,k)}]}class Ko extends Se{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=q("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),Ie(this,e,Jo,Uo,x,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Zo(e,t,n){const i=e.slice();return i[12]=t[n][0],i[13]=t[n][1],i}function Xo(e){let t;return{c(){t=q("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function er(e){let t;return{c(){t=q("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function tr(e){let t,n,i,o,r=e[12]+"";return{c(){t=q("option"),n=E(r),t.__value=i=e[13],t.value=t.__value,t.selected=o=e[0]==e[13]},m(e,i){C(e,t,i),_(t,n)},p(e,l){64&l&&r!==(r=e[12]+"")&&O(n,r),64&l&&i!==(i=e[13])&&(t.__value=i,t.value=t.__value),65&l&&o!==(o=e[0]==e[13])&&(t.selected=o)},d(e){e&&j(t)}}}function nr(e){let t,n,i,o,r,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?er:Xo}let i=n(e),o=i(e);return{c(){o.c(),t=D()},m(e,n){o.m(e,n),C(e,t,n)},p(e,r){i!==(i=n(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&j(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=tr(Zo(e,s,t));return{c(){t=q("select"),l&&l.c(),n=D();for(let e=0;e<a.length;e+=1)a[e].c();B(t,"class",i=S(e[3]||e[4])+" svelte-5xpzvo"),B(t,"id",e[2]),B(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(i,s){C(i,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);o||(r=z(t,"change",e[9]),o=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let i;for(s=e[6],i=0;i<s.length;i+=1){const o=Zo(e,s,i);a[i]?a[i].p(o,n):(a[i]=tr(o),a[i].c(),a[i].m(t,null))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}24&n&&i!==(i=S(e[3]||e[4])+" svelte-5xpzvo")&&B(t,"class",i),4&n&&B(t,"id",e[2]),4&n&&B(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:v,o:v,d(e){e&&j(t),l&&l.d(),N(a,e),o=!1,r()}}}function ir(e,t,n){const i=G();let{id:o}=t,{item:r}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=r.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=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,o=e.id),"item"in e&&n(10,r=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,o,s,a,d,u,m,f,e=>i("blur",{value:e.srcElement.value}),r]}class or extends Se{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=q("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}",_(document.head,t)),Ie(this,e,ir,nr,x,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function rr(e){let t;return{c(){t=E("Stunden")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function lr(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sr(e){let t;return{c(){t=E("Minuten")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ar(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[sr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function cr(e){let t;return{c(){t=E("Jetzt")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function dr(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[cr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ur(e){let t,n,i,o,r,l,s,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[dr],"minutes-label":[ar],"hours-label":[lr]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=q("input"),i=F(),be(o.$$.fragment),r=F(),be(l.$$.fragment),B(t,"type","string"),B(t,"class",n=e[2]||e[3]),B(t,"id",e[1]),B(t,"name",e[1]),t.hidden=!0},m(n,d){C(n,t,d),V(t,e[0]),C(n,i,d),ke(o,n,d),C(n,r,d),ke(l,n,d),s=!0,a||(c=z(t,"input",e[9]),a=!0)},p(e,[i]){(!s||12&i&&n!==(n=e[2]||e[3]))&&B(t,"class",n),(!s||2&i)&&B(t,"id",e[1]),(!s||2&i)&&B(t,"name",e[1]),1&i&&V(t,e[0]);const r={};1&i&&(r.value=e[0]),o.$set(r);const a={};1&i&&(a.value=e[0]),4096&i&&(a.$$scope={dirty:i,ctx:e}),l.$set(a)},i(e){s||(pe(o.$$.fragment,e),pe(l.$$.fragment,e),s=!0)},o(e){$e(o.$$.fragment,e),$e(l.$$.fragment,e),s=!1},d(e){e&&j(t),e&&j(i),xe(o,e),e&&j(r),xe(l,e),a=!1,c()}}}function mr(e,t,n){const i=G(),{Label:o,DatePicker:r,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>i("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[s,a,d,u,o,r,l,({detail:e})=>{var t,i;n(0,(t=e.value,i=s,s=null==t||null==i?t:(i.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),i))),m(s)},({detail:e})=>{n(0,s=Ln(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class fr extends Se{constructor(e){super(),Ie(this,e,mr,ur,x,{value:0,id:1,noForm:2,classId:3})}}function pr(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=q("input"),r=F(),l=q("input"),d=F(),be(u.$$.fragment),m=E(" /\n"),be(f.$$.fragment),B(t,"type","string"),B(t,"class",n=e[1]||e[2]),B(t,"id",i=e[0]+"_from"),B(t,"name",o=e[0]+"_from"),t.hidden=!0,B(l,"type","string"),B(l,"class",s=e[1]||e[2]),B(l,"id",a=e[0]+"_to"),B(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,i){C(n,t,i),V(t,e[7]),C(n,r,i),C(n,l,i),V(l,e[8]),C(n,d,i),ke(u,n,i),C(n,m,i),ke(f,n,i),p=!0,$||(h=[z(t,"input",e[13]),z(l,"input",e[14])],$=!0)},p(e,[r]){(!p||6&r&&n!==(n=e[1]||e[2]))&&B(t,"class",n),(!p||1&r&&i!==(i=e[0]+"_from"))&&B(t,"id",i),(!p||1&r&&o!==(o=e[0]+"_from"))&&B(t,"name",o),128&r&&V(t,e[7]),(!p||6&r&&s!==(s=e[1]||e[2]))&&B(l,"class",s),(!p||1&r&&a!==(a=e[0]+"_to"))&&B(l,"id",a),(!p||1&r&&c!==(c=e[0]+"_to"))&&B(l,"name",c),256&r&&V(l,e[8]);const d={};32&r&&(d.format=e[5]),8&r&&(d.required=e[3]),16&r&&(d.disabled=e[4]),128&r&&(d.value=e[7]),u.$set(d);const m={};64&r&&(m.format=e[6]),8&r&&(m.required=e[3]),16&r&&(m.disabled=e[4]),256&r&&(m.value=e[8]),f.$set(m)},i(e){p||(pe(u.$$.fragment,e),pe(f.$$.fragment,e),p=!0)},o(e){$e(u.$$.fragment,e),$e(f.$$.fragment,e),p=!1},d(e){e&&j(t),e&&j(r),e&&j(l),e&&j(d),xe(u,e),e&&j(m),xe(f,e),$=!1,b(h)}}}function $r(e,t,n){const i=G(),{DatePicker:o}=c;let{value:r}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=r?.from,$=r?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,r=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,o,({detail:e})=>{n(7,p=Ln(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),i("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=Ln(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),i("change",{value:$,range:"_to"})},r,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class hr extends Se{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=q("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),Ie(this,e,$r,pr,x,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function gr(e){let t,n,i;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:vr,placeholder:yr,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=q("div"),be(n.$$.fragment),M(t,"max-width","4em")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,[t]){const i={};4&t&&(i.inputClass=e[2]),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),2&t&&(i.value=e[1]),8&t&&(i.readonly=e[3]),16&t&&(i.disabled=e[4]),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}const vr="([01][0-9]|2[0-3]):([0-5][0-9])",yr="";function wr(e,t,n){const i=G(),{TextField:o}=c;let{id:r}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix:m}=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,r=e.id),"item"in e&&n(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[r,s,a,d,u,o,({detail:e})=>{i("blur",{value:f(e.value)}),i("checkRange",{idx:m,fieldId:r,value:e.value})},l,m]}class br extends Se{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=q("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),Ie(this,e,wr,gr,x,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:kr}=ve;function xr(e,t,n){const i=e.slice();return i[0]=t[n],i}function Ir(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function Sr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function _r(e){let t,n,i=e[14],o=[];for(let t=0;t<i.length;t+=1)o[t]=jr(xr(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(14&n){let l;for(i=e[14],l=0;l<i.length;l+=1){const r=xr(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=jr(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Cr(e){let t,n,i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"",o=e[19]&&function(e){let t;return{c(){t=E(", ")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}();return{c(){t=q("span"),o&&o.c(),n=E(i),B(t,"class","lookupValue")},m(e,i){C(e,t,i),o&&o.m(t,null),_(t,n)},p(e,t){2&t&&i!==(i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"")&&O(n,i)},d(e){e&&j(t),o&&o.d()}}}function jr(e){let t,n,i,o,r,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=Cr(Ir(e,c,t));return o=new Re({props:{size:"18"}}),{c(){t=q("div");for(let e=0;e<d.length;e+=1)d[e].c();n=F(),i=q("span"),be(o.$$.fragment),r=F(),B(i,"class","feather pointer svelte-1u646ni"),B(t,"class","lookupItem svelte-1u646ni")},m(c,u){C(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,i),ke(o,i,null),_(t,r),l=!0,s||(a=z(i,"click",e[3](e[0]._id)),s=!0)},p(i,o){if(e=i,6&o){let i;for(c=e[1],i=0;i<c.length;i+=1){const r=Ir(e,c,i);d[i]?d[i].p(r,o):(d[i]=Cr(r),d[i].c(),d[i].m(t,n))}for(;i<d.length;i+=1)d[i].d(1);d.length=c.length}},i(e){l||(pe(o.$$.fragment,e),l=!0)},o(e){$e(o.$$.fragment,e),l=!1},d(e){e&&j(t),N(d,e),xe(o),s=!1,a()}}}function Nr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function qr(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Nr,then:_r,catch:Sr,value:14,blocks:[,,,]};return he(e[2](),i),{c(){t=q("div"),i.block.c(),B(t,"class","lookup svelte-1u646ni")},m(e,o){C(e,t,o),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null,n=!0},p(t,[n]){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(),i.token=null,i=null}}}function Lr(e,t,i){let{id:o}=t,{item:r}=t,{praefix:l}=t,{record:s}=t;const{refItem:a,view:c}=r.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ie().then((()=>{const e=document.querySelector("div.form-field."+r.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&i(4,o=e.id),"item"in e&&i(0,r=e.item),"praefix"in e&&i(5,l=e.praefix),"record"in e&&i(6,s=e.record)},[r,d,async()=>{let e=[];if(s._id){const t=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const o={[u]:s[u]||s._id};if(e=await n.getSectionView(f,o,t),!t){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),i(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const t=await n.getTaskByDocId(e);if(!t)return;const i=t._id,o=`/task/${t.event}/${i}/task?view=standalone`;window.open(o)},o,l,s]}class Er extends Se{constructor(e){var t;super(),kr.getElementById("svelte-1u646ni-style")||((t=q("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(kr.head,t)),Ie(this,e,Lr,qr,x,{id:4,item:0,praefix:5,record:6})}}function Fr(e){let t,n,i;return n=new Ze({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Dr(e){let t,n,i,o,r;return n=new Ze({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function zr(e){let t,n,i,o,r,l;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 s=[Dr,Fr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=F(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Tr(e,t,i){const{TextField:o}=c;let{inputClass:r}=t,{disabled:l}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:d}=t,{id:u}=t,{name:m}=t,{value:f}=t,{record:p}=t,{item:$}=t;return e.$$set=e=>{"inputClass"in e&&i(0,r=e.inputClass),"disabled"in e&&i(1,l=e.disabled),"formnovalidate"in e&&i(2,s=e.formnovalidate),"readonly"in e&&i(3,a=e.readonly),"required"in e&&i(4,d=e.required),"id"in e&&i(5,u=e.id),"name"in e&&i(6,m=e.name),"value"in e&&i(7,f=e.value),"record"in e&&i(10,p=e.record),"item"in e&&i(11,$=e.item)},[r,l,s,a,d,u,m,f,o,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:t,houseNo:i,postcode:o,location:r,country:l}=e,s=[t&&i?t+" "+i:t,o&&r?o+" "+r:o||r||"",l&&(await n.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){U(e,t)}]}class Ar extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Tr,zr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Br(e){let t,n,i;return n=new Qe({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Or(e){let t,n,i,o,r;return n=new Qe({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Vr(e){let t,n,i,o,r,l;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 s=[Or,Br],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=F(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Mr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){U(e,t)}]}class Wr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Mr,Vr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Rr(e){let t,n,i;return n=new tt({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Pr(e){let t,n,i,o,r;return n=new tt({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Hr(e){let t,n,i,o,r,l;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 s=[Pr,Rr],a=[];function c(e,t){return e[9]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=F(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};4&i&&(l.inputClass=e[2]),1&i&&(l.pattern=e[0]),2&i&&(l.placeholder=e[1]),8&i&&(l.disabled=e[3]),16&i&&(l.formnovalidate=e[4]),32&i&&(l.readonly=e[5]),64&i&&(l.required=e[6]),128&i&&(l.id=e[7]),256&i&&(l.name=e[8]),512&i&&(l.value=e[9]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Qr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,o=e.inputClass),"disabled"in e&&n(3,r=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class Yr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Qr,Hr,x,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Gr(e){let t,n,i;return n=new Ue({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Ur(e){let t,n,i,o,r;return n=new Ue({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Jr(e){let t,n,i,o,r,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],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 s=[Ur,Gr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=F(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),256&i&&(l.pattern=e[8]),512&i&&(l.placeholder=e[9]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Kr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[o,r,l,s,a,d,u,m,f,p,i,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class Zr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Kr,Jr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}const Xr=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","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 el(e){let t;return{c(){t=q("textarea"),B(t,"id",e[0]),M(t,"visibility","hidden")},m(n,i){C(n,t,i),e[18](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[18](null)}}}function tl(e){let t;return{c(){t=q("div"),B(t,"id",e[0])},m(n,i){C(n,t,i),e[17](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[17](null)}}}function nl(e){let t;function n(e,t){return e[1]?tl:el}let i=n(e),o=i(e);return{c(){t=q("div"),o.c(),B(t,"class",e[2])},m(n,i){C(n,t,i),o.m(t,null),e[19](t)},p(e,[r]){i===(i=n(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,null))),4&r&&B(t,"class",e[2])},i:v,o:v,d(n){n&&j(t),o.d(),e[19](null)}}}const il=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let ol=(()=>{let e={listeners:[],scriptId:il("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,i)=>{e.scriptLoaded?i():(e.listeners.push(i),e.injected||((t,n,i,o)=>{e.injected=!0;const r=n.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=i,r.onload=()=>{o()},n.head&&n.head.appendChild(r)})(e.scriptId,t,n,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0})))}}})();function rl(e,t,n){var i;let o,r,l,{id:s=il("tinymce-svelte")}=t,{inline:a}=t,{disabled:c=!1}=t,{apiKey:d="no-api-key"}=t,{channel:u="6"}=t,{scriptSrc:m}=t,{conf:f={}}=t,{modelEvents:p="change input undo redo"}=t,{value:$=""}=t,{text:h=""}=t,{cssClass:g="tinymce-wrapper"}=t,v=$,y=c;const w=G(),b=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},k=()=>{const e=Object.assign(Object.assign({},f),{target:r,inline:void 0!==a?a:void 0!==f.inline&&f.inline,readonly:c,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent($),e.on(p,(()=>{n(15,v=e.getContent()),v!==$&&(n(5,$=v),n(6,h=e.getContent({format:"text"})))}))})),((e,t)=>{Xr.forEach((n=>{e.on(n,(i=>{t(n.toLowerCase(),{eventName:n,event:i,editor:e})}))}))})(e,w),"function"==typeof f.setup&&f.setup(e)}});n(4,r.style.visibility="",r),b().init(e)};return Q((()=>{if(null!==b())k();else{const e=m||`https://cdn.tiny.cloud/1/${d}/tinymce/${u}/tinymce.min.js`;ol.load(o.ownerDocument,e,(()=>{k()}))}})),Y((()=>{var e;l&&(null===(e=b())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,c=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,u=e.channel),"scriptSrc"in e&&n(10,m=e.scriptSrc),"conf"in e&&n(11,f=e.conf),"modelEvents"in e&&n(12,p=e.modelEvents),"value"in e&&n(5,$=e.value),"text"in e&&n(6,h=e.text),"cssClass"in e&&n(2,g=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&v!==$&&(l.setContent($),n(6,h=l.getContent({format:"text"}))),l&&c!==y&&(n(16,y=c),"function"==typeof(null===n(13,i=l.mode)||void 0===i?void 0:i.set)?l.mode.set(c?"readonly":"design"):l.setMode(c?"readonly":"design")))},[s,a,g,o,r,$,h,c,d,u,m,f,p,i,l,v,y,function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class ll extends Se{constructor(e){super(),Ie(this,e,rl,nl,x,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function sl(e){let t,n,i,o,r,l,s;function a(t){e[7](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",conf:e[6],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new ll({props:c}),K.push((()=>we(n,"value",a))),{c(){t=q("div"),be(n.$$.fragment),o=F(),r=q("input"),B(r,"class",l=e[1]||e[2]),B(r,"id",e[3]),B(r,"name",e[3]),r.value=e[0],r.hidden=!0,M(t,"min-height","10em"),M(t,"margin-top","-1em")},m(e,i){C(e,t,i),ke(n,t,null),_(t,o),_(t,r),s=!0},p(e,[t]){const o={};16&t&&(o.disabled=e[4]),32&t&&(o.readonly=e[5]),!i&&1&t&&(i=!0,o.value=e[0],re((()=>i=!1))),n.$set(o),(!s||6&t&&l!==(l=e[1]||e[2]))&&B(r,"class",l),(!s||8&t)&&B(r,"id",e[3]),(!s||8&t)&&B(r,"name",e[3]),(!s||1&t&&r.value!==e[0])&&(r.value=e[0])},i(e){s||(pe(n.$$.fragment,e),s=!0)},o(e){$e(n.$$.fragment,e),s=!1},d(e){e&&j(t),xe(n)}}}function al(e,n,i){let o=JSON.parse(t.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let{value:r}=n,{noForm:l}=n,{classId:s}=n,{id:a}=n,{disabled:c}=n,{readonly:d}=n;const u={plugins:"advlist numlist 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 e.$$set=e=>{"value"in e&&i(0,r=e.value),"noForm"in e&&i(1,l=e.noForm),"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"disabled"in e&&i(4,c=e.disabled),"readonly"in e&&i(5,d=e.readonly)},[r,l,s,a,c,d,u,function(e){r=e,i(0,r)}]}class cl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zemw0w-style")||((t=q("style")).id="svelte-zemw0w-style",t.textContent="div.tox-statusbar__text-container{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",_(document.head,t)),Ie(this,e,al,sl,x,{value:0,noForm:1,classId:2,id:3,disabled:4,readonly:5})}}function dl(e){let t,n;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Ll,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1048577&n[0]&&(i.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(i.name=e[0].designation),1&n[0]&&(i.help=e[0].properties?.hint),13631487&n[0]|134217728&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ul(e){let t,n;return t=new e[28]({props:{text:e[0].designation}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.text=e[0].designation),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ml(e){let t,n,i,o;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint}}),i=new cl({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6]}}),i.$on("blur",e[35]()),{c(){be(t.$$.fragment),n=F(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};1048577&n[0]&&(o.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),8&n[0]&&(r.disabled=e[3]),524288&n[0]&&(r.readonly=e[19]),1&n[0]&&(r.name=e[0].name),4194304&n[0]&&(r.value=e[22]()),64&n[0]&&(r.noForm=e[6]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function fl(e){let t,n,i,o,r,l;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+" hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[El]},$$scope:{ctx:e}}}),i=new e[28]({props:{text:e[23]}}),r=new Oi({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22]()}}),r.$on("setRefValue",e[40]),r.$on("safeReference",e[45]),{c(){be(t.$$.fragment),n=F(),be(i.$$.fragment),o=F(),be(r.$$.fragment)},m(e,s){ke(t,e,s),C(e,n,s),ke(i,e,s),C(e,o,s),ke(r,e,s),l=!0},p(e,n){const o={};1&n[0]&&(o.class=e[0].name+" hidden"),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),6291841&n[0]|134217728&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);const l={};8388608&n[0]&&(l.text=e[23]),i.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),1&n[0]&&(s.item=e[0]),131072&n[0]&&(s.currency=e[17]),4194304&n[0]&&(s.value=e[22]()),r.$set(s)},i(e){l||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){xe(t,e),e&&j(n),xe(i,e),e&&j(o),xe(r,e)}}}function pl(e){let t,n;return t=new e[25]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[29],required:!0===e[4],placeholder:e[30],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=!0===e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function $l(e){let t,n;return t=new Yr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function hl(e){let t,n;return t=new Wr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gl(e){let t,n;return t=new Zr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function vl(e){let t,n;return t=new br({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[0],value:e[22](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[51]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yl(e){let t,n;return t=new Er({props:{id:e[32],item:e[0],praefix:e[5],record:e[1]}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.item=e[0]),32&n[0]&&(i.praefix=e[5]),2&n[0]&&(i.record=e[1]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function wl(e){let t,n;return t=new Ar({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22](),record:e[1],item:e[0]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),2&n[0]&&(i.record=e[1]),1&n[0]&&(i.item=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function bl(e){let t,n;return t=new fr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function kl(e){let t,n;return t=new hr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xl(e){let t,n;return t=new e[26]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Il(e){let t,n;return t=new e[27]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),524296&n[0]&&(i.disabled=e[3]||e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.checked=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Sl(e){let t,n;return t=new Ko({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],view:e[0].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[50]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.view=e[0].properties.view),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _l(e){let t,n;return t=new So({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],multi:e[0].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[49]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.multi=e[0].properties.multi),4096&n[0]&&(i.numberInput=e[12]),32&n[0]&&(i.praefix=e[5]),32768&n[0]&&(i.toDelete=e[15]),65536&n[0]&&(i.reqQuantity=e[16]),262144&n[0]&&(i.notifyList=e[18]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Cl(e){let t,n;return t=new Ri({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22](),praefix:e[5],notifyList:e[18],noForm:e[6]}}),t.$on("blur",e[35]()),t.$on("formula",e[48]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),16&n[0]&&(i.required=e[4]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),131072&n[0]&&(i.currency=e[17]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),262144&n[0]&&(i.notifyList=e[18]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function jl(e){let t,n;return t=new or({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],value:e[22](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Nl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6],placeholder:e[0].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.name=e[0].name),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.placeholder=e[0].properties?.placeholder),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ql(e){let t,n;return t=new Cn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],value:e[22](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[46]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[47]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ll(e){let t,n,i,o;const r=[ql,Nl,jl,Cl,_l,Sl,Il,xl,kl,bl,wl,yl,vl,gl,hl,$l,pl],l=[];function s(e,t){return"object"===e[0].type?0:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?1:e[0].properties&&(e[0].properties.enum||e[0].properties.regulation)?2:"number"===e[0].type?3:e[0].properties&&e[0].properties.multi?4:e[0].properties&&e[0].properties.view&&"lookup"!==e[0].properties.format?5:"boolean"===e[0].type?6:"date"===e[0].type?7:"dateRange"===e[0].type?8:"datetime"===e[0].type?9:"map"===e[0].properties?.format?10:"lookup"===e[0].properties?.format?11:"time"===e[0].properties?.format?12:"email"===e[0].type||"email"===e[0].properties?.format?13:"url"===e[0].properties?.format?14:"tel"===e[0].properties?.format?15:16}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function El(e){let t,n;return t=new Cn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[0],value:e[22](),noList:!0,withRefValue:!0,refValue:e[21]}}),t.$on("setRefDesc",e[41]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),2097152&n[0]&&(i.refValue=e[21]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Fl(e){let t,n,i,o;const r=[fl,ml,ul,dl],l=[];function s(e,t){return e[5]||"reference"!==e[0].saveAs||"object"!==e[0].type?"html"===e[0].properties?.format?1:"divider"===e[0].type?2:3:0}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Dl(e,t,n){let i,o,r;const l=G(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:k}=t,{disabled:x}=t,{selectionFields:I}=t,{formnovalidate:S}=t,{selection:_=!1}=t,{notifyList:C}=t,{numberInput:j}=t,{deList:N}=t,{required:q}=t,{isTemplate:L}=t,{toDelete:E}=t,{reqQuantity:F}=t,{currency:D}=t,{changeValue:z}=t,{propSelection:T}=t;y||=v._id;let{required:A,readonly:B,hidden:O,pattern:V,placeholder:M}=h.properties||{};if(O=!0===O,void 0!==B&&(B=!0===B),void 0===q&&(q=A),x=x||!!B,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const W=(g?g+".":"")+h.name,R=W+(""!==$?"-"+$:""),P=(e,t=W)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let H=P(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(0,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(1,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,w=e.noForm),"classId"in e&&n(7,b=e.classId),"eventId"in e&&n(8,k=e.eventId),"disabled"in e&&n(3,x=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,S=e.formnovalidate),"selection"in e&&n(11,_=e.selection),"notifyList"in e&&n(18,C=e.notifyList),"numberInput"in e&&n(12,j=e.numberInput),"deList"in e&&n(13,N=e.deList),"required"in e&&n(4,q=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,E=e.toDelete),"reqQuantity"in e&&n(16,F=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue),"propSelection"in e&&n(44,T=e.propSelection)},e.$$.update=()=>{if(1&e.$$.dirty[0]|8192&e.$$.dirty[1]&&T&&h.properties?.selection){const{refClass:e,refItem:t,target:n}=h.properties.selection,i=T.record[e];l("propSelection",{itemName:h.name,itemType:h.type,prop:t,target:n,source:e,sourceId:i})}if(4096&e.$$.dirty[1])for(const e in z)e===W&&n(1,v[W]=z[e],v);2&e.$$.dirty[0]&&n(22,i=(e=W)=>{let t=P(v);return void 0===t?"":t}),2&e.$$.dirty[0]&&(r=P(v))},n(23,o=((e=W)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[h,v,y,x,q,$,w,b,k,I,S,_,j,N,L,E,F,D,C,B,O,H,i,o,s,a,d,m,p,V,M,W,R,(e=W)=>{let t=P(v);return t?new Date(t):""===$?new Date:void 0},(e=W)=>{const t=P(v,e+"_from"),n=P(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:i,checked:o,range:s}=t;void 0!==o&&(i=o);const a=W+(s||"");n(1,v[a]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(i,"%d.%m.%Y"):i,v);const c=Object.values(v).every((e=>!e))&&i;l("notify",{oldValue:r,value:i,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,O=!0),()=>"object"===h.type?"comment_"+R:R,({detail:e})=>{n(21,H=e)},({detail:e})=>{const{designation:t}=h;n(23,o=t+": "+(e||"(Neu)"))},g,z,T,function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)}]}class zl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zmu4lk-style")||((t=q("style")).id="svelte-zmu4lk-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),Ie(this,e,Dl,Fl,x,{praefix:5,item:0,listName:42,record:1,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43,propSelection:44},[-1,-1])}}const{document:Tl}=ve;function Al(e,t,n){const i=e.slice();return i[88]=t[n],i[90]=n,i}function Bl(e,t,n){const i=e.slice();return i[97]=t[n],i}function Ol(e,t,n){const i=e.slice();return i[92]=t[n].title,i[93]=t[n].toDelete,i[94]=t[n].icon,i}function Vl(e){let t,n;return t=new e[19]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[Ml]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ml(e){let t,n,i;function o(t){e[50](t)}let r={item:e[29],disabled:!0};return void 0!==e[11]&&(r.value=e[11]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&2048&i[0]&&(n=!0,o.value=e[11],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Wl(e){let t,n;return t=new e[19]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[Rl]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Rl(e){let t,n,i;function o(t){e[51](t)}let r={item:e[27],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Pl(e){let t,n;return t=new e[19]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[Hl]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1152&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Hl(e){let t,n,i;function o(t){e[52](t)}let r={item:e[25],disabled:!0,currency:e[7]};return void 0!==e[10]&&(r.value=e[10]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Ql(e){let t,n;return t=new e[22]({props:{class:e[16][e[90]],open:e[9]&&!e[1]&&0===e[90],$$slots:{handle:[es,({toggle:e,open:t})=>({91:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?536870912:0]],default:[Jl,({toggle:e,open:t})=>({91:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?536870912:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){k(e[43](e[90],e[87]))&&e[43](e[90],e[87]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};65536&i[0]&&(o.class=e[16][e[90]]),514&i[0]&&(o.open=e[9]&&!e[1]&&0===e[90]),439293&i[0]|536870912&i[2]|128&i[3]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Yl(e){let t,n;return t=new zl({props:{praefix:e[90],item:e[97],eventId:e[6],record:e[88],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:rs,classId:e[5],disabled:e[0],required:e[23],selectionFields:e[30],propSelection:e[15],numberInput:e[18],currency:e[7],formnovalidate:e[90]===e[12].length-1||e[12][e[90]]._delete}}),t.$on("notify",(function(){k(e[32](e[97],e[90]))&&e[32](e[97],e[90]).apply(this,arguments)})),t.$on("task",e[53]),t.$on("invalid",e[33]),t.$on("defPrep",e[34]),t.$on("checkRange",e[35]),t.$on("formula",e[44](e[90])),t.$on("record",e[54]),t.$on("propSelection",e[45](e[90])),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};8&i[0]&&(o.item=e[97]),64&i[0]&&(o.eventId=e[6]),4096&i[0]&&(o.record=e[88]),16&i[0]&&(o.recordId=e[4]._id),4&i[0]&&(o.reqQuantity=e[2]),256&i[0]&&(o.notifyList=e[8]),32&i[0]&&(o.classId=e[5]),1&i[0]&&(o.disabled=e[0]),32768&i[0]&&(o.propSelection=e[15]),262144&i[0]&&(o.numberInput=e[18]),128&i[0]&&(o.currency=e[7]),4096&i[0]&&(o.formnovalidate=e[90]===e[12].length-1||e[12][e[90]]._delete),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Gl(e){let t,n,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Yl(Bl(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082429949&n[0]|24606&n[1]){let l;for(i=e[3].item,l=0;l<i.length;l+=1){const r=Bl(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Yl(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Ul(e){let t,n,i=e[12][e[90]]._delete,o=Gl(e);return{c(){o.c(),t=D()},m(e,i){o.m(e,i),C(e,t,i),n=!0},p(e,n){4096&n[0]&&x(i,i=e[12][e[90]]._delete)?(me(),$e(o,1,1,v),fe(),o=Gl(e),o.c(),pe(o),o.m(t.parentNode,t)):o.p(e,n)},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){e&&j(t),o.d(e)}}}function Jl(e){let t,n,i,o,r=e[12].length,l=Ul(e);return{c(){t=q("div"),l.c(),i=F(),B(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[90]}`)},m(e,n){C(e,t,n),l.m(t,null),C(e,i,n),o=!0},p(e,i){4096&i[0]&&x(r,r=e[12].length)?(me(),$e(l,1,1,v),fe(),l=Ul(e),l.c(),pe(l),l.m(t,null)):l.p(e,i),(!o||40&i[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[90]}`))&&B(t,"id",n)},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(t),l.d(e),e&&j(i)}}}function Kl(e){let t,n,i,o,r,l=e[31](e[13],e[90])+"";return{c(){t=q("div"),n=E(l),B(t,"class",i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1"),B(t,"draggable",!0),W(t,"delete",e[88]._delete),W(t,"is-active-top",e[17]?.top===e[90]),W(t,"is-active-bottom",e[17]?.bottom===e[90])},m(i,l){C(i,t,l),_(t,n),o||(r=[z(t,"dragover",e[41]),z(t,"dragleave",e[42](e[90])),z(t,"dragstart",e[39](e[90])),z(t,"drop",T(e[38](e[90]))),z(t,"dragenter",e[40](e[90]))],o=!0)},p(o,r){e=o,8192&r[0]&&l!==(l=e[31](e[13],e[90])+"")&&O(n,l),8&r[0]&&i!==(i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&B(t,"class",i),4104&r[0]&&W(t,"delete",e[88]._delete),131080&r[0]&&W(t,"is-active-top",e[17]?.top===e[90]),131080&r[0]&&W(t,"is-active-bottom",e[17]?.bottom===e[90])},d(e){e&&j(t),o=!1,b(r)}}}function Zl(e){let t,n,i;var o=e[94];return o&&(t=new o({props:{size:"20"}})),{c(){t&&be(t.$$.fragment),n=D()},m(e,o){t&&ke(t,e,o),C(e,n,o),i=!0},p(e,i){if(o!==(o=e[94])){if(t){me();const e=t;$e(e.$$.fragment,1,0,(()=>{xe(e,1)})),fe()}o?(t=new o({props:{size:"20"}}),be(t.$$.fragment),pe(t.$$.fragment,1),ke(t,n.parentNode,n)):t=null}},i(e){i||(t&&pe(t.$$.fragment,e),i=!0)},o(e){t&&$e(t.$$.fragment,e),i=!1},d(e){e&&j(n),t&&xe(t,e)}}}function Xl(e){let t,n,i,o,r,l=!e[0]&&!e[3].readonly&&Zl(e);return{c(){t=q("span"),l&&l.c(),B(t,"class","pointer icon svelte-1es1ap1"),B(t,"title",e[92]),t.hidden=n=e[90]===e[12].length-1||!(e[88]._delete^e[93])},m(n,s){C(n,t,s),l&&l.m(t,null),i=!0,o||(r=z(t,"click",(function(){k(e[37](e[90],e[9],e[91]))&&e[37](e[90],e[9],e[91]).apply(this,arguments)})),o=!0)},p(o,r){(e=o)[0]||e[3].readonly?l&&(me(),$e(l,1,1,(()=>{l=null})),fe()):l?(l.p(e,r),9&r[0]&&pe(l,1)):(l=Zl(e),l.c(),pe(l,1),l.m(t,null)),(!i||4096&r[0]&&n!==(n=e[90]===e[12].length-1||!(e[88]._delete^e[93])))&&(t.hidden=n)},i(e){i||(pe(l),i=!0)},o(e){$e(l),i=!1},d(e){e&&j(t),l&&l.d(),o=!1,r()}}}function es(e){let t,n,i,o,r,l;n=new e[20]({props:{$$slots:{default:[Kl]},$$scope:{ctx:e}}}),n.$on("click",(function(){k(e[36](e[91],e[90],e[9]))&&e[36](e[91],e[90],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:Ae}],a=[];for(let t=0;t<2;t+=1)a[t]=Xl(Ol(e,s,t));const c=e=>$e(a[e],1,1,(()=>{a[e]=null}));return{c(){t=q("div"),be(n.$$.fragment),i=F();for(let e=0;e<2;e+=1)a[e].c();o=F(),B(t,"class",r=S("accordion "+e[3].name)+" svelte-1es1ap1"),B(t,"slot","handle")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,o),l=!0},p(i,d){e=i;const u={};if(143368&d[0]|128&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|64&d[1]|536870912&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:Ae}],n=0;n<2;n+=1){const i=Ol(e,s,n);a[n]?(a[n].p(i,d),pe(a[n],1)):(a[n]=Xl(i),a[n].c(),pe(a[n],1),a[n].m(t,o))}for(me(),n=2;n<2;n+=1)c(n);fe()}(!l||8&d[0]&&r!==(r=S("accordion "+e[3].name)+" svelte-1es1ap1"))&&B(t,"class",r)},i(e){if(!l){pe(n.$$.fragment,e);for(let e=0;e<2;e+=1)pe(a[e]);l=!0}},o(e){$e(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)$e(a[e]);l=!1},d(e){e&&j(t),xe(n),N(a,e)}}}function ts(e){let t,n,i=(!e[1]&&!e[0]||e[90]<e[12].length-1)&&Ql(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){!e[1]&&!e[0]||e[90]<e[12].length-1?i?(i.p(e,n),4099&n[0]&&pe(i,1)):(i=Ql(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ns(e){let t,n,i=e[12],o=[];for(let t=0;t<i.length;t+=1)o[t]=ts(Al(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=D()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082635263&n[0]|32767&n[1]|570425344&n[2]){let l;for(i=e[12],l=0;l<i.length;l+=1){const r=Al(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ts(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function is(e){let t,n,i,o,r,l,s=e[28]&&e[11]&&0!=e[11]&&Vl(e),a=e[26]&&e[14]&&0!=e[14]&&Wl(e),c=e[24]&&e[10]&&0!=e[10]&&Pl(e);return r=new e[21]({props:{class:e[5]+e[3].name,$$slots:{default:[ns,({closeOtherPanels:e})=>({87:e}),({closeOtherPanels:e})=>[0,0,e?33554432:0]]},$$scope:{ctx:e}}}),{c(){t=q("div"),s&&s.c(),n=F(),a&&a.c(),i=F(),c&&c.c(),o=F(),be(r.$$.fragment),B(t,"class","formList")},m(e,d){C(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,i),c&&c.m(t,null),_(t,o),ke(r,t,null),l=!0},p(e,l){e[28]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&pe(s,1)):(s=Vl(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[26]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&pe(a,1)):(a=Wl(e),a.c(),pe(a,1),a.m(t,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),e[24]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&pe(c,1)):(c=Pl(e),c.c(),pe(c,1),c.m(t,o)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe());const d={};40&l[0]&&(d.class=e[5]+e[3].name),504831&l[0]|33554432&l[2]|128&l[3]&&(d.$$scope={dirty:l,ctx:e}),r.$set(d)},i(e){l||(pe(s),pe(a),pe(c),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(a),$e(c),$e(r.$$.fragment,e),l=!1},d(e){e&&j(t),s&&s.d(),a&&a.d(),c&&c.d(),xe(r)}}}let os=new Map;const rs=!0,ls="pos/target";function ss(e,t,i){let o,r;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=G();let{list:g}=t,{mainSchema:v}=t,{schema:y}=t,{record:w}=t,{classId:b}=t,{eventId:k}=t,{disabled:x}=t,{fixed:I}=t,{template:S={}}=t,{reqQuantity:_}=t,{open:C=!1}=t,{currency:j}=t,{notifyList:N}=t;const q=y.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),L=q&&y.find((e=>"quantity"===e.name));let E=0;const F=y.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let D=0;const z=y.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",T=!!z;let A=0;const B={};let O,V=y.properties?.readonly,M=b.split("form-")[1].slice(0,-4),W=new Map;g.group&&(I=!0);const R={};x||=V;let P,H,Q=[],Y=[],J=!1,K={},Z=[];y.filter((e=>e.selection)).map((e=>Q.push({className:M,parentClass:y,refClass:e.selection,value:""}))),y.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{y.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[i,o]=n.split(".");o||(o=i,i=void 0),Z.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));const X=async(e,t,n)=>{const i=w[n];if(!i?.length)return;const o=i[0][n];if(!o)return;const r=await ta(n,o);return r?r[g.name]:void 0},ee=async(e,t)=>{const n=Z.filter((e=>(e.refObj||M)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:o,refName:r,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(o){const t=P[e][o];o===M&&r?d=w:t&&(d=await ta(o,t))}!o&&r&&(d=P[e]),d&&(u=d[r],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&i(12,P[e][n]="",P))}},te=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(n);let r=!1;o.forEach((e=>{e.required&&""===e.value&&(r=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),i(16,Y[e]=r||t?"invalid":"",Y)},ne=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},oe=(e,t)=>{if(!t)return;const n=y.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:l}=o,s=l.map((t=>P[e][t.refItem]||w[t.refItem]));let a=0;"$add"===r&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,i]=e.split(":");e=i?(+n+ +i/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0}))),"$multiply"===r&&(a=s.reduce(((e,t)=>+e*+t)));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;i(12,P[e][t]="$multiply"===r?a?a.toFixed(n.properties.decimals||0):"":(a||0).toFixed(n.properties.decimals||0),P),i(18,K={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};H=y.filter((e=>e.refClass)).reduce(((e,t)=>{const n=y.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,i]=t.selection.split(":"),[o]=i?.split(".")||[];o&&e.push({refClass:o,items:[n],selection:t.selection})}const i={refClass:t.refClass,items:[]};return n.forEach((e=>{i.items.push(e.name)})),e.push(i),e}),[]);const re=async(e,t,n,o)=>{const r=(await H).find((e=>e.refClass===t.refClass));if(!r)return;const{refClass:l,items:s,selection:a}=r,c=t.name;if(Z.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async r=>{const c=y.find((e=>e.name===r));if(c.properties?.readonly&&!t.refInput){const n=P[e][t.refClass];return Promise.resolve(ta(t.refClass,n,!0)).then((t=>{let n=t[r];Array.isArray(n)&&(n=n.length?n[0][r]:""),i(12,P[e][r]=n,P)}))}let d="";const{refInput:u}=t;if(u&&P[e]){const[t,n]=u.split(".");d=n?P[e][n]:w[t]}if(a&&n!==o)s.map((t=>{i(12,P[e][t]="",P)}));else if(u&&!d||le(e,r)||o!==n){const n=y.find((e=>e.refClass===l)),o=P[e][n.name];if(t.selection){const n=ea(t.selection+o.toString());if(n)return Promise.resolve(n).then((t=>i(12,P[e][r]=t[r],P)))}return Promise.resolve(ta(n.refClass,o)).then((t=>i(12,P[e][r]=t[r],P)))}}))):Promise.resolve(s.map((t=>{i(12,P[e][t]="",P)})))},le=(e,t)=>{let n=P[e][t];return"number"===y.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},se=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let ae=!1;const ce=e=>!(!I&&e>=P.length-1),de=(e,t=!1)=>{const[n,i]=e.split(";");return g.name===i&&(!!ce(t)&&((!1===t||t!=n)&&parseInt(n)))};y.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=y.find((e=>e.name===t.refItem))||y.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ue=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,i=document.querySelectorAll(n);if(!i?.length)return;const o=i[i.length-1];ie().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(se)})).then((()=>{t&&o.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&i(3,g=e.list),"mainSchema"in e&&i(46,v=e.mainSchema),"schema"in e&&i(47,y=e.schema),"record"in e&&i(4,w=e.record),"classId"in e&&i(5,b=e.classId),"eventId"in e&&i(6,k=e.eventId),"disabled"in e&&i(0,x=e.disabled),"fixed"in e&&i(1,I=e.fixed),"template"in e&&i(48,S=e.template),"reqQuantity"in e&&i(2,_=e.reqQuantity),"open"in e&&i(9,C=e.open),"currency"in e&&i(7,j=e.currency),"notifyList"in e&&i(8,N=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&w&&(i(2,_=w.quantity),i(12,P=(w[g.name]||[]).concat({})),(e=>{i(15,O={record:e})})(w)),4096&e.$$.dirty[0]&&i(13,o=P),15368&e.$$.dirty[0]&&o&&((()=>{if(F)i(14,D=P?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(T)i(11,A=P?.reduce(((e,t)=>e+(t._delete?0:+(t[z]||0))),0)||0)})(),(()=>{if(q)i(10,E=P?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}else if(t.price){const n=(L?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ie().then((()=>h("save",{listName:g.name,value:P,amountValue:E,weeksValue:A})))),262144&e.$$.dirty[1]&&(r=e=>B[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[x,I,_,g,w,b,k,j,N,C,E,A,P,o,D,O,Y,J,K,l,a,d,u,undefined,q,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},T,{name:"weeksValue",properties:{decimals:1}},Q,(e,t)=>{let n=e[t];return R["pos"+t]&&(n=R["pos"+t]),n&&y.filter((e=>!0!==e.properties?.hidden&&("dateRange"===e.type||void 0!==n[e.name])&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?r(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?$(n[e.name]):"dateRange"===e.type?((e,t)=>{let n,i;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{i=t[e+"_to"],i=new Date(i||"").toLocaleDateString(),"Invalid Date"===i&&(i="")}catch{i=""}return[n,i].filter((e=>""!==e)).join(" - ").trim()})(e.name,n):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:r,value:l,add:s,desc:a}=n;if(g.refItem){const n=await X(t,e,g.refItem);n&&i(12,P=n)}oe(t,e._formulaActor);const c=Q?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&P.length===t+1&&i(12,P=P.concat({})),a&&i(49,B[l]=a,B),await re(t,e,l,r),await ee(t,e.name),i(13,o=P),"number"===e.type&&i(18,K={item:e,value:l,idx:t}),te(t)},({detail:e})=>{const{idx:t,value:n}=e;te(t,n)},async({detail:{className:e,itemName:t,value:i}})=>{if(W.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===M+"."+g.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&W.set(e,r[0])},({detail:e})=>{const{idx:t,fieldId:n,value:i}=e;if(!i)return;const o=ne(i);let r=!1;P.forEach(((e,n)=>{if(t===n)return;const{start:i,end:l}=P[n];i&&l&&o>ne(i)&&o<ne(l)&&(r=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",r)},(e,t,n)=>n=>{P[t]._delete||(e(n),ue(t,!0))},(e,t,n)=>o=>{if(i(12,P[e]._delete=!P[e]._delete,P),P[e]._delete){R["pos"+e]={...P[e]};for(const t of y)i(12,P[e][t.name]="",P);t&&n(o)}else{if(R["pos"+e]){const t={};for(const n of y)t[n.name]=R["pos"+e][n.name];i(12,P[e]=t,P)}R["pos"+e]=void 0,t||n(o)}},e=>t=>{t.preventDefault(),i(17,J=!1);const n=de(t.dataTransfer.getData(ls),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const o=[...P].map(((e,t)=>(e._index=t,e)));n<e?(o.splice(e+1,0,o[n]),o.splice(n,1)):(o.splice(e,0,o[n]),o.splice(n+1,1)),o.map(((e,t)=>{return n=e._index,i=t,void os.set(i,n);var n,i}));let r=[];Y.map(((e,t)=>{r[t]=Y[(e=>{const t=os.get(e);return void 0===t?e:t})(t)]})),i(16,Y=r),i(12,P=o.map(((e,t)=>(delete e._index,e)))),ae=!1},e=>t=>{if(!ce(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(ls,e+";"+g.name),ae=e},e=>t=>{const n=de(t.dataTransfer.getData(ls),e)||ae;return!1===n||n===e?i(17,J=!1):void i(17,J={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{i(17,J=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(W).forEach((([t,n])=>{P[e][t]||i(12,P[e][t]=n._id,P)}))}),500);const o=new Set;for(const e of Z)o.add(e.refObj||M);for(const t of Array.from(o))ee(e,t);t(n),ue(e)},e=>({detail:t})=>{oe(e,t.item.name)},e=>async({detail:t})=>{const{itemName:n,itemType:o,source:r,target:l,sourceId:s,prop:a}=t;if(!s)return void i(12,P[e][n]="",P);let c=await ta(r,s);const d=c[a];c=await ta(g.name,w[g.name][e][g.name]);const u=c[l];let m="number"===o?0:"",f=0;u.forEach((e=>{const t=e[a];t.length<=f||t.every((e=>d.find((t=>t===e))))&&(m=e[n],f=t.length)})),i(12,P[e][n]=m,P)},v,y,S,B,function(e){A=e,i(11,A)},function(e){D=e,i(14,D)},function(e){E=e,i(10,E)},function(t){U(e,t)},function(t){U(e,t)}]}class as extends Se{constructor(e){var t;super(),Tl.getElementById("svelte-1es1ap1-style")||((t=q("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(Tl.head,t)),Ie(this,e,ss,is,x,{list:3,mainSchema:46,schema:47,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:48,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:cs,document:ds}=ve;function us(e,t,n){const i=e.slice();return i[127]=t[n],i}function ms(e,t,n){const i=e.slice();return i[130]=t[n],i}function fs(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function ps(e){let t,n,i=e[126]&&function(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g=e[2].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=hs(ms(e,g,t));const y=e=>$e(v[e],1,1,(()=>{v[e]=null}));let w=e[2].list&&gs(e),k=!e[0]&&!e[3]&&e[41]&&e[4]&&!e[22]&&Cs(e);d=new e[25]({props:{outline:!0,$$slots:{default:[Ns]},$$scope:{ctx:e}}}),d.$on("click",e[44]);const x=[Ls,qs],I=[];function L(e,t){return e[6]?0:e[41]?1:-1}~(m=L(e))&&(f=I[m]=x[m](e));return{c(){t=q("section"),n=q("form"),i=q("input"),r=F();for(let e=0;e<v.length;e+=1)v[e].c();l=F(),w&&w.c(),s=F(),k&&k.c(),a=F(),c=q("div"),be(d.$$.fragment),u=F(),f&&f.c(),B(i,"class",S(e[31])+" svelte-9xiaib"),B(i,"name","_id"),B(i,"type","hidden"),i.value=o=e[5]._id||"",B(n,"class",S(e[32])+" svelte-9xiaib"),B(n,"id",e[31]),B(c,"class","form--buttons svelte-9xiaib"),B(t,"class",S(e[33])+" svelte-9xiaib")},m(o,f){C(o,t,f),_(t,n),_(n,i),_(n,r);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),k&&k.m(t,null),_(t,a),_(t,c),ke(d,c,null),_(c,u),~m&&I[m].m(c,null),p=!0,$||(h=[z(n,"keydown",e[49]),z(n,"submit",T(e[43]))],$=!0)},p(e,r){if((!p||32&r[0]&&o!==(o=e[5]._id||""))&&(i.value=o),4264228&r[0]|58835457&r[1]){let t;for(g=e[2].items,t=0;t<g.length;t+=1){const i=ms(e,g,t);v[t]?(v[t].p(i,r),pe(v[t],1)):(v[t]=hs(i),v[t].c(),pe(v[t],1),v[t].m(n,l))}for(me(),t=g.length;t<v.length;t+=1)y(t);fe()}e[2].list?w?(w.p(e,r),4&r[0]&&pe(w,1)):(w=gs(e),w.c(),pe(w,1),w.m(n,null)):w&&(me(),$e(w,1,1,(()=>{w=null})),fe()),e[0]||e[3]||!e[41]||!e[4]||e[22]?k&&(me(),$e(k,1,1,(()=>{k=null})),fe()):k?(k.p(e,r),4194329&r[0]&&pe(k,1)):(k=Cs(e),k.c(),pe(k,1),k.m(t,a));const s={};512&r[4]&&(s.$$scope={dirty:r,ctx:e}),d.$set(s);let u=m;m=L(e),m===u?~m&&I[m].p(e,r):(f&&(me(),$e(I[u],1,1,(()=>{I[u]=null})),fe()),~m?(f=I[m],f?f.p(e,r):(f=I[m]=x[m](e),f.c()),pe(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)pe(v[e]);pe(w),pe(k),pe(d.$$.fragment,e),pe(f),p=!0}},o(e){v=v.filter(cs);for(let e=0;e<v.length;e+=1)$e(v[e]);$e(w),$e(k),$e(d.$$.fragment,e),$e(f),p=!1},d(e){e&&j(t),N(v,e),w&&w.d(),k&&k.d(),xe(d),~m&&I[m].d(),$=!1,b(h)}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[126]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function $s(e){let t,n;return t=new zl({props:{classId:e[31],item:e[130],selection:e[130].selection,record:e[5],disabled:e[22],eventId:e[40],toDelete:e[12],currency:e[8],changeValue:e[16]}}),t.$on("task",e[45]),t.$on("notify",e[46]),t.$on("safeReference",e[55]),t.$on("multi",e[47]),t.$on("defPrep",e[54]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.item=e[130]),4&n[0]&&(i.selection=e[130].selection),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4096&n[0]&&(i.toDelete=e[12]),256&n[0]&&(i.currency=e[8]),65536&n[0]&&(i.changeValue=e[16]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function hs(e){let t,n,i="list"!==e[130].type&&$s(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[130].type?i?(i.p(e,n),4&n[0]&&pe(i,1)):(i=$s(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function gs(e){let t,n,i,o,r,l=e[36]&&e[9]&&0!=e[9]&&vs(e),s=e[10]&&ws(e),a=e[37]&&e[15]&&0!=e[15]&&ks(e),c=e[2].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=_s(us(e,c,t));const u=e=>$e(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=F(),s&&s.c(),n=F(),a&&a.c(),i=F();for(let e=0;e<d.length;e+=1)d[e].c();o=D()},m(e,c){l&&l.m(e,c),C(e,t,c),s&&s.m(e,c),C(e,n,c),a&&a.m(e,c),C(e,i,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);C(e,o,c),r=!0},p(e,r){if(e[36]&&e[9]&&0!=e[9]?l?(l.p(e,r),512&r[0]&&pe(l,1)):(l=vs(e),l.c(),pe(l,1),l.m(t.parentNode,t)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[10]?s?(s.p(e,r),1024&r[0]&&pe(s,1)):(s=ws(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[37]&&e[15]&&0!=e[15]?a?(a.p(e,r),32768&r[0]&&pe(a,1)):(a=ks(e),a.c(),pe(a,1),a.m(i.parentNode,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),4612524&r[0]|33686017&r[1]){let t;for(c=e[2].list,t=0;t<c.length;t+=1){const n=us(e,c,t);d[t]?(d[t].p(n,r),pe(d[t],1)):(d[t]=_s(n),d[t].c(),pe(d[t],1),d[t].m(o.parentNode,o))}for(me(),t=c.length;t<d.length;t+=1)u(t);fe()}},i(e){if(!r){pe(l),pe(s),pe(a);for(let e=0;e<c.length;e+=1)pe(d[e]);r=!0}},o(e){$e(l),$e(s),$e(a),d=d.filter(cs);for(let e=0;e<d.length;e+=1)$e(d[e]);r=!1},d(e){l&&l.d(e),e&&j(t),s&&s.d(e),e&&j(n),a&&a.d(e),e&&j(i),N(d,e),e&&j(o)}}}function vs(e){let t,n;return t=new e[26]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[ys]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ys(e){let t,n,i;function o(t){e[64](t)}let r={item:e[34],disabled:!0,currency:e[8]};return void 0!==e[9]&&(r.value=e[9]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&512&i[0]&&(n=!0,o.value=e[9],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function ws(e){let t,n;return t=new e[26]({props:{name:"Total MWSt "+(e[11]?"("+e[11]+"%)":""),nameClass:"formField_italic",$$slots:{default:[bs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[0]&&(i.name="Total MWSt "+(e[11]?"("+e[11]+"%)":"")),1280&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function bs(e){let t,n,i;function o(t){e[65](t)}let r={item:e[35],disabled:!0,currency:e[8]};return void 0!==e[10]&&(r.value=e[10]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function ks(e){let t,n;return t=new e[26]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[xs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};32768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xs(e){let t,n,i;function o(t){e[66](t)}let r={item:e[38],disabled:!0};return void 0!==e[15]&&(r.value=e[15]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&32768&i[0]&&(n=!0,o.value=e[15],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Is(e){let t,n;return t=new ii({props:{classId:e[31],open:!e[3]&&1===e[2].list.length,list:e[127],template:e[17],eventId:e[40],schema:e[127].item,record:e[5],disabled:e[22],currency:e[8]}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};12&n[0]&&(i.open=!e[3]&&1===e[2].list.length),4&n[0]&&(i.list=e[127]),131072&n[0]&&(i.template=e[17]),4&n[0]&&(i.schema=e[127].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ss(e){let t,n;return t=new as({props:{classId:e[31],open:e[14],list:e[127],template:e[18],eventId:e[40],schema:e[127].item,mainSchema:e[2].item,record:e[5],disabled:e[22],fixed:e[127].fixed,reqQuantity:e[13],currency:e[8],notifyList:e[7]}}),t.$on("save",e[48]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.open=e[14]),4&n[0]&&(i.list=e[127]),262144&n[0]&&(i.template=e[18]),4&n[0]&&(i.schema=e[127].item),4&n[0]&&(i.mainSchema=e[2].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4&n[0]&&(i.fixed=e[127].fixed),8192&n[0]&&(i.reqQuantity=e[13]),256&n[0]&&(i.currency=e[8]),128&n[0]&&(i.notifyList=e[7]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _s(e){let t,n,i,o,r,l;t=new e[24]({props:{text:e[127].designation}});const s=[Ss,Is],a=[];function c(e,t){return"array"===e[127].type?0:1}return i=c(e),o=a[i]=s[i](e),{c(){be(t.$$.fragment),n=F(),o.c(),r=D()},m(e,o){ke(t,e,o),C(e,n,o),a[i].m(e,o),C(e,r,o),l=!0},p(e,n){const l={};4&n[0]&&(l.text=e[127].designation),t.$set(l);let d=i;i=c(e),i===d?a[i].p(e,n):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),o=a[i],o?o.p(e,n):(o=a[i]=s[i](e),o.c()),pe(o,1),o.m(r.parentNode,r))},i(e){l||(pe(t.$$.fragment,e),pe(o),l=!0)},o(e){$e(t.$$.fragment,e),$e(o),l=!1},d(e){xe(t,e),e&&j(n),a[i].d(e),e&&j(r)}}}function Cs(e){let t,n,i,o;function r(t){e[67](t)}let l={title:"",$$slots:{default:[js]},$$scope:{ctx:e}};return void 0!==e[21]&&(l.checked=e[21]),n=new e[27]({props:l}),K.push((()=>we(n,"checked",r))),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","askNext"),M(t,"margin-top","1em"),M(t,"margin-left","23em")},m(e,i){C(e,t,i),ke(n,t,null),o=!0},p(e,t){const o={};512&t[4]&&(o.$$scope={dirty:t,ctx:e}),!i&&2097152&t[0]&&(i=!0,o.checked=e[21],re((()=>i=!1))),n.$set(o)},i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){$e(n.$$.fragment,e),o=!1},d(e){e&&j(t),xe(n)}}}function js(e){let t;return{c(){t=q("span"),t.textContent="Weiter erfassen",M(t,"margin-left",".75em")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ns(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function qs(e){let t,n,i,o,r;t=new e[25]({props:{class:"close",disabled:e[22],form:e[31],filled:!0,type:"submit",$$slots:{default:[Es]},$$scope:{ctx:e}}});let l=e[4]&&!e[22]&&Fs(e),s=e[19]&&zs(e);return{c(){be(t.$$.fragment),n=F(),l&&l.c(),i=F(),s&&s.c(),o=D()},m(e,a){ke(t,e,a),C(e,n,a),l&&l.m(e,a),C(e,i,a),s&&s.m(e,a),C(e,o,a),r=!0},p(e,n){const r={};4194304&n[0]&&(r.disabled=e[22]),512&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[4]&&!e[22]?l?(l.p(e,n),4194320&n[0]&&pe(l,1)):(l=Fs(e),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=zs(e),s.c(),pe(s,1),s.m(o.parentNode,o)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){r||(pe(t.$$.fragment,e),pe(l),pe(s),r=!0)},o(e){$e(t.$$.fragment,e),$e(l),$e(s),r=!1},d(e){xe(t,e),e&&j(n),l&&l.d(e),e&&j(i),s&&s.d(e),e&&j(o)}}}function Ls(e){let t,n,i,o;t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Rs]},$$scope:{ctx:e}}}),t.$on("click",e[52]);let r=e[20]&&Ps(e);return{c(){be(t.$$.fragment),n=F(),r&&r.c(),i=D()},m(e,l){ke(t,e,l),C(e,n,l),r&&r.m(e,l),C(e,i,l),o=!0},p(e,n){const o={};512&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[20]?r?(r.p(e,n),1048576&n[0]&&pe(r,1)):(r=Ps(e),r.c(),pe(r,1),r.m(i.parentNode,i)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(t.$$.fragment,e),pe(r),o=!0)},o(e){$e(t.$$.fragment,e),$e(r),o=!1},d(e){xe(t,e),e&&j(n),r&&r.d(e),e&&j(i)}}}function Es(e){let t;return{c(){t=E("Speichern und schliessen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Fs(e){let t,n;return t=new e[25]({props:{form:e[31],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[Ds]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ds(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function zs(e){let t,n,i,o,r;const l=[As,Ts],s=[];t=function(e,t){return e[39]?0:1}(e),n=s[t]=l[t](e);let a=e[20]&&Ms(e);return{c(){n.c(),i=F(),a&&a.c(),o=D()},m(e,n){s[t].m(e,n),C(e,i,n),a&&a.m(e,n),C(e,o,n),r=!0},p(e,t){n.p(e,t),e[20]?a?(a.p(e,t),1048576&t[0]&&pe(a,1)):(a=Ms(e),a.c(),pe(a,1),a.m(o.parentNode,o)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe())},i(e){r||(pe(n),pe(a),r=!0)},o(e){$e(n),$e(a),r=!1},d(e){s[t].d(e),e&&j(i),a&&a.d(e),e&&j(o)}}}function Ts(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[Bs]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[50](e[1]))&&e[50](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function As(e){let t,n;return t=new d({props:{text:e[39],extended:!0,$$slots:{default:[Vs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Bs(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Os(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Vs(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[Os]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[50](e[1]))&&e[50](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ms(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Ws]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[51](e[1]))&&e[51](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ws(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Rs(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Erstellen",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Ps(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Hs]},$$scope:{ctx:e}}}),t.$on("click",e[53]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Hs(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Qs(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ys(e){let t,n,i,o;ds.title=t=e[23];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Qs,then:ps,catch:fs,value:126,blocks:[,,,]};return he(e[42](),r),{c(){n=F(),i=D(),r.block.c()},m(e,t){C(e,n,t),C(e,i,t),r.block.m(e,r.anchor=t),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(n,i){e=n,(!o||8388608&i[0])&&t!==(t=e[23])&&(ds.title=t),ge(r,e,i)},i(e){o||(pe(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}let Gs=new Map,Us=new Map,Js=new Map;const Ks=(e,t)=>{const i=t;return Gs.has(i)||Gs.set(i,n.getTasksList(t).then((({data:e})=>e))),Gs.get(i)},Zs=(e,t,i,o=!1)=>Us.get(i)||o?n.getTaskList(e,i).then((e=>(Us.set(i,e),e))):Ks(e,t).then((t=>t.find((({_id:e})=>e===i))||n.getTaskList(e,i))).then((e=>(Us.set(i,e),e))),Xs=(e,t)=>{Js.set(e,t)},ea=e=>Js.get(e),ta=(e,t,i=!1)=>!i&&Js.get(t)||n.getTask(e,t).then((e=>(Js.set(t,e),e))),na=(e,t)=>{if(!Gs.get(t))return;const i=t;Gs.set(i,n.getTasksList(t).then((({data:e})=>e)))};function ia(e,r,a){let d,f,p,$,v,y,w,b;I(e,m,(e=>a(78,v=e))),I(e,s,(e=>a(79,y=e))),I(e,o,(e=>a(80,w=e)));const{Divider:k,Button:x,FormField:S,Checkbox:_}=c,{loggedIn:C,currentTasks:j,environment:N}=u;I(e,C,(e=>a(81,b=e))),I(e,j,(e=>a(76,p=e))),I(e,N,(e=>a(77,$=e)));const q=JSON.parse(t.getItem("Locale")),L=G();let E,F,D,z,T,{schema:A}=r,{recID:B}=r,{prevEventID:O=!1}=r,{prev:V=!1}=r,{taskId:M=!1}=r,{description:W=""}=r,{root:R=!1}=r,{readonly:P}=r,{isStandalone:H}=r,U={},J={},K="form-"+A.class+Math.floor(9e3*Math.random()+1e3).toString();const Z=R?"fEmbedded":"fTask",X=R?"sEmbedded":"sTask";let ee="CHF";let te,ne,oe=0,re=0,le=0,se=0,ae=1,ce=!B&&A.list&&1===A.list.length;const de={},ue=A.items.find((e=>"price"===e.name&&!e.properties?.hidden)),me=A.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),fe=A.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),pe=!!ue||!!fe,$e=A.list?.filter((e=>"array"===e.type))?.length>1||pe,he=A.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,ge=!!he,ve=A.list?.filter((e=>"array"===e.type))?.length>1||ge,ye={},we=A.result?.resultDef[0].button?.description;let be,ke,xe,Ie,Se=0,_e=0,Ce=[],je=[],Ne=[],qe={},Le=new Map,Ee=A.class,Fe=A.id,De=!1,ze=-1!==window.location.search.indexOf("next=");const Te=!p?.length||p.find((e=>e===Fe));["readonly","hidden","required"].map((e=>{A.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");Ce.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));A.items.filter((e=>e.selection&&e.constraint)).map((e=>{je.push({name:e.name,selection:e.selection,constraint:e.constraint})}));A.items.filter((e=>e.lookup)).forEach((e=>{Ne.push({name:e.name,lookup:e.lookup})})),A.items.filter((e=>e.properties?.lookup)).forEach((e=>{Ne.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ae=async e=>{if(e?.length)for(const t of e){if(!t.lookup)break;const{name:e}=t;if(U[e])break;const{domain:i,value:o}=t.lookup;if("user"===i&&o){const t=b.user,i={[o]:t},r=await n.getSectionView(e,i);if(r?.length){const[{_id:t}]=r;t&&a(5,U[e]=t,U)}}}},Be=async e=>{if(!A.input)return;if(!A.input.length)return;if(A.input.length<2)return;const t=!e.input.class[0].name&&e.input.class[0].selection;if(!t)return;const i=e.input.class[1].name,[o,r]=e.input.class[1].destination?.split(".");if(!i||!r)return;const l=A.list?.find((e=>e.name===o));if(!l)return;const s=await n.getSchemaByClass(t),c=(await n.getTasks(s.id)).data;if(!c?.length)return;const d=[];for(const e of c)if(e.active??1){const t={};for(const n of l.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);d.push(t)}d.length&&a(5,U[o]=d,U)},Oe=async()=>{for(const e of A.items)"boolean"==typeof e.properties?.value&&a(5,U[e.name]=e.properties.value,U),e.properties?.value?.concatenation&&Ve(e);for(const e of A.list||[])for(const t of e.item)if("array"!==e.type&&"owner"===t.refItem){const i=await n.getSolitaire(t.refItem);i?.length&&a(5,U[e.name][t.name]=g(i[0],t.refPos||t.name),U)}},Ve=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await We(e.refItemNext));a(5,U[e.name]=n,U)},Me=async e=>{const t=Ce.filter((t=>t.refObj===e));if(t?.length){a(16,qe={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:r}=e;if(!n)break;let l,s,c=!i&&U[n];const d=U[n];d&&i&&(c=(await ta(n,d))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==r&&"readonly"!==r||(r="required"===r?r:"disabled",setTimeout((()=>{l=`#${K} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(r,""),s&&!c&&s.removeAttribute(r)}),0)),"hidden"===r&&(l=`#${K} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(16,qe[t]="",qe))}}},We=async e=>{const[t,i]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const l=e.refItem,s=await n.getLastId(A.class,l);if(!s?.length)return(o+r).toString().padStart(i,"0");const a=s[0][l];return((+a?.substring(t,t+i)||o)+r).toString().padStart(i,"0")},Re=(e,t,n,i=!1)=>{const o=n||t.name,r=o.startsWith("_")?o:o.split("_")[0],l=e.find((e=>e.name===r));let s=t.value;if(!l)return s;if(!i&&l.properties?.multi&&(s=U[o]),"dateRange"===l.type){if(null===s)return;let e=new Date(s);if("Invalid Date"==e)return;return e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString()}if(s&&l.type.startsWith("date"))try{return qn(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===l.type&&(s=!!t.checked),"number"===l.type){const e=Number("1.1").toLocaleString(q.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Pe=()=>H?window.close():R?window.singleSpaNavigate("/"):L("back"),He=async(e,t)=>{if(A.input&&A.input.length>1){if(A.input[0]!==e)return;const{recursive:i}=xe.input.class[1];if(t){const o=await n.getTaskOptions(`${e}:${t}`,Fe,i);a(5,U={...U,...o})}else{const e=A.input.slice(1);for(const t of e)a(5,U[t]=[],U)}}},Qe=()=>{let e=0;if(ue){let t=1;me&&(t=ae),e=se*t}fe&&(e=se);let t=0;for(const e in de)t+=de[e];a(9,oe=t+e)},Ye=()=>{let e=0;for(const t in ye)e+=ye[t];a(15,Se=e+ +_e)};i.subscribe((async e=>{if(!e)return;if(!B)return;const t=await n.getSchema(e.eventId);if(!t)return;const i=A.list?.find((e=>e.name===t.class));if(!i)return;const o=await n.getTaskById(e.taskId);((e,t,n)=>{if(!Gs.get(e))return;const i=t;Us.set(i,n)})(o.event,o.docId,o.data);const r=await n.getTask(t.class,o.docId),l=U[t.class].filter((e=>e[t.class]==r._id));l?.length&&l.map((e=>{e[t.class]=o.docId})),a(5,U),a(63,F),a(62,E),a(2,A)})),Q((()=>{Gs=new Map,Us=new Map,Js=new Map,Ge()}));const Ge=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(K))&&++n<20;)await e(50);t&&(()=>{if(B)return;const e=new Set;for(const t of Ce)e.add(t.refObj||Ee);Array.from(e).forEach((e=>Me(e)))})(),Ue()},Ue=()=>{setTimeout((()=>{Array.from(Le).forEach((([e,t])=>{U[e]||a(5,U[e]=t._id,U)}))}),350)};Y((()=>{B&&function(e,t,n=t){e.set(n)}(m,v={[B]:{record:U,lists:J}},v)}));const Je=()=>{const e={};Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,i]=t.name.split("."),o=A.list.find((e=>e.name===n));e[t.name]=Re(o.item,t)}else e[t.name]=Re(A.items,t,t.name.split("_")[0])})),A.list&&A.list.map((t=>{"array"===t.type&&J[t.name]&&(e[t.name]=J[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,i])=>("_delete"!==n&&(e[n]=Re(t.item,{name:n,value:i,checked:i},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const i=A.items.find((t=>t.name===e));i?.properties?.required&&!n&&(t=!1)})),t&&e},Ke=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(2,A=e.schema),"recID"in e&&a(3,B=e.recID),"prevEventID"in e&&a(0,O=e.prevEventID),"prev"in e&&a(60,V=e.prev),"taskId"in e&&a(1,M=e.taskId),"description"in e&&a(58,W=e.description),"root"in e&&a(4,R=e.root),"readonly"in e&&a(59,P=e.readonly),"isStandalone"in e&&a(61,H=e.isStandalone)},e.$$.update=()=>{268435456&e.$$.dirty[1]&&a(22,d=P),4&e.$$.dirty[0]|3&e.$$.dirty[2]&&F&&E&&A.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const i=E.items.find((t=>t.name===e));if(!i)return;if(t!==i.type)return;const o="_"+e;F[e]?a(5,U[e]=F[e],U):a(5,U[e]="",U),F[o]&&a(5,U[o]=F[o],U),a(14,ce=!1)})),16&e.$$.dirty[0]|134217728&e.$$.dirty[1]&&a(23,f=R?W||"enablerr - Form":document.title)},[O,M,A,B,R,U,D,T,ee,oe,re,le,te,ne,ce,Se,qe,be,ke,De,Ie,ze,d,f,k,x,S,_,C,j,N,K,Z,X,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},$e,ve,{name:"weekValue",properties:{decimals:1}},we,Fe,Te,async()=>{if(a(18,ke=[]),$.currency?a(8,ee=$.currency.designation):n.getSectionView("owner",{}).then((e=>{e?.length&&e[0].currency&&n.getSectionView("currency",{_id:e[0].currency}).then((e=>{e?.length&&e[0].designation&&a(8,ee=e[0].designation)}))})),xe=await n.getEvent(Fe),B||(a(17,be=ke),Ae(xe.input?.class),Oe(),Be(xe)),B){if(v&&v[B]){const e=v[B].record;A.items.map((t=>{e[t.name]=Re(A.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(5,U=e),A.list&&A.list.map((e=>{"array"===e.type&&v[B].lists[e.name]&&a(5,U[e.name]=v[B].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]),U)}))}else a(5,U=await n.getTask(A.class,B));a(58,W=h(A,U)),a(19,De=!!A.result?.resultDef),a(10,re=U._tax?._amount),a(11,le=100*U._tax?._rate||"")}if(O){a(59,P=!1),a(62,E=await n.getSchema(O)),"string"==typeof V&&a(63,F=await n.getTask(E.class,V));const e=A.items.find((e=>e.refClass===E.class));a(5,U[e.name]=F._id,U)}if(ve&&(_e=U[he]||0),xe.trigger?.startOn&&!xe.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(59,P=!0),y.role?.length&&A.authorization?.length){const e=A.authorization.some((e=>w?.find((t=>t===e.role&&"edit"===e.activity))));a(59,P||=!e)}if(a(6,D="report"===xe.output.type),$.userSetting){const e=$.userSetting;if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}else n.getUserSettings().then((e=>{if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}));return!0},async e=>{B||a(22,d=!0);const t=e.submitter?.className?.includes("close"),i={};if(Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),o=A.list.find((e=>e.name===t));i[e.name]=Re(o.item,e)}else i[e.name]=Re(A.items,e)})),A.list&&A.list.map((e=>{"array"===e.type&&J[e.name]&&(i[e.name]=J[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]))})),i._event=Fe,i._prevEventId=O,i._taskId=M,z){const e=z.record;for(const t in e)t.includes(".")&&delete e[t];e._event=z.event,e._taskId=z.taskId;const{id:t}=await n.saveData(z.class,e);i[z.class]||(i[z.class]=t)}const{id:o,task:r,tax:s,error:c}=await n.saveData(A.class,i);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(22,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(10,re=s?._amount||0),a(11,le=100*(s?._rate||0)||""),i._id=o;const u=await n.getTaskList(A.class,o);if(L("choose",{row:u}),t)return Pe();if(!B){if(ze){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Fe}/${Fe}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${Fe}/${r}/task`)}},()=>!D&&O?window.history.back():Pe(),async({detail:e})=>{const{row:t}=e;let{eventId:i}=e;if((()=>{if(B)for(const e of Ce)e.refName||Me(e.itemName)})(),B)return;if(i||=t._task?.event,i&&(await(async(e,t)=>{if(!e)return;const i=(await n.getEvent(e)).output.class[0].name,o=Ne.filter((e=>e.lookup===i));if(o?.length)for(const e of o){const{lookup:n,name:i}=e;let o="";if(t){let e=await ta(n,t);e&&e[i]?.length&&(o=e[i][0][i])}a(5,U[i]=o,U)}})(i,t._id),A.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const t=await n.getEvent(i);t.output.class[0]?.name===e.properties.lookup&&a(5,U[e.name]="",U)}))),await(async()=>{let e,t=!1;const i={...U};for(const o of A.items)o.refItem&&U[o.refItem]&&(e=await n.getTask(o.refItem,U[o.refItem]),e&&(i[o.name]=e[o.name],t=!0));for(const o of A.list||[])if(o.refItem&&U[o.refItem]){e=await n.getTask(o.refItem,U[o.refItem]);const r=[];for(const n of e[o.name]){const e={};for(const t of o.item)n[t.name]&&(e[t.name]=n[t.name]);r.push(e),t=!0}i[o.name]=r}t&&a(5,U=i)})(),!t._task)return;const o=t._task.event,r=await n.getEvent(o);if(!xe.output?.class?.length)return;const l=xe.output.class[0]?.item.find((e=>(e.refClass||e.name)===r.output.class[0]?.name));(xe.input?.class?.length&&xe.input.class[0].name===r.output.class[0]?.name||l?.asInput)&&(a(62,E=await n.getSchema(o)),a(0,O=o),a(1,M=t._task._id),a(63,F=M?await n.getTask(E.class,t._task.docId):{}),He(E.class,t?._task?.docId))},async({detail:e})=>{if(a(7,T=e),"quantity"===e.itemName&&a(13,ne=U.quantity),(async(e,t)=>{const n=je.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(12,te=!1);for(const i of n){const{selection:n,constraint:o,name:r}=i;if(t)break;a(5,U[r]="",U),e===n&&a(12,te=o);const l=U[n];if(l&&e===o){let e=await ta(n,l);const t=U[o];if(t?.length){const n=t[0].split(", ");e=e[o];let i="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(i=t[r])}));a(5,U[r]=i,U)}}}}})(e.itemName,e.oldValue===e.value),Me(e.itemName),ve&&he&&(e.itemName===he&&(_e=+e.value),Ye()),pe&&$e){if(e.itemName===ue?.name)se=e.value;else if(e.itemName===me?.name)ae=e.value;else{if(e.itemName!==fe?.name)return;se=e.value}Qe()}},async({detail:e})=>{if(!(A.input?.length&&A.input.length>1))return;if(E?.class!==A.input[0])return;const{value:t,lookup:i,view:o}=e;if(!i)return;const[r]=i.split(":"),l=(await n.getSectionView(r,{[o]:{$in:t}})).map((e=>e._id));for(const e of A.input.slice(1)){a(5,U[e]=[],U);const t=await n.getSchemaByClass(e);t.id;let i=await n.getTasks(t.id);if(i=i.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[r]))),i?.length){const t=i.map((e=>e._id)),o=await n.getSectionView(e,{_id:{$in:t}});for(const t of o)t[e]=t._id;a(5,U[e]=o,U)}}},({detail:e})=>{J[e.listName]=e.value,$e&&(de[e.listName]=e.amountValue,Qe()),ve&&(ye[e.listName]=e.weeksValue||0,Ye())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const t=await n.getReportDoc(e)||{},{userReportId:i,type:o}=t;if(!i)return;const r="/api/userreport/"+i;if("ics"===o)return window.open(r,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+r+"&type="+o;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await n.getDocData(M);(async(e,t)=>{const n=window.screen.height,i=window.open("","_blank","width=800,height="+n+",location=no");await ie(),i?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),i?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),A.identity.designation)},async()=>{const e=Je();if(!e)return;const t=xe.result?.resultDef[0]?.addToReports;if(t){const i=e[t];if(i){const t={docId:i},o=(await n.getSectionView("_task",t))[0];e._taskId=o._id}}const{reportId:i,type:o}=await n.createReport(Fe,e);Ke(i),setTimeout(Pe,2e3)},async()=>{const e=Je();if(!e)return;const t=await n.getReportData(Fe,e),i=window.screen.height,o=window.open("","_blank","width=800,height="+i+",location=no");await ie(),o?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(t,null,4)+"</textarea>")},async({detail:{className:e,itemName:t,value:i}})=>{if(Ee!==i)return;if(Le.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===Ee))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&Le.set(e,r[0])},({detail:e})=>{z=e},({detail:e})=>{setTimeout((()=>{a(5,U[e.itemName]=e.value,U)}),200)},()=>A.result.resultDef[0].button?.designation||"Dokument erstellen",W,P,V,H,E,F,function(e){oe=e,a(9,oe)},function(e){re=e,a(10,re)},function(e){Se=e,a(15,Se)},function(e){ze=e,a(21,ze)}]}class oa extends Se{constructor(e){var t;super(),ds.getElementById("svelte-9xiaib-style")||((t=q("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(ds.head,t)),Ie(this,e,ia,Ys,x,{schema:2,recID:3,prevEventID:0,prev:60,taskId:1,description:58,root:4,readonly:59,isStandalone:61},[-1,-1,-1,-1,-1])}}function ra(e){let t,n,i;function o(t){e[4](t)}let r={schema:e[5],recID:e[6]};return void 0!==e[0]&&(r.description=e[0]),t=new oa({props:r}),K.push((()=>we(t,"description",o))),t.$on("back",e[2]),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};32&i&&(o.schema=e[5]),64&i&&(o.recID=e[6]),!n&&1&i&&(n=!0,o.description=e[0],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function la(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[ra,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,[n]){const i={};1&n&&(i.description=e[0]),353&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sa(e,t,i){let o,{refresh:r}=t;return e.$$set=e=>{"refresh"in e&&i(3,r=e.refresh)},[o,(e,t)=>n.getSchema(e).then((n=>({schema:n,recID:t,eventID:e,title:n.identity.designation}))),e=>{},r,function(e){o=e,i(0,o)}]}function aa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ca,da,ua=(ca=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r="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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==r(e))throw new Error("single-spa-svelte requires a configuration object");var t=i(i({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(l),r=Object.keys(e).reduce((function(t,n){return o.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),l=o();t.instance=new e.component(i(i({},r),{},{target:l,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},ca(da={exports:{}},da.exports),da.exports);const ma=aa(ua)({component:class extends Se{constructor(e){super(),Ie(this,e,sa,la,x,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:fa,mount:pa,unmount:$a}=ma;e({bootstrap:fa,mount:pa,unmount:$a});e("Form",oa),e("List",Nt),e("Template",class extends Se{constructor(e){var t;super(),En.getElementById("svelte-1phofh5-style")||((t=q("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(En.head,t)),Ie(this,e,Qn,Pn,x,{schema:0,record:1})}})}}}));
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,i,o,r,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Storage,n=e.Request,i=e.task_notification,o=e.currentRoles,r=e.TextArea,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.638");const f=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}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,i)=>{let[o,r]=i.split(".");if(e.list?.find((({name:e})=>e===o))&&r&&void 0!==n[o]){const e=`${o}_${r}`;n[e]=n[o][r],o=e}return t.find((e=>e===o))||t.push(o),t}),[]).map((e=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")},g=(e,t)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)??""}catch{return""}};function v(){}function y(e){return e()}function w(){return Object.create(null)}function b(e){e.forEach(y)}function k(e){return"function"==typeof e}function x(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function I(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return v;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function C(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode.removeChild(e)}function N(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function q(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function E(e){return document.createTextNode(e)}function D(){return E(" ")}function F(){return E("")}function z(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function T(e){return function(t){return t.preventDefault(),e.call(this,t)}}function A(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function B(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function O(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function V(e,t){e.value=null==t?"":t}function M(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function W(e,t,n){e.classList[n?"add":"remove"](t)}let R;function P(e){R=e}function H(){if(!R)throw new Error("Function called outside component initialization");return R}function Q(e){H().$$.on_mount.push(e)}function Y(e){H().$$.on_destroy.push(e)}function G(){const e=H();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);i.slice().forEach((t=>{t.call(e,o)}))}}}function U(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const J=[],K=[],Z=[],X=[],ee=Promise.resolve();let te=!1;function ne(){te||(te=!0,ee.then(ae))}function ie(){return ne(),ee}function oe(e){Z.push(e)}function re(e){X.push(e)}let le=!1;const se=new Set;function ae(){if(!le){le=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];P(t),ce(t.$$)}for(P(null),J.length=0;K.length;)K.pop()();for(let e=0;e<Z.length;e+=1){const t=Z[e];se.has(t)||(se.add(t),t())}Z.length=0}while(J.length);for(;X.length;)X.pop()();te=!1,le=!1,se.clear()}}function ce(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(oe)}}const de=new Set;let ue;function me(){ue={r:0,c:[],p:ue}}function fe(){ue.r||b(ue.c),ue=ue.p}function pe(e,t){e&&e.i&&(de.delete(e),e.i(t))}function $e(e,t,n,i){if(e&&e.o){if(de.has(e))return;de.add(e),ue&&ue.c.push((()=>{de.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function he(e,t){const n=t.token={};function i(e,i,o,r){if(t.token!==n)return;t.resolved=r;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=r);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==i&&e&&(me(),$e(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),fe())})):t.block.d(1),s.c(),pe(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[i]=s),a&&ae()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=H();if(e.then((e=>{P(n),i(t.then,1,t.value,e),P(null)}),(e=>{if(P(n),i(t.catch,2,t.error,e),P(null),!t.hasCatch)throw e})),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}var o}function ge(e,t,n){const i=t.slice(),{resolved:o}=e;e.current===e.then&&(i[e.value]=o),e.current===e.catch&&(i[e.error]=o),e.block.p(i,n)}const ve="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ye(e,t){$e(e,1,1,(()=>{t.delete(e.key)}))}function we(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function be(e){e&&e.c()}function ke(e,t,n,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=e.$$;o&&o.m(t,n),i||oe((()=>{const t=r.map(y).filter(k);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(oe)}function xe(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(e,t,n,i,o,r,l=[-1]){const s=R;P(e);const a=e.$$={fragment:null,ctx:null,props:r,update:v,not_equal:o,bound:w(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:w(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const r=i.length?i[0]:n;return a.ctx&&o(a.ctx[t],a.ctx[t]=r)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](r),c&&function(e,t){-1===e.$$.dirty[0]&&(J.push(e),ne(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!i&&i(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(j)}else a.fragment&&a.fragment.c();t.intro&&pe(e.$$.fragment),ke(e,t.target,t.anchor,t.customElement),ae()}P(s)}class Se{$destroy(){xe(this,1),this.$destroy=v}$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 _e(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("polyline"),o=L("line"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"points","8 12 12 16 16 12"),B(o,"x1","12"),B(o,"y1","8"),B(o,"x2","12"),B(o,"y2","16"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-arrow-down-circle "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-arrow-down-circle "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ce(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class je extends Se{constructor(e){super(),Ie(this,e,Ce,_e,x,{size:0,strokeWidth:1,class:2})}}function Ne(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),B(i,"points","22 4 12 14.01 9 11.01"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-check-circle "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-check-circle "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function qe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Le extends Se{constructor(e){super(),Ie(this,e,qe,Ne,x,{size:0,strokeWidth:1,class:2})}}function Ee(e){let t,n,i;return{c(){t=L("svg"),n=L("path"),B(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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",i="feather feather-command "+e[2])},m(e,i){C(e,t,i),_(t,n)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-command "+e[2])&&B(t,"class",i)},i:v,o:v,d(e){e&&j(t)}}}function De(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Fe extends Se{constructor(e){super(),Ie(this,e,De,Ee,x,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,i,o;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),B(n,"points","9 10 4 15 9 20"),B(i,"d","M20 4v7a4 4 0 0 1-4 4H4"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Te(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ae extends Se{constructor(e){super(),Ie(this,e,Te,ze,x,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("line"),o=L("line"),B(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),B(i,"x1","18"),B(i,"y1","9"),B(i,"x2","12"),B(i,"y2","15"),B(o,"x1","12"),B(o,"y1","9"),B(o,"x2","18"),B(o,"y2","15"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-delete "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Oe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ve extends Se{constructor(e){super(),Ie(this,e,Oe,Be,x,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),o=L("line"),B(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),B(i,"points","15 3 21 3 21 9"),B(o,"x1","10"),B(o,"y1","14"),B(o,"x2","21"),B(o,"y2","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-external-link "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-external-link "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function We(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Re extends Se{constructor(e){super(),Ie(this,e,We,Me,x,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("line"),o=L("path"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"x1","2"),B(i,"y1","12"),B(i,"x2","22"),B(i,"y2","12"),B(o,"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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-globe "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-globe "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function He(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Qe extends Se{constructor(e){super(),Ie(this,e,He,Pe,x,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(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"),B(i,"points","22,6 12,13 2,6"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-mail "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-mail "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ge(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ue extends Se{constructor(e){super(),Ie(this,e,Ge,Ye,x,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("circle"),B(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),B(i,"cx","12"),B(i,"cy","10"),B(i,"r","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-map-pin "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-map-pin "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ke(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ze extends Se{constructor(e){super(),Ie(this,e,Ke,Je,x,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("line"),o=L("path"),B(n,"points","23 7 23 1 17 1"),B(i,"x1","16"),B(i,"y1","8"),B(i,"x2","23"),B(i,"y2","1"),B(o,"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"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-phone-outgoing "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-phone-outgoing "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function et(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class tt extends Se{constructor(e){super(),Ie(this,e,et,Xe,x,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),o=L("rect"),B(n,"points","6 9 6 2 18 2 18 9"),B(i,"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"),B(o,"x","6"),B(o,"y","14"),B(o,"width","12"),B(o,"height","8"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-printer "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-printer "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function it(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class ot extends Se{constructor(e){super(),Ie(this,e,it,nt,x,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,i,o;return{c(){t=L("svg"),n=L("circle"),i=L("line"),B(n,"cx","11"),B(n,"cy","11"),B(n,"r","8"),B(i,"x1","21"),B(i,"y1","21"),B(i,"x2","16.65"),B(i,"y2","16.65"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-search "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function lt(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class st extends Se{constructor(e){super(),Ie(this,e,lt,rt,x,{size:0,strokeWidth:1,class:2})}}const{document:at}=ve;function ct(e){e[45]=e[46].items}function dt(e,t,n){const i=e.slice();return i[47]=t[n],i[49]=n,i}function ut(e,t,n){const i=e.slice();return i[50]=t[n],i}function mt(e,t,n){const i=e.slice();return i[50]=t[n],i}function ft(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function pt(e){let t,n,i,o,r,l;ct(e);let s=e[5]?.length&&$t(e),a=e[45]?.length&&gt(e),c=e[5]?.length&&wt(e);return{c(){s&&s.c(),t=D(),n=q("div"),i=q("table"),a&&a.c(),o=D(),r=q("tbody"),c&&c.c(),B(i,"striped",""),B(i,"class","svelte-v0ogws"),B(n,"class","eList svelte-v0ogws")},m(e,d){s&&s.m(e,d),C(e,t,d),C(e,n,d),_(n,i),a&&a.m(i,null),_(i,o),_(i,r),c&&c.m(r,null),l=!0},p(e,n){ct(e),e[5]?.length?s?(s.p(e,n),32&n[0]&&pe(s,1)):(s=$t(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[45]?.length?a?a.p(e,n):(a=gt(e),a.c(),a.m(i,o)):a&&(a.d(1),a=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&pe(c,1)):(c=wt(e),c.c(),pe(c,1),c.m(r,null)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe())},i(e){l||(pe(s),pe(c),l=!0)},o(e){$e(s),$e(c),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),a&&a.d(),c&&c.d()}}}function $t(e){let t,n,i,o,r,l,s,a,c,d,u,m=e[6]&&ht(e);function f(t){e[29](t)}let p={id:e[10]};return void 0!==e[3]&&(p.value=e[3]),o=new e[8]({props:p}),K.push((()=>we(o,"value",f))),o.$on("input",e[14]),a=new Ve({props:{size:"18"}}),{c(){m&&m.c(),t=D(),n=q("div"),i=E("Suchen: "),be(o.$$.fragment),l=D(),s=q("span"),be(a.$$.fragment),B(s,"class","feather pointer svelte-v0ogws"),M(n,"margin-bottom","1em"),M(n,"position","relative")},m(r,f){m&&m.m(r,f),C(r,t,f),C(r,n,f),_(n,i),ke(o,n,null),_(n,l),_(n,s),ke(a,s,null),c=!0,d||(u=z(s,"click",e[16]),d=!0)},p(e,n){e[6]?m?64&n[0]&&pe(m,1):(m=ht(e),m.c(),pe(m,1),m.m(t.parentNode,t)):m&&(me(),$e(m,1,1,(()=>{m=null})),fe());const i={};!r&&8&n[0]&&(r=!0,i.value=e[3],re((()=>r=!1))),o.$set(i)},i(e){c||(pe(m),pe(o.$$.fragment,e),pe(a.$$.fragment,e),c=!0)},o(e){$e(m),$e(o.$$.fragment,e),$e(a.$$.fragment,e),c=!1},d(e){m&&m.d(e),e&&j(t),e&&j(n),xe(o),xe(a),d=!1,u()}}}function ht(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gt(e){let t,n,i,o=e[4]&&e[0]&&vt(),r=e[45],l=[];for(let t=0;t<r.length;t+=1)l[t]=yt(mt(e,r,t));return{c(){t=q("thead"),n=q("tr"),o&&o.c(),i=D();for(let e=0;e<l.length;e+=1)l[e].c();B(n,"class","svelte-v0ogws"),B(t,"class","svelte-v0ogws")},m(e,r){C(e,t,r),_(t,n),o&&o.m(n,null),_(n,i);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=vt(),o.c(),o.m(n,i)):o&&(o.d(1),o=null),8196&t[0]){let i;for(r=e[45],i=0;i<r.length;i+=1){const o=mt(e,r,i);l[i]?l[i].p(o,t):(l[i]=yt(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),o&&o.d(),N(l,e)}}}function vt(e){let t;return{c(){t=q("th"),B(t,"class","svelte-v0ogws")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function yt(e){let t,n,i=e[50]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,t){4&t[0]&&i!==(i=e[50]?.designation+"")&&O(n,i)},d(e){e&&j(t)}}}function wt(e){let t,n,i=[],o=new Map,r=e[5];const l=e=>e[47]._id;for(let t=0;t<r.length;t+=1){let n=dt(e,r,t),s=l(n);o.set(s,i[t]=It(s,n))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,o){for(let t=0;t<i.length;t+=1)i[t].m(e,o);C(e,t,o),n=!0},p(e,n){178239&n[0]&&(r=e[5],me(),i=function(e,t,n,i,o,r,l,s,a,c,d,u){let m=e.length,f=r.length,p=m;const $={};for(;p--;)$[e[p].key]=p;const h=[],g=new Map,v=new Map;for(p=f;p--;){const e=u(o,r,p),s=n(e);let a=l.get(s);a?i&&a.p(e,t):(a=c(s,e),a.c()),g.set(s,h[p]=a),s in $&&v.set(s,Math.abs(p-$[s]))}const y=new Set,w=new Set;function b(e){pe(e,1),e.m(s,d),l.set(e.key,e),d=e.first,f--}for(;m&&f;){const t=h[f-1],n=e[m-1],i=t.key,o=n.key;t===n?(d=t.first,m--,f--):g.has(o)?!l.has(i)||y.has(i)?b(t):w.has(o)?m--:v.get(i)>v.get(o)?(w.add(i),b(t)):(y.add(o),m--):(a(n,l),m--)}for(;m--;){const t=e[m];g.has(t.key)||a(t,l)}for(;f;)b(h[f-1]);return h}(i,n,l,1,e,r,o,t.parentNode,ye,It,t,dt),fe())},i(e){if(!n){for(let e=0;e<r.length;e+=1)pe(i[e]);n=!0}},o(e){for(let e=0;e<i.length;e+=1)$e(i[e]);n=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&j(t)}}}function bt(e){let t,n,i,o,r,l,s=e[4]&&e[0]&&kt(e),a=e[45],c=[];for(let t=0;t<a.length;t+=1)c[t]=xt(ut(e,a,t));return{c(){t=q("tr"),s&&s.c(),n=D();for(let e=0;e<c.length;e+=1)c[e].c();i=D(),B(t,"class","pointer svelte-v0ogws"),W(t,"active",e[47]._id===e[1])},m(a,d){C(a,t,d),s&&s.m(t,null),_(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);_(t,i),o=!0,r||(l=z(t,"click",A((function(){k(e[12](e[47],e[49]))&&e[12](e[47],e[49]).apply(this,arguments)}))),r=!0)},p(o,r){if((e=o)[4]&&e[0]?s?(s.p(e,r),17&r[0]&&pe(s,1)):(s=kt(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),10276&r[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=ut(e,a,n);c[n]?c[n].p(o,r):(c[n]=xt(o),c[n].c(),c[n].m(t,i))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}34&r[0]&&W(t,"active",e[47]._id===e[1])},i(e){o||(pe(s),o=!0)},o(e){$e(s),o=!1},d(e){e&&j(t),s&&s.d(),N(c,e),r=!1,l()}}}function kt(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=q("td"),be(n.$$.fragment),B(t,"class","editRow svelte-v0ogws"),M(t,"color","#326173")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",A((function(){k(e[17](e[47]))&&e[17](e[47]).apply(this,arguments)}))),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function xt(e){let t,n,i,o=e[11](e[47],e[50])+"";return{c(){t=q("td"),n=E(o),B(t,"class",i=S(e[50].type)+" svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,r){36&r[0]&&o!==(o=e[11](e[47],e[50])+"")&&O(n,o),4&r[0]&&i!==(i=S(e[50].type)+" svelte-v0ogws")&&B(t,"class",i)},d(e){e&&j(t)}}}function It(e,t){let n,i,o,r=t[15](t[47],t[45],t[3]),l=r&&bt(t);return{key:e,first:null,c(){n=F(),l&&l.c(),i=F(),this.first=n},m(e,t){C(e,n,t),l&&l.m(e,t),C(e,i,t),o=!0},p(e,n){t=e,44&n[0]&&(r=t[15](t[47],t[45],t[3])),r?l?(l.p(t,n),44&n[0]&&pe(l,1)):(l=bt(t),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe())},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(n),l&&l.d(e),e&&j(i)}}}function St(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _t(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:St,then:pt,catch:ft,value:46,blocks:[,,,]};return he(n=e[2]&&e[13](),o),{c(){t=F(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,4&i[0]&&n!==(n=e[2]&&e[13]())&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}const Ct=e("getDisplayItems",((e,t,n)=>{if(!e)return;let i=[];return e.forEach((e=>{if("_total"===e)return void i.push({name:"_total",designation:"Betrag",type:"number"});const[o,r]=e.split(".");let l=t.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,n=n.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e)))),l||(l=t.items.find((e=>e.name===o))),i.find((e=>e?.name===o))||i.push(l)})),i.length?i:t.items}));function jt(e,o,r){let l;let s=JSON.parse(t.getItem("Locale")).id;const a=G(),{Loading:d,TextField:m}=c,{currentTasks:p}=u;I(e,p,(e=>r(33,l=e)));let h,g,v,y,{inputList:w}=o,{eventId:b}=o,{prevEventId:k}=o,{className:x}=o,{rowId:S}=o,{filterForReady:_=!1}=o,{refStatus:C}=o,{showEdit:j=!1}=o,{praefix:N=""}=o,{selectionFields:q=!1}=o,{deList:L}=o,{stopAggregation:E=!1}=o,{inputSearch:D=""}=o,F=!0,z=D,T=x+Math.floor(9e3*Math.random()+1e3).toString()+"search",A=!1,B=!0;const O=(e,t)=>{if(!t)return;let n=e[t.name];if("number"===t.type&&Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}return"number"===t.type&&(n=Number(n)?n.toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||0,maximumFractionDigits:t.decimals||0}):""),"number"===t.type?n:"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},V=n.getSchemaByClass(x),M=async(e,t)=>{if(C)return r(18,C=[].concat(C)),e.filter((e=>!!C.find((t=>e._task.status===t))));if("Information"===t.state.task)return e;if(k){const t=await n.getEvent(k);if("report"===t?.output?.type)return e;if(t?.input?.class?.length&&t.input.class[0].name===x)return"Information"===t.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))},W=(e,t)=>{if(e){const n="string"==typeof e?e:Object.keys(e)[0],i=new Intl.Collator(s,{numeric:!0});return t.sort(((e,t)=>i.compare(e[n],t[n])))}return t},R=async e=>{let t,i=0;B=!1;const o=e=>new Promise((t=>setTimeout(t,e)));for(;i++<200&&!E&&!(t=await P(e));)await o(500);r(6,A=!1),E&&n.readTasksByAggregationId(e,!0),t&&(r(5,v=W(g.displaySort,t.data)),window.setTimeout((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),B=!0}),100))},P=async e=>await n.readTasksByAggregationId(e),H=async(e,t,n,i)=>{const{value:o,refClass:r}=i,[l,s]=n.split("."),a=o?.get(N),c=a&&await ta(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let i=e?.find((e=>e._id===n[t]))||{};i={...i};for(const e in i)n[e]&&(i[e]=n[e]);for(const e in n)n[e]&&(i[e]=n[e]);return Xs(r+i._id.toString(),i),i})):e};Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(T)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await V;e.eventId===t.id&&(na(t.class,e.eventId),r(2,F=!r(2,F=!1)))}));return e.$$set=e=>{"inputList"in e&&r(20,w=e.inputList),"eventId"in e&&r(21,b=e.eventId),"prevEventId"in e&&r(22,k=e.prevEventId),"className"in e&&r(23,x=e.className),"rowId"in e&&r(1,S=e.rowId),"filterForReady"in e&&r(24,_=e.filterForReady),"refStatus"in e&&r(18,C=e.refStatus),"showEdit"in e&&r(0,j=e.showEdit),"praefix"in e&&r(25,N=e.praefix),"selectionFields"in e&&r(26,q=e.selectionFields),"deList"in e&&r(27,L=e.deList),"stopAggregation"in e&&r(19,E=e.stopAggregation),"inputSearch"in e&&r(28,D=e.inputSearch)},[j,S,F,z,h,v,A,d,m,p,T,O,(e,t)=>n=>{r(19,E=!0);const i=B?e:y[t];a("choose",{row:i})},async()=>{g=await V,r(4,h=(e=>!l?.length||!!l.find((t=>t===e)))(g.id)),r(5,v=y=W(g.displaySort,w||await Ks(g.class,g.id))),500===v?.length&&(r(6,A=!0),n.getTasksList(g.id,!1,!0).then((({aggregationId:e})=>R(e))));let e,t=!1,i="";const o=q&&q?.find((e=>g.class===e.refClass.split(":")[0])),s=o?.value?.get&&o.value.get(N);if(s){const[l,a]=o.refClass.split(":");g.class===l&&r(5,v=await H(v,l,a,o)),t=o.parentClass?.find((e=>"quantity"===e.name)),i=o.className,e=await n.getCountedSection(i,a.split(".")[0],s,l,"quantity")}r(0,j&&=!o),o||!_&&!C||r(5,v=await M(v,g));const{display:c}=g;let d=Ct(c,g,v);return!j&&t?(d=d.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),r(5,v=v.map((t=>{const n=e.find((e=>e._id===t._id));return n&&(t.ist=n.quantity.$numberDecimal),t}))),e.map((e=>{if(!v.find((t=>t._id===e._id))){const t=y.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,v.push(t)}})),a("init",v)):L&&r(5,v=v.filter((e=>!L.find((t=>t._id===e._id))))),{items:d}},({detail:{value:e}})=>{r(3,z=e)},(e,t,n)=>{if(!n)return!0;n=n.toLowerCase();let i=!1;for(const o of t){const t=O(e,o).toLowerCase();!i&&t.includes(n)&&(i=!0)}return i},()=>{r(3,z="")},e=>{window.open(`/task/${e._task.event}/${e._task._id}/task?view=standalone`,"_blank")},C,E,w,b,k,x,_,N,q,L,D,function(e){z=e,r(3,z)}]}class Nt extends Se{constructor(e){var t;super(),at.getElementById("svelte-v0ogws-style")||((t=q("style")).id="svelte-v0ogws-style",t.textContent=".feather.svelte-v0ogws.svelte-v0ogws{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-v0ogws.svelte-v0ogws{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-v0ogws .editRow.svelte-v0ogws{width:1em}.eList.svelte-v0ogws table.svelte-v0ogws{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-v0ogws table thead.svelte-v0ogws{position:sticky;top:0;background:#326173;color:white}.eList.svelte-v0ogws table thead tr.svelte-v0ogws{height:2.3em}.eList.svelte-v0ogws table tbody tr.svelte-v0ogws{height:2.75em !important}th.svelte-v0ogws.svelte-v0ogws,td.svelte-v0ogws.svelte-v0ogws{padding-left:0.4em;padding-right:0.4em}td.number.svelte-v0ogws.svelte-v0ogws{text-align:end}tr.pointer.svelte-v0ogws.svelte-v0ogws:hover{background-color:#DAE1E5}tr.active.svelte-v0ogws.svelte-v0ogws{color:#326173;background-color:#fcebd5}",_(at.head,t)),Ie(this,e,jt,_t,x,{inputList:20,eventId:21,prevEventId:22,className:23,rowId:1,filterForReady:24,refStatus:18,showEdit:0,praefix:25,selectionFields:26,deList:27,stopAggregation:19,inputSearch:28},[-1,-1])}}function qt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Lt(e){let t,n,i=e[41]&&Et(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[41]?i?(i.p(e,n),8&n[0]&&pe(i,1)):(i=Et(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Et(e){let t,n;return t=new e[21]({props:{title:e[16]?"Auswahl":e[0],class:"eList "+(e[14]?"form":""),$$slots:{default:[Wt]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};65537&n[0]&&(i.title=e[16]?"Auswahl":e[0]),16384&n[0]&&(i.class="eList "+(e[14]?"form":"")),2097150&n[0]|2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Dt(e){let t,n;return t=new oa({props:{schema:e[2],recID:e[1],readonly:e[15]}}),t.$on("choose",(function(){k(e[30](e[41]))&&e[30](e[41]).apply(this,arguments)})),t.$on("back",e[27]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};4&i[0]&&(o.schema=e[2]),2&i[0]&&(o.recID=e[1]),32768&i[0]&&(o.readonly=e[15]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ft(e){let t,n,i,o,r,l,s;t=new e[22]({props:{text:e[16]?"Zusätzliche Auswahl":""}});const a=[Tt,zt],c=[];function d(e,t){return e[16]?0:1}return i=d(e),o=c[i]=a[i](e),l=new Nt({props:{inputSearch:e[12],eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],stopAggregation:e[20],showEdit:e[8]}}),l.$on("edit",e[31]),l.$on("choose",e[34]),l.$on("init",e[32]),{c(){be(t.$$.fragment),n=D(),o.c(),r=D(),be(l.$$.fragment)},m(e,o){ke(t,e,o),C(e,n,o),c[i].m(e,o),C(e,r,o),ke(l,e,o),s=!0},p(e,n){const s={};65536&n[0]&&(s.text=e[16]?"Zusätzliche Auswahl":""),t.$set(s);let u=i;i=d(e),i===u?c[i].p(e,n):(me(),$e(c[u],1,1,(()=>{c[u]=null})),fe(),o=c[i],o?o.p(e,n):(o=c[i]=a[i](e),o.c()),pe(o,1),o.m(r.parentNode,r));const m={};4096&n[0]&&(m.inputSearch=e[12]),4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),1048576&n[0]&&(m.stopAggregation=e[20]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(pe(t.$$.fragment,e),pe(o),pe(l.$$.fragment,e),s=!0)},o(e){$e(t.$$.fragment,e),$e(o),$e(l.$$.fragment,e),s=!1},d(e){xe(t,e),e&&j(n),c[i].d(e),e&&j(r),xe(l,e)}}}function zt(e){let t,n,i,o;n=new e[23]({props:{outline:!0,$$slots:{default:[At]},$$scope:{ctx:e}}}),n.$on("click",e[28]);let r=e[25]&&e[10]&&Bt(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),r&&r.c(),B(t,"class","form--buttons svelte-jb5mrh")},m(e,l){C(e,t,l),ke(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};2048&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[25]&&e[10]?r?(r.p(e,i),1024&i[0]&&pe(r,1)):(r=Bt(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),xe(n),r&&r.d()}}}function Tt(e){let t,n,i,o,r,l,s=e[19]&&Vt(e);return i=new e[23]({props:{outline:!0,$$slots:{default:[Mt]},$$scope:{ctx:e}}}),i.$on("click",e[28]),r=new e[22]({props:{text:"Liste aus "+e[13]}}),{c(){s&&s.c(),t=D(),n=q("div"),be(i.$$.fragment),o=D(),be(r.$$.fragment),B(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),C(e,t,a),C(e,n,a),ke(i,n,null),C(e,o,a),ke(r,e,a),l=!0},p(e,n){e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Vt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe());const o={};2048&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o);const l={};8192&n[0]&&(l.text="Liste aus "+e[13]),r.$set(l)},i(e){l||(pe(s),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),xe(i),e&&j(o),xe(r,e)}}}function At(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Bt(e){let t,n;return t=new e[23]({props:{filled:!0,$$slots:{default:[Ot]},$$scope:{ctx:e}}}),t.$on("click",e[29]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ot(e){let t;return{c(){t=E("Neu")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Vt(e){let t,n;return t=new zl({props:{item:e[17],record:{_id:"",[e[17].name]:""},noForm:"true",classId:"sel_"+e[17].name,eventId:e[18],required:!1,hidden:!1,readonly:!1,deList:e[19]}}),t.$on("notify",e[33]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};131072&n[0]&&(i.item=e[17]),131072&n[0]&&(i.record={_id:"",[e[17].name]:""}),131072&n[0]&&(i.classId="sel_"+e[17].name),262144&n[0]&&(i.eventId=e[18]),524288&n[0]&&(i.deList=e[19]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Mt(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Wt(e){let t,n,i,o;const r=[Ft,Dt],l=[];function s(e,t){return e[41].length&&!e[14]?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Rt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Pt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Rt,then:Lt,catch:qt,value:41,blocks:[,,,]};return he(n=e[26](e[3]),o),{c(){t=F(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,8&i[0]&&n!==(n=e[26](e[3]))&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}function Ht(e,t,i){let o;const{Dialog:r,Divider:l,Button:s}=c,a=G(),{currentTasks:d}=u;I(e,d,(e=>i(37,o=e)));let{title:m}=t,{schema:f}=t,{recID:p}=t,{isOpening:$=!0}=t,{filterForReady:h=!1}=t,{refStatus:g}=t,{praefix:v=""}=t,{selectionFields:y=!1}=t,{showEdit:w=!0}=t,{deList:b}=t,{newAllowed:k=!0}=t,{prevEventId:x}=t,{inputSearch:S}=t,_=f.id;f.class;let C,j,N,q,L,E,D,F="",z=!1,T=!1;m??=f.identity.designation;const A=!o?.length||o.find((e=>e===_));return e.$$set=e=>{"title"in e&&i(0,m=e.title),"schema"in e&&i(2,f=e.schema),"recID"in e&&i(1,p=e.recID),"isOpening"in e&&i(3,$=e.isOpening),"filterForReady"in e&&i(4,h=e.filterForReady),"refStatus"in e&&i(5,g=e.refStatus),"praefix"in e&&i(6,v=e.praefix),"selectionFields"in e&&i(7,y=e.selectionFields),"showEdit"in e&&i(8,w=e.showEdit),"deList"in e&&i(9,b=e.deList),"newAllowed"in e&&i(10,k=e.newAllowed),"prevEventId"in e&&i(11,x=e.prevEventId),"inputSearch"in e&&i(12,S=e.inputSearch)},[m,p,f,$,h,g,v,y,w,b,k,x,S,F,z,C,N,L,E,D,T,r,l,s,d,A,async e=>{if(!e)return!1;const t=await Ks(f.class,f.id);if(j=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),i(16,N=j?.value?.get&&j.value.get(v)),N){q=j.refClass;const[e,t]=q.split(":"),[o]=t.split(".");i(17,L=j.parentClass.find((t=>t.name===e)));const r=await n.getSchemaByClass(L.refClass);i(18,E=r.id),i(13,F=j.parentClass.find((e=>e.name===o)).designation)}return t},()=>{i(14,z=!1),p||a("back"),w||a("back")},()=>{i(20,T=!0),i(14,z=!1),a("back")},()=>{i(20,T=!0),i(1,p=!1),i(15,C=!1),i(14,z=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,i]=t.split(".");let o=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));if(o){e[`${n}_${i}`]=e[n][i]}})),a("choose",{row:e})},({detail:e})=>{i(15,C=!!e._task.visum||"Closed"===e._task.status),i(1,p=e._docId),i(14,z=!0)},({detail:e})=>{N&&i(19,D=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){U(e,t)}]}class Qt extends Se{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Ht,Pt,x,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11,inputSearch:12},[-1,-1])}}const{document:Yt}=ve;function Gt(e){e[27]=e[29].list,e[28]=e[29].items}function Ut(e,t,n){const i=e.slice();return i[30]=t[n],i}function Jt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Kt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Zt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Xt(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Gt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[en]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[28]?.length&&function(e){let t,n,i,o,r=e[28],l=[];for(let t=0;t<r.length;t+=1)l[t]=tn(Kt(e,r,t));return{c(){t=q("thead"),n=q("tr"),i=q("th"),o=D();for(let e=0;e<l.length;e+=1)l[e].c();B(i,"class","svelte-14hcfjl"),B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,r){C(e,t,r),_(t,n),_(n,i),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(r=e[28],i=0;i<r.length;i+=1){const o=Kt(e,r,i);l[i]?l[i].p(o,t):(l[i]=tn(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),N(l,e)}}}(e),k=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=rn(Ut(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(44547&n[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const r=Ut(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=rn(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=D(),c=q("span"),be(d.$$.fragment),u=D(),m=q("div"),f=q("table"),b&&b.c(),p=D(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Gt(e);const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[28]?.length&&b.p(e,t),e[27]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),pe(k),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),$e(k),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function en(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function tn(e){let t,n,i=e[33]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function nn(e){let t,n,i,o,r,l,s,a;i=new Re({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=on(Jt(e,c,t));return{c(){t=q("tr"),n=q("td"),be(i.$$.fragment),o=D();for(let e=0;e<d.length;e+=1)d[e].c();r=D(),B(n,"class","editRow svelte-14hcfjl"),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[30]._id===e[0])},m(c,u){C(c,t,u),_(t,n),ke(i,n,null),_(t,o);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,r),l=!0,s||(a=z(n,"click",e[15](e[30])),s=!0)},p(n,i){if(e=n,3584&i[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const o=Jt(e,c,n);d[n]?d[n].p(o,i):(d[n]=on(o),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&i[0]&&W(t,"active",e[30]._id===e[0])},i(e){l||(pe(i.$$.fragment,e),l=!0)},o(e){$e(i.$$.fragment,e),l=!1},d(e){e&&j(t),xe(i),N(d,e),s=!1,a()}}}function on(e){let t,n,i,o,r=e[9](e[30],e[33])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[30]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function rn(e){let t,n,i=e[13](e[30],e[28],e[1]),o=i&&nn(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){2&n[0]&&(i=e[13](e[30],e[28],e[1])),i?o?(o.p(e,n),2&n[0]&&pe(o,1)):(o=nn(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function ln(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sn(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:ln,then:Xt,catch:Zt,value:29,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=D(),i=F(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function an(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[sn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};3&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function cn(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{classId:p}=t,{className:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,k="",x=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(h);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&na(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(16,m=e.item),"classId"in e&&o(17,p=e.classId),"className"in e&&o(18,h=e.className),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(19,v=e.viewName),"viewValue"in e&&o(20,y=e.viewValue),"recordId"in e&&o(21,w=e.recordId),"filter"in e&&o(22,b=e.filter)},[g,k,r,l,s,a,d,u,x,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S;let t=[];if(m.lookup){const e="."+p+"#"+m.lookup,i=document.querySelector(e),o=i?.value||w;if(o){const e=await ta(m.lookup,o);if(e){const i=e[m.name]?.map((e=>e[m.name]));i&&(t=await n.getSectionView(m.name,{_id:{$in:i}},!0))}}}else{const i="."+p+"#"+v.split(":")[0],o=document.querySelector(i);let r={[v]:o?.value||w};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};r={...r,...e}}}catch{}}r[v]&&(t=await n.getSectionView(e.class,r,!0)),b&&(t=t.filter((e=>e._id!=b)))}const i=e.display;return{list:t,items:Ct(i,e,t)}},({detail:{value:e}})=>{o(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,k="")},e=>async()=>{const t=await n.getTaskByDocId(e._id),i=`/task/${t.event}/${t._id}/task?view=standalone`;window.open(i)},m,p,h,v,y,w,b,()=>r("back"),function(e){k=e,o(1,k)}]}class dn extends Se{constructor(e){var t;super(),Yt.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(Yt.head,t)),Ie(this,e,cn,an,x,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:un}=ve;function mn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function fn(e){let t,n,i=e[57]&&function(e){let t,n,i,o,l,s,a,c,d,u,m,f,p,$,h,g,v,y,w;function b(t){e[44](t)}function k(t){e[45](t)}let x={class:"full-width",id:e[27],rows:"1",required:e[1],disabled:e[3],placeholder:e[28],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[2]&&(x.value=e[2]);void 0!==e[22]&&(x.overwrite=e[22]);n=new r({props:x}),K.push((()=>we(n,"value",b))),K.push((()=>we(n,"overwrite",k))),n.$on("click",e[30]()),n.$on("onFocus",e[30](e[27]));const I=[$n,pn],N=[];function L(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(s=L(e))&&(a=N[s]=I[s](e));let E=(!e[3]||e[14])&&hn(e);function T(t){e[46](t)}let A={class:"tModal",noClickaway:!0,$$slots:{default:[wn]},$$scope:{ctx:e}};void 0!==e[16]&&(A.open=e[16]);p=new e[24]({props:A}),K.push((()=>we(p,"open",T)));let O=e[17]&&bn(e);return{c(){t=q("div"),be(n.$$.fragment),l=D(),a&&a.c(),c=D(),d=q("input"),m=D(),E&&E.c(),f=D(),be(p.$$.fragment),h=D(),O&&O.c(),g=F(),B(d,"class",u=S(e[7]||e[8])+" svelte-jox15l"),B(d,"id",e[5]),B(d,"name",e[5]),d.value=e[0],d.hidden=!0,M(t,"position","relative")},m(i,o){C(i,t,o),ke(n,t,null),_(t,l),~s&&N[s].m(t,null),_(t,c),_(t,d),_(t,m),E&&E.m(t,null),C(i,f,o),ke(p,i,o),C(i,h,o),O&&O.m(i,o),C(i,g,o),v=!0,y||(w=z(t,"keydown",e[31]),y=!0)},p(e,r){const l={};2&r[0]&&(l.required=e[1]),8&r[0]&&(l.disabled=e[3]),!i&&4&r[0]&&(i=!0,l.value=e[2],re((()=>i=!1))),!o&&4194304&r[0]&&(o=!0,l.overwrite=e[22],re((()=>o=!1))),n.$set(l);let m=s;s=L(e),s===m?~s&&N[s].p(e,r):(a&&(me(),$e(N[m],1,1,(()=>{N[m]=null})),fe()),~s?(a=N[s],a?a.p(e,r):(a=N[s]=I[s](e),a.c()),pe(a,1),a.m(t,c)):a=null),(!v||384&r[0]&&u!==(u=S(e[7]||e[8])+" svelte-jox15l"))&&B(d,"class",u),(!v||32&r[0])&&B(d,"id",e[5]),(!v||32&r[0])&&B(d,"name",e[5]),(!v||1&r[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[14]?E?(E.p(e,r),16392&r[0]&&pe(E,1)):(E=hn(e),E.c(),pe(E,1),E.m(t,null)):E&&(me(),$e(E,1,1,(()=>{E=null})),fe());const f={};3260241&r[0]|134217728&r[1]&&(f.$$scope={dirty:r,ctx:e}),!$&&65536&r[0]&&($=!0,f.open=e[16],re((()=>$=!1))),p.$set(f),e[17]?O?(O.p(e,r),131072&r[0]&&pe(O,1)):(O=bn(e),O.c(),pe(O,1),O.m(g.parentNode,g)):O&&(me(),$e(O,1,1,(()=>{O=null})),fe())},i(e){v||(pe(n.$$.fragment,e),pe(a),pe(E),pe(p.$$.fragment,e),pe(O),v=!0)},o(e){$e(n.$$.fragment,e),$e(a),$e(E),$e(p.$$.fragment,e),$e(O),v=!1},d(e){e&&j(t),xe(n),~s&&N[s].d(),E&&E.d(),e&&j(f),xe(p,e),e&&j(h),O&&O.d(e),e&&j(g),y=!1,w()}}}(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[57]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function pn(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[36]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function $n(e){let t,n,i,o,r;return n=new st({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=[z(t,"click",e[30](!0)),z(t,"choose",e[33])],o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,b(r)}}}function hn(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-jox15l")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[35]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function gn(e){let t,n,i,o;const r=[yn,vn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function vn(e){let t,n;return t=new Qt({props:{title:e[6].designation,newAllowed:e[20],prevEventId:e[9],schema:e[15],recID:e[0],isOpening:e[16],filterForReady:e[21],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11],inputSearch:e[32]()}}),t.$on("choose",e[33]),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.title=e[6].designation),1048576&n[0]&&(i.newAllowed=e[20]),512&n[0]&&(i.prevEventId=e[9]),32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),65536&n[0]&&(i.isOpening=e[16]),2097152&n[0]&&(i.filterForReady=e[21]),64&n[0]&&(i.refStatus=e[6].refStatus),4096&n[0]&&(i.selectionFields=e[12]),8192&n[0]&&(i.deList=e[13]),2048&n[0]&&(i.praefix=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yn(e){let t,n;return t=new dn({props:{item:e[6],className:e[15].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[33]),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.item=e[6]),32768&n[0]&&(i.className=e[15].class),256&n[0]&&(i.classId=e[8]),1&n[0]&&(i.rowId=e[0]),1024&n[0]&&(i.recordId=e[10]),16&n[0]&&(i.viewName=e[4]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function wn(e){let t,n,i=e[16]&&gn(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[16]?i?(i.p(e,n),65536&n[0]&&pe(i,1)):(i=gn(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function bn(e){let t,n,i;function o(t){e[47](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[xn]},$$scope:{ctx:e}};return void 0!==e[17]&&(r.open=e[17]),t=new e[24]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};294913&i[0]|134217728&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&131072&i[0]&&(n=!0,o.open=e[17],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function kn(e){let t,n;return t=new oa({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[34]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xn(e){let t,n;return t=new e[23]({props:{title:e[18],$$slots:{default:[kn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};262144&n[0]&&(i.title=e[18]),32769&n[0]|134217728&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function In(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Sn(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:In,then:fn,catch:mn,value:57,blocks:[,,,]};return he(e[29](),i),{c(){t=F(),i.block.c()},m(e,o){C(e,t,o),i.block.m(e,i.anchor=o),i.mount=()=>t.parentNode,i.anchor=t,n=!0},p(t,n){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(e),i.token=null,i=null}}}function _n(e,t,i){let r,l,s;I(e,o,(e=>i(43,r=e)));const a=G(),{Dialog:d,Modal:m}=c,{currentTasks:f,loggedIn:p}=u;I(e,f,(e=>i(49,l=e))),I(e,p,(e=>i(50,s=e)));let{id:$}=t,{item:g}=t,{value:v=""}=t,{desc:y=""}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:k}=t,{recordId:x}=t,{withRefValue:S=!1}=t,{refValue:_=""}=t,{required:C}=t,{disabled:j}=t,{readonly:N}=t,{praefix:q}=t,{selectionFields:L}=t,{formnovalidate:E}=t,{selection:D}=t,{deList:F}=t,{isTemplate:z}=t,{noList:T=!1}=t;const A="comment_"+$;let B,O,V,M,W,R,P=!1,H=!0,Q=!0,Y=!0;N||=x&&g.asInput,j||=N,!D&&g.selection&&1===g.selection.split(":").length&&(D=g.selection);const U=N||j||g.lookup||D&&!g.constraint?"":"Suchbegriff ⏎",J=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},K=e=>{e&&(i(2,y=h(V,e)),a("setRefDesc",y.split(" •")[0]),a("change",{value:v,description:y}),a("task",{row:e,eventId:V.id}))},Z=()=>{i(16,P=!1),i(17,B=!1)};return e.$$set=e=>{"id"in e&&i(5,$=e.id),"item"in e&&i(6,g=e.item),"value"in e&&i(0,v=e.value),"desc"in e&&i(2,y=e.desc),"noForm"in e&&i(7,w=e.noForm),"classId"in e&&i(8,b=e.classId),"eventId"in e&&i(9,k=e.eventId),"recordId"in e&&i(10,x=e.recordId),"withRefValue"in e&&i(37,S=e.withRefValue),"refValue"in e&&i(38,_=e.refValue),"required"in e&&i(1,C=e.required),"disabled"in e&&i(3,j=e.disabled),"readonly"in e&&i(39,N=e.readonly),"praefix"in e&&i(11,q=e.praefix),"selectionFields"in e&&i(12,L=e.selectionFields),"formnovalidate"in e&&i(40,E=e.formnovalidate),"selection"in e&&i(4,D=e.selection),"deList"in e&&i(13,F=e.deList),"isTemplate"in e&&i(14,z=e.isTemplate),"noList"in e&&i(41,T=e.noList)},e.$$.update=()=>{if(2&e.$$.dirty[0]|512&e.$$.dirty[1]&&i(1,C=C&&!E),192&e.$$.dirty[1]&&S&&i(0,v=_),32833&e.$$.dirty[0]|1024&e.$$.dirty[1]&&v&&V&&Promise.resolve(Zs(g.refClass,V.id,v,!!g.lookup||T)).then(K),65&e.$$.dirty[0]|6144&e.$$.dirty[1]&&v&&M&&g.name===M.input?.at(0)&&M.inputLookup?.length){const{domain:e}=M.inputLookup[0]||{};"user"===e&&(r.some((e=>M.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0))}32769&e.$$.dirty[0]&&!v&&V&&K({})},[v,C,y,j,D,$,g,w,b,k,x,q,L,F,z,V,P,B,O,W,H,Q,Y,d,m,f,p,A,U,async()=>{try{const e=await n.getEvent(k);if(R="report"===e.output.type,i(21,Q=!g.asInput),i(20,H=e.output?.class[0].name!==g.refClass),i(15,V=await n.getSchemaByClass(g.refClass)),J(V),i(19,W=(e=>!l?.length||!!l.find((t=>t===e)))(V.id)),i(42,M=await n.getSchema(k)),k&&x&&v&&!j&&M.input?.find((e=>e===g.refClass))&&i(3,j=!0),g.properties?.query?.lookup){const{domain:e,value:t}=g.properties.query.lookup;if("user"===e){const e=s.user,o={[t]:e},l=await n.getSectionView(g.refClass,o);if(l?.length){const[{_id:e}]=l;e&&(i(38,_=e),i(37,S=!0))}r.some((e=>V.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0)}}return i(18,O=V.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if(!0===e&&i(16,P=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(g.lookup||D&&!g.constraint||v)&&i(16,P=!0)},e=>{13==e.which&&(e.preventDefault(),i(16,P=!0))},()=>{if(v)return"";const e=document.getElementById(A);return e?.value||""},({detail:e})=>{i(0,v=e.row._id),Z()},Z,()=>{(R||W)&&(i(0,v=""),i(2,y=""),i(22,Y=!0),a("change",{value:v,description:y}),a("task",{row:{_task:{event:V.id,_id:!1}}}))},async()=>{if(!v)return;const e=await Zs(g.refClass,V.id,v);if(!e._task)return;const t=e._task.task_id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},S,_,N,E,T,M,r,function(e){y=e,i(2,y)},function(e){Y=e,i(22,Y)},function(e){P=e,i(16,P)},function(e){B=e,i(17,B)}]}class Cn extends Se{constructor(e){var t;super(),un.getElementById("svelte-jox15l-style")||((t=q("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(un.head,t)),Ie(this,e,_n,Sn,x,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:37,refValue:38,required:1,disabled:3,readonly:39,praefix:11,selectionFields:12,formnovalidate:40,selection:4,deList:13,isTemplate:14,noList:41},[-1,-1])}}const jn=/\d+/g,Nn=/%[HMSpPdmyY%]/g;function qn(e,t,n){const i=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(Nn);let l=0,s=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,2).toUpperCase();if("AM"===t)o=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;o=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{jn.lastIndex=l;const r=jn.exec(e);if(null==r)return n;switch(t[s]){case"H":a.setHours(parseInt(r[0])+12*o);break;case"M":a.setMinutes(r[0]);break;case"S":a.setSeconds(r[0]);break;case"d":a.setDate(r[0]);break;case"m":a.setMonth(r[0]-1);break;case"y":a.setFullYear(100*i+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}l+=r[0].length}s++}return isNaN(a.valueOf())?n:a}function Ln(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:En}=ve;function Dn(e,t,n){const i=e.slice();return i[17]=t[n],i}function Fn(e,t,n){const i=e.slice();return i[20]=t[n],i}function zn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Tn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Bn(Fn(e,p,t));const h=e=>$e($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&On(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[Mn]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[Wn]},$$scope:{ctx:e}}}),{c(){t=q("form"),n=q("input"),o=D();for(let e=0;e<$.length;e+=1)$[e].c();r=D(),g&&g.c(),l=D(),s=q("div"),be(a.$$.fragment),c=D(),be(d.$$.fragment),B(n,"class",S(e[6])+" svelte-1phofh5"),B(n,"name","_id"),B(n,"type","hidden"),n.value=i=e[1]._id||"",B(t,"class","fTask svelte-1phofh5"),B(t,"id",e[6]),B(s,"class","form--buttons svelte-1phofh5")},m(i,p){C(i,t,p),_(t,n),_(t,o);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,r),g&&g.m(t,null),C(i,l,p),C(i,s,p),ke(a,s,null),_(s,c),ke(d,s,null),u=!0,m||(f=[z(t,"keydown",e[8]),z(t,"submit",T(e[10]))],m=!0)},p(e,o){if((!u||2&o&&i!==(i=e[1]._id||""))&&(n.value=i),75&o){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const i=Fn(e,p,n);$[n]?($[n].p(i,o),pe($[n],1)):($[n]=Bn(i),$[n].c(),pe($[n],1),$[n].m(t,r))}for(me(),n=p.length;n<$.length;n+=1)h(n);fe()}e[0].list?g?(g.p(e,o),1&o&&pe(g,1)):(g=On(e),g.c(),pe(g,1),g.m(t,null)):g&&(me(),$e(g,1,1,(()=>{g=null})),fe());const l={};8388608&o&&(l.$$scope={dirty:o,ctx:e}),a.$set(l);const s={};4&o&&(s.disabled=e[2]),8388608&o&&(s.$$scope={dirty:o,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)pe($[e]);pe(g),pe(a.$$.fragment,e),pe(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)$e($[e]);$e(g),$e(a.$$.fragment,e),$e(d.$$.fragment,e),u=!1},d(e){e&&j(t),N($,e),g&&g.d(),e&&j(l),e&&j(s),xe(a),xe(d),m=!1,b(f)}}}function An(e){let t,n;return t=new zl({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.item=e[20]),1&n&&(i.selection=e[20].selection),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),1&n&&(i.eventId=e[0].id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Bn(e){let t,n,i=Hn(!0,e[20]),o=i&&An(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){1&n&&(i=Hn(!0,e[20])),i?o?(o.p(e,n),1&n&&pe(o,1)):(o=An(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function On(e){let t,n,i=e[0].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Vn(Dn(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(75&n){let l;for(i=e[0].list,l=0;l<i.length;l+=1){const r=Dn(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Vn(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Vn(e){let t,n,i,o;return t=new e[4]({props:{text:e[17].designation}}),i=new ii({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=D(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};1&n&&(o.text=e[17].designation),t.$set(o);const r={};1&n&&(r.list=e[17]),1&n&&(r.eventId=e[0].id),1&n&&(r.schema=e[17].item),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function Mn(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Wn(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Rn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Pn(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Rn,then:Tn,catch:zn,value:16,blocks:[,,,]};return he(e[7](),o),{c(){t=D(),n=q("section"),o.block.c(),En.title="Vorgaben",B(n,"class","sTask svelte-1phofh5")},m(e,r){C(e,t,r),C(e,n,r),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,i=!0},p(t,[n]){ge(o,e=t,n)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),e&&j(n),o.block.d(),o.token=null,o=null}}}const Hn=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Qn(e,i,r){let a,d,u;I(e,s,(e=>r(11,d=e))),I(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(t.getItem("Locale"));let{schema:h}=i,{record:g}=i,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const w=()=>window.history.back(),b=(e,t,n=!1)=>{const i=t.id,o=e.find((e=>e.name===i));let r=t.value;if(!n&&o&&o.properties?.multi&&(r=g[i]),r&&o&&o.type.startsWith("date"))try{return qn(r,"%d.%m.%Y").toISOString()}catch{return new Date(r).toISOString()}if(o&&"boolean"===o.type&&(r=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{r=Number(r.replace(e,".")).toString()}catch{}}return r};return e.$$set=e=>{"schema"in e&&r(0,h=e.schema),"record"in e&&r(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&r(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await n.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&r(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));r(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},w,async e=>{const t={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const n=e.id||e.name;if(n)if(n.includes(".")){const[i,o]=n.split("."),r=h.list.find((e=>e.name===i));t[n]=b(r.item,e)}else t[n]=b(h.items,e)})),await n.saveTemplate(h.class,t),l.success("Die Vorgaben wurden gespeichert.",2e3),w()}]}const{document:Yn}=ve;function Gn(e,t,n){const i=e.slice();return i[28]=t[n],i}function Un(e){let t,n;return t=new zl({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(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),2&n[0]&&(i.item=e[28]),2&n[0]&&(i.listName=e[1].name),8&n[0]&&(i.eventId=e[3]),1&n[0]&&(i.record=e[0]),16&n[0]&&(i.disabled=e[4]),32&n[0]&&(i.required=e[5]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Jn(e){let t,n,i=Hn(e[7],e[28]),o=i&&Un(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){130&n[0]&&(i=Hn(e[7],e[28])),i?o?(o.p(e,n),130&n[0]&&pe(o,1)):(o=Un(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function Kn(e){let t,n,i,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Jn(Gn(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));return{c(){t=q("div");for(let e=0;e<r.length;e+=1)r[e].c();B(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){C(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,s){if(82367&s[0]){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const i=Gn(e,o,n);r[n]?(r[n].p(i,s),pe(r[n],1)):(r[n]=Jn(i),r[n].c(),pe(r[n],1),r[n].m(t,null))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}(!i||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&B(t,"id",n)},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);i=!1},d(e){e&&j(t),N(r,e)}}}function Zn(e){let t,n,i=e[13](e[9])+"";return{c(){t=q("span"),n=E(i)},m(e,i){C(e,t,i),_(t,n)},p(e,t){512&t[0]&&i!==(i=e[13](e[9])+"")&&O(n,i)},d(e){e&&j(t)}}}function Xn(e){let t,n,i;return n=new e[10]({props:{$$slots:{default:[Zn]},$$scope:{ctx:e}}}),n.$on("click",(function(){k(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","accordion svelte-148ktt9"),B(t,"slot","handle")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(t,i){e=t;const o={};512&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function ei(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Xn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Kn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.open=e[6]),134218687&n[0]|1&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ti(e){let t,n,i;return n=new e[11]({props:{$$slots:{default:[ei]},$$scope:{ctx:e}}}),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","formList")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};1023&t[0]|1&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function ni(e,t,i){const{Button:o,Accordion:r,AccordionSection:l}=c;let{list:s}=t,{schema:a}=t,{record:d}=t,{classId:u}=t,{eventId:m}=t,{disabled:h}=t,{required:g}=t,{open:v=!1}=t,{template:y={}}=t,{isTemplate:w=!1}=t,{currency:b}=t,{update:k=!1}=t,x=new Map;const I={};let S=d[s.name]||{};d[s.name]=S;const _=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),C=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&i(1,s=e.list),"schema"in e&&i(18,a=e.schema),"record"in e&&i(0,d=e.record),"classId"in e&&i(2,u=e.classId),"eventId"in e&&i(3,m=e.eventId),"disabled"in e&&i(4,h=e.disabled),"required"in e&&i(5,g=e.required),"open"in e&&i(6,v=e.open),"template"in e&&i(19,y=e.template),"isTemplate"in e&&i(7,w=e.isTemplate),"currency"in e&&i(8,b=e.currency),"update"in e&&i(20,k=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&k&&d&&i(9,S=d[s.name]||{})},[d,s,u,m,h,g,v,w,b,S,o,r,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format)).map((t=>"object"===t.type?_(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(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&&(I[n]=e.desc);const o=d[t];i(0,d[t]={...o,[n]:e.value},d),i(9,S=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&i(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,o=document.querySelector(n);ie().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(C)})).then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:t,value:i}})=>{if(x.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===className+"."+s.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&x.set(e,r[0])},()=>{setTimeout((()=>{Array.from(x).forEach((([e,t])=>{d[s.name][e]||i(0,d[s.name][e]=t._id,d)}))}),500)},a,y,k,function(t){U(e,t)}]}class ii extends Se{constructor(e){var t;super(),Yn.getElementById("svelte-148ktt9-style")||((t=q("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}}",_(Yn.head,t)),Ie(this,e,ni,ti,x,{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:oi}=ve;function ri(e){e[0]=e[23].list,e[22]=e[23].items}function li(e,t,n){const i=e.slice();return i[24]=t[n],i}function si(e,t,n){const i=e.slice();return i[27]=t[n],i}function ai(e,t,n){const i=e.slice();return i[27]=t[n],i}function ci(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function di(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}ri(e),n=new e[7]({props:{outline:!0,$$slots:{default:[ui]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[22]?.length&&function(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=mi(ai(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[22],r=0;r<i.length;r+=1){const l=ai(e,i,r);o[r]?o[r].p(l,t):(o[r]=mi(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}(e),k=e[0]?.length&&function(e){let t,n=e[0],i=[];for(let t=0;t<n.length;t+=1)i[t]=$i(li(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11778&o[0]){let r;for(n=e[0],r=0;r<n.length;r+=1){const l=li(e,n,r);i[r]?i[r].p(l,o):(i[r]=$i(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){N(i,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=D(),c=q("span"),be(d.$$.fragment),u=D(),m=q("div"),f=q("table"),b&&b.c(),p=D(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){ri(e);const i={};2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[22]?.length&&b.p(e,t),e[0]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function ui(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function mi(e){let t,n,i=e[27]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function fi(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=pi(si(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=D(),B(t,"class","pointer svelte-14hcfjl")},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[22],l=0;l<i.length;l+=1){const s=si(e,i,l);o[l]?o[l].p(s,r):(o[l]=pi(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}function pi(e){let t,n,i,o,r=e[9](e[24],e[27])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[24]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function $i(e){let t,n=e[13](e[24],e[22],e[1]),i=n&&fi(e);return{c(){i&&i.c(),t=F()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[24],e[22],e[1])),n?i?i.p(e,o):(i=fi(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function hi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gi(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:hi,then:di,catch:ci,value:23,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=D(),i=F(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function vi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[gi]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2&n[0]|2&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yi(e,t,i){const o=G(),{Dialog:r,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=t,{className:m}=t,{classId:p}=t,{list:h}=t,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},w=n.getSchemaByClass(m);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&i(15,u=e.item),"className"in e&&i(16,m=e.className),"classId"in e&&i(17,p=e.classId),"list"in e&&i(0,h=e.list)},[h,g,o,r,l,s,a,d,v,y,e=>()=>o("choose",{row:e}),async()=>{const e=await w,t=e.display;let n=Ct(t,e,h);return{list:h,items:n}},({detail:{value:e}})=>{i(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(y(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,g="")},u,m,p,()=>o("back"),function(e){g=e,i(1,g)}]}class wi extends Se{constructor(e){var t;super(),oi.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(oi.head,t)),Ie(this,e,yi,vi,x,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:bi}=ve;function ki(e,t,n){const i=e.slice();return i[11]=t[n],i}function xi(e,t,n){const i=e.slice();return i[3]=t[n],i}function Ii(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Si(e){let t,n,i,o=e[7].items,r=[];for(let t=0;t<o.length;t+=1)r[t]=qi(xi(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));let s=e[7].list&&Li(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=D(),s&&s.c(),n=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);C(e,t,o),s&&s.m(e,o),C(e,n,o),i=!0},p(e,i){if(5161959&i[0]){let n;for(o=e[7].items,n=0;n<o.length;n+=1){const l=xi(e,o,n);r[n]?(r[n].p(l,i),pe(r[n],1)):(r[n]=qi(l),r[n].c(),pe(r[n],1),r[n].m(t.parentNode,t))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}e[7].list?s?(s.p(e,i),128&i[0]&&pe(s,1)):(s=Li(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);pe(s),i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);$e(s),i=!1},d(e){N(r,e),e&&j(t),s&&s.d(e),e&&j(n)}}}function _i(e){let t,n,i,o;const r=[ji,Ci],l=[];function s(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=F()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Ci(e){let t,n;return t=new zl({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(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};256&n[0]&&(i.classId=e[8]),128&n[0]&&(i.item=e[3]),64&n[0]&&(i.record=e[6]),129&n[0]&&(i.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(i.eventId=e[5]),4&n[0]&&(i.currency=e[2]),512&n[0]&&(i.changeValue=e[9]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ji(e){let t,n,i,o;n=new zl({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]);let r=e[1]&&Ni(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),r&&r.c(),M(t,"padding-top",".25em"),M(t,"background-color","lightyellow"),M(t,"position","relative")},m(e,l){C(e,t,l),ke(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};256&i[0]&&(o.classId=e[8]),128&i[0]&&(o.item=e[3]),64&i[0]&&(o.record=e[6]),3&i[0]&&(o.disabled=e[0]||!!e[1]),32&i[0]&&(o.eventId=e[5]),4&i[0]&&(o.currency=e[2]),512&i[0]&&(o.changeValue=e[9]),n.$set(o),e[1]?r?(r.p(e,i),2&i[0]&&pe(r,1)):(r=Ni(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),xe(n),r&&r.d()}}}function Ni(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[22]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function qi(e){let t,n,i="list"!==e[3].type&&_i(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[3].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=_i(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Li(e){let t,n,i=e[7].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Di(ki(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(485&n[0]){let l;for(i=e[7].list,l=0;l<i.length;l+=1){const r=ki(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Di(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Ei(e){let t,n,i,o;return t=new e[12]({props:{text:e[11].designation}}),i=new ii({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(){be(t.$$.fragment),n=D(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};128&n[0]&&(o.text=e[11].designation),t.$set(o);const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.list=e[11]),32&n[0]&&(r.eventId=e[5]),128&n[0]&&(r.schema=e[11].item),64&n[0]&&(r.record=e[6]),1&n[0]&&(r.disabled=e[0]),4&n[0]&&(r.currency=e[2]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function Di(e){let t,n,i="array"!==e[11].type&&Ei(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"array"!==e[11].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Ei(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Fi(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function zi(e){let t,n;return t=new wi({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8&n[0]&&(i.item=e[3]),16&n[0]&&(i.className=e[4]),256&n[0]&&(i.classId=e[8]),2048&n[0]&&(i.list=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ti(e){let t,n,i=e[10]&&zi(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[10]?i?(i.p(e,n),1024&n[0]&&pe(i,1)):(i=zi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ai(e){let t,n,i,o,r,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Fi,then:Si,catch:Ii,value:52,blocks:[,,,]};function a(t){e[28](t)}he(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Ti]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),o=new e[13]({props:c}),K.push((()=>we(o,"open",a))),{c(){s.block.c(),t=D(),be(n.$$.fragment),i=D(),be(o.$$.fragment)},m(e,r){s.block.m(e,s.anchor=r),s.mount=()=>t.parentNode,s.anchor=t,C(e,t,r),ke(n,e,r),C(e,i,r),ke(o,e,r),l=!0},p(t,n){ge(s,e=t,n);const i={};3352&n[0]|67108864&n[1]&&(i.$$scope={dirty:n,ctx:e}),!r&&1024&n[0]&&(r=!0,i.open=e[10],re((()=>r=!1))),o.$set(i)},i(e){l||(pe(s.block),pe(n.$$.fragment,e),pe(o.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){$e(s.blocks[e])}$e(n.$$.fragment,e),$e(o.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&j(t),xe(n,e),e&&j(i),xe(o,e)}}}function Bi(e,t,i){const{Divider:o,FormField:r,Modal:l}=c,s=G();let a,d,u,m,f,{required:p}=t,{disabled:$}=t,{readonly:h}=t,{id:g}=t,{item:v}=t,{value:y}=t,{refValue:w}=t,{currency:b}=t,k={},x=[],I=[],S={},_=new Map,C=!1,j="";const N=v.checkOn,q=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");x.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))},E=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},D=async e=>{const t=x.filter((t=>t.refObj===e));if(t?.length){i(9,S={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:l}=e;if(!n)break;let s,a,c=!o&&k[n];const u=k[n];u&&o&&(c=(await ta(n,u))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&i(9,S[t]="",S))}}};Q((()=>{F()}));const F=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 x)e.add(t.refObj||u);Array.from(e).forEach((e=>D(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(_).forEach((([e,t])=>{k[e]||i(6,k[e]=t._id,k)}))}),250)},T=async e=>{if(!e.value)return void B();const t={[e.itemName]:{$regex:`(?i)${e.value}`}},o=await n.getSectionView(u,t);o?.length?(i(11,j=o),i(10,C=!0)):(i(1,y=""),i(23,w=""),s("setRefValue",w))},A=()=>{i(10,C=!1)},B=()=>{i(1,y=""),i(23,w=y),i(6,k={}),s("setRefValue",w)};return e.$$set=e=>{"required"in e&&i(24,p=e.required),"disabled"in e&&i(0,$=e.disabled),"readonly"in e&&i(25,h=e.readonly),"id"in e&&i(26,g=e.id),"item"in e&&i(3,v=e.item),"value"in e&&i(1,y=e.value),"refValue"in e&&i(23,w=e.refValue),"currency"in e&&i(2,b=e.currency)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&i(0,$=$||h),134217840&e.$$.dirty[0]&&k&&s("safeReference",{record:k,class:u,event:m,taskId:f})},[$,y,b,v,u,m,k,a,d,S,C,j,o,l,N,q,async()=>{try{if(y){const e=await n.getTask(v.refClass,y);delete e._task,i(6,k=e),i(27,f=(await n.getTaskByDocId(e._id))._id)}else i(6,k={})}catch{}return i(7,a=await n.getSchemaByClass(v.refClass)),i(8,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),i(4,u=a.class),a.identity.designation,i(5,m=a.id),["readonly","hidden","required"].map(L),E(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(i(6,k[t]=n,k),t===N)return T(e);D(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:t,lookup:o,view:r}=e,[l]=o.split(":"),s=(await n.getSectionView(l,{[r]:{$in:t}})).map((e=>e._id));for(const e of a.input.slice(1)){i(6,k[e]=[],k);const t=await n.getSchemaByClass(e);t.id;let o=await n.getTasks(t.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),o?.length){const t=o.map((e=>e._id)),r=await n.getSectionView(e,{_id:{$in:t}});for(const t of r)t[e]=t._id;i(6,k[e]=r,k)}}},async({detail:{className:e,itemName:t,value:i}})=>{if(_.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===u))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&_.set(e,r[0])},async({detail:e})=>{const t=await n.getSectionView(u,{_id:e.row._id});t?.length&&(i(1,y=t[0]._id),i(23,w=y),s("setRefValue",w),i(6,k=t[0])),A()},A,B,w,p,h,g,f,function(e){C=e,i(10,C)}]}class Oi extends Se{constructor(e){var t;super(),bi.getElementById("svelte-16mo2c-style")||((t=q("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(bi.head,t)),Ie(this,e,Bi,Ai,x,{required:24,disabled:0,readonly:25,id:26,item:3,value:1,refValue:23,currency:2},[-1,-1])}}function Vi(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=q("span"),n=E(e[4]),B(t,"class","item")},m(e,i){C(e,t,i),_(t,n)},p(e,t){16&t[0]&&O(n,e[4])},d(e){e&&j(t)}}}(e);return{c(){n&&n.c(),t=F()},m(e,i){n&&n.m(e,i),C(e,t,i)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&j(t)}}}function Mi(e){let t,n,i;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[Vi]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=q("div"),be(n.$$.fragment),M(t,"position","relative"),M(t,"max-width","10em")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};6&t[0]&&(i.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(i.id=e[0]),1&t[0]&&(i.name=e[0]),256&t[0]&&(i.value=e[8]),64&t[0]&&(i.pattern=e[6]),128&t[0]&&(i.readonly=e[7]),8&t[0]&&(i.disabled=e[3]),32&t[0]&&(i.required=e[5]),16&t[0]|2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Wi(e,n,i){let o;const r=G(),{TextField:l}=c;let{id:s}=n,{item:a}=n,{value:d}=n,{noForm:u=!1}=n,{classId:m}=n,{disabled:f}=n,{formnovalidate:p}=n,{currency:$}=n,{praefix:h}=n,{notifyList:g}=n;const v=JSON.parse(t.getItem("Locale")),y=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),w=Number("1.1").toLocaleString(v.id).substring(1,2),{properties:b={}}=a;let{min:k,max:x,step:I,pattern:S,decimals:_=0,unit:C="",placeholder:j,hint:N,readonly:q,negative:L,required:E=!1}=b;q=!0===q||void 0;S||(S=_?`[0-9]+([${w}][0-9]{1,${_}})?`:"[0-9]*"),L&&(S="-?"+S);return e.$$set=e=>{"id"in e&&i(0,s=e.id),"item"in e&&i(16,a=e.item),"value"in e&&i(17,d=e.value),"noForm"in e&&i(1,u=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,f=e.disabled),"formnovalidate"in e&&i(18,p=e.formnovalidate),"currency"in e&&i(4,$=e.currency),"praefix"in e&&i(19,h=e.praefix),"notifyList"in e&&i(20,g=e.notifyList)},e.$$.update=()=>{262176&e.$$.dirty[0]&&i(5,E=E&&!p),131072&e.$$.dirty[0]&&i(8,o=Number(d.toString().replace(w,".")).toFixed(_).toString().replace(".",w)),1048576&e.$$.dirty[0]&&(async e=>{if(void 0===h)return;const t=a.properties?.value?.formula;"$multiply"===t?.operator&&r("formula",{item:a})})()},[s,u,m,f,$,E,S,q,o,l,v,y,I,j,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{q||Number(d.toString().replace(w,"."))||i(8,o="")},a,d,p,h,g]}class Ri extends Se{constructor(e){super(),Ie(this,e,Wi,Mi,x,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4,praefix:19,notifyList:20},[-1,-1])}}const{document:Pi}=ve;function Hi(e){e[33]=e[35].list,e[34]=e[35].items}function Qi(e,t,n){const i=e.slice();return i[36]=t[n],i[38]=n,i}function Yi(e,t,n){const i=e.slice();return i[39]=t[n],i[41]=n,i}function Gi(e,t,n){const i=e.slice();return i[39]=t[n],i}function Ui(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ji(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Hi(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Ki]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let w=!e[1]&&Zi(e);function b(t){e[31](t)}let k={id:e[11]};void 0!==e[2]&&(k.value=e[2]),s=new e[6]({props:k}),K.push((()=>we(s,"value",b))),s.$on("input",e[14]),u=new Ve({props:{size:"18"}});let x=e[34]?.length&&function(e){let t,n,i,o,r=!e[1]&&eo(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=to(Gi(e,l,t));return{c(){t=q("thead"),n=q("tr"),r&&r.c(),i=D();for(let e=0;e<s.length;e+=1)s[e].c();B(n,"class","svelte-1m010ne"),B(t,"class","svelte-1m010ne")},m(e,l){C(e,t,l),_(t,n),r&&r.m(n,null),_(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null);o=!0},p(e,t){if(e[1]?r&&(me(),$e(r,1,1,(()=>{r=null})),fe()):r?(r.p(e,t),2&t[0]&&pe(r,1)):(r=eo(e),r.c(),pe(r,1),r.m(n,i)),8192&t[0]){let i;for(l=e[34],i=0;i<l.length;i+=1){const o=Gi(e,l,i);s[i]?s[i].p(o,t):(s[i]=to(o),s[i].c(),s[i].m(n,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=l.length}},i(e){o||(pe(r),o=!0)},o(e){$e(r),o=!1},d(e){e&&j(t),r&&r.d(),N(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=lo(Qi(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(569359&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=Qi(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=lo(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),w&&w.c(),o=D(),r=q("div"),l=E("Suchen: "),be(s.$$.fragment),c=D(),d=q("span"),be(u.$$.fragment),m=D(),f=q("div"),p=q("table"),x&&x.c(),$=D(),h=q("tbody"),I&&I.c(),B(t,"class","form--buttons svelte-1m010ne"),B(d,"class","feather pointer svelte-1m010ne"),M(r,"margin-bottom","1em"),M(r,"position","relative"),B(p,"striped",""),B(p,"class","svelte-1m010ne"),B(f,"class","eList svelte-1m010ne")},m(a,b){C(a,t,b),ke(n,t,null),_(t,i),w&&w.m(t,null),C(a,o,b),C(a,r,b),_(r,l),ke(s,r,null),_(r,c),_(r,d),ke(u,d,null),C(a,m,b),C(a,f,b),_(f,p),x&&x.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=z(d,"click",e[16]),v=!0)},p(e,i){Hi(e);const o={};8192&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[1]?w&&(me(),$e(w,1,1,(()=>{w=null})),fe()):w?(w.p(e,i),2&i[0]&&pe(w,1)):(w=Zi(e),w.c(),pe(w,1),w.m(t,null));const r={};!a&&4&i[0]&&(a=!0,r.value=e[2],re((()=>a=!1))),s.$set(r),e[34]?.length&&x.p(e,i),e[33]?.length&&I.p(e,i)},i(e){g||(pe(n.$$.fragment,e),pe(w),pe(s.$$.fragment,e),pe(u.$$.fragment,e),pe(x),pe(I),g=!0)},o(e){$e(n.$$.fragment,e),$e(w),$e(s.$$.fragment,e),$e(u.$$.fragment,e),$e(x),$e(I),g=!1},d(e){e&&j(t),xe(n),w&&w.d(),e&&j(o),e&&j(r),xe(s),xe(u),e&&j(m),e&&j(f),x&&x.d(),I&&I.d(),v=!1,y()}}}function Ki(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Zi(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Xi]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Xi(e){let t;return{c(){t=E("Bestätigen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function eo(e){let t,n,i,o,r;return n=new Le({props:{size:"20"}}),{c(){t=q("th"),be(n.$$.fragment),B(t,"class","svelte-1m010ne")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[18](e[33])),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function to(e){let t,n,i=e[39]+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function no(e){let t,n,i,o,r,l,s,a=e[0],c=oo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=ro(Yi(e,d,t));return{c(){t=q("tr"),c.c(),n=D();for(let e=0;e<u.length;e+=1)u[e].c();i=D(),B(t,"style",o=e[1]?"cursor: default;":"cursor: zoom-in;"),B(t,"title","übernimmt den Wert direkt"),B(t,"class","svelte-1m010ne"),W(t,"active",e[0].includes(e[36]))},m(o,a){C(o,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,i),r=!0,l||(s=z(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&x(a,a=e[0])?(me(),$e(c,1,1,v),fe(),c=oo(e),c.c(),pe(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const o=Yi(e,d,n);u[n]?u[n].p(o,s):(u[n]=ro(o),u[n].c(),u[n].m(t,i))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!r||2&s[0]&&o!==(o=e[1]?"cursor: default;":"cursor: zoom-in;"))&&B(t,"style",o),8193&s[0]&&W(t,"active",e[0].includes(e[36]))},i(e){r||(pe(c),r=!0)},o(e){$e(c),r=!1},d(e){e&&j(t),c.d(e),N(u,e),l=!1,s()}}}function io(e){let t,n,i;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=q("td"),be(n.$$.fragment),B(t,"title","Wählt den Wert aus"),B(t,"class","svelte-1m010ne")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,t){const i={};1&t[0]&&(i.checked=e[0].includes(e[36])),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function oo(e){let t,n,i=!e[1]&&io(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[1]?i&&(me(),$e(i,1,1,(()=>{i=null})),fe()):i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=io(e),i.c(),pe(i,1),i.m(t.parentNode,t))},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ro(e){let t,n,i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=q("td"),n=E(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p(e,t){8&t[0]&&i!==(i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&O(n,i)},d(e){e&&j(t)}}}function lo(e){let t,n,i=e[15](e[36],e[2]),o=i&&no(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){4&n[0]&&(i=e[15](e[36],e[2])),i?o?(o.p(e,n),4&n[0]&&pe(o,1)):(o=no(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function so(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ao(e){let t,n,i,o;t=new e[9]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:so,then:Ji,catch:Ui,value:35,blocks:[,,,]};return he(e[13](),r),{c(){be(t.$$.fragment),n=D(),i=F(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function co(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ao]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};15&n[0]|8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function uo(e,t,i){const o=G(),{Loading:r,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=t,{id:f}=t,{selection:p}=t,{refDoc:$}=t,{tableName:h}=t,{idName:g}=t,{target:v}=t,{view:y}=t,{unique:w}=t,{uniqueView:b}=t,{status:k}=t,{single:x}=t;p||=[];let I="",S=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",_=[];const C=h+g+v+"checkbox",j=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&i(21,m=e.classId),"id"in e&&i(22,f=e.id),"selection"in e&&i(0,p=e.selection),"refDoc"in e&&i(23,$=e.refDoc),"tableName"in e&&i(24,h=e.tableName),"idName"in e&&i(25,g=e.idName),"target"in e&&i(20,v=e.target),"view"in e&&i(26,y=e.view),"unique"in e&&i(27,w=e.unique),"uniqueView"in e&&i(28,b=e.uniqueView),"status"in e&&i(29,k=e.status),"single"in e&&i(1,x=e.single)},[p,x,I,_,o,r,l,s,a,d,u,S,C,async()=>{let e=[],t=[],o={};if(i(3,_=[]),g)if(y){if(f){const t=m.split("-")[1].slice(0,-4),i="input."+m+"[name='_id']",r=document.querySelector(i).value;o={[g]:f},k&&(o.$or=[{status:!0},{[t]:r}]),e=await n.getSectionView(h,o),e=e.sort(((e,n)=>{const i=e=>(e[t]||"z").toString()+e[v];return j(i(e),i(n))}))}}else b?f&&(o={[g]:f,status:!0},Object.entries(b).map((([e,n])=>{n?.length&&(o[e]={$in:n}),t.push(e)})),e=await n.getSectionView(h,o),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})),i(3,_=e.map((e=>{const n=[e[v]];return t.map((t=>n.push(e[t]))),n})))):w?(e=await n.getSection(h,g,f,w),e=e.sort(((e,t)=>j(e,t)))):(e=await n.getSection(h,g,f,!1,k),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})));else o={},f&&!Array.isArray(f)&&(o._id=f),e=await n.getSectionView(h,o);const r=await n.getSchemaByClass(h),l=[];if($){const t=r.items[0].name,n=r.items[1].name,o=r.list[0].name,l=e.find((e=>e[t]===$));e=l?l[o]:[],i(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(i(20,v=r.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(", ")),l.push(t||[])}else l.push(t||[])}));const s=r.items.find((e=>e.name===v))?.designation;return t=t.map((e=>r.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...t]}},({detail:{value:e}})=>{i(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{i(2,I="")},e=>()=>{const t=document.getElementsByName(C),n=[];t.forEach(((t,i)=>{t.checked&&n.push(e[+t.attributes.data.value])})),o("choose",{list:n})},e=>()=>{document.getElementsByName(C).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(x?o("choose",{list:[].concat(e)}):(i(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),o("choose",{list:p})))},v,m,f,$,h,g,y,w,b,k,()=>o("back"),function(e){I=e,i(2,I)}]}class mo extends Se{constructor(e){var t;super(),Pi.getElementById("svelte-1m010ne-style")||((t=q("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}",_(Pi.head,t)),Ie(this,e,uo,co,x,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:fo}=ve;function po(e){let t,n,i,o,r,l=e[7].length+"";return{c(){t=q("span"),n=E("("),i=E(l),o=E(")"),B(t,"class",r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&O(i,l),2&n[0]&&r!==(r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&B(t,"class",r)},d(e){e&&j(t)}}}function $o(e){let t;return{c(){t=q("div"),B(t,"class","load-more-options"),B(t,"slot","load-more-options-message")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ho(e){let t,n,i,o;const r=[yo,vo,go],l=[];function s(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=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=F()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function go(e){let t,n,i,o,r;return n=new je({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title","Übernehmen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[26]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function vo(e){let t,n,i,o,r;return n=new Fe({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title",e[17].title||"Generieren"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[25]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function yo(e){let t,n,i,o,r;return n=new Ve({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"title","Löschen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[27]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function wo(e){let t,n,i;function o(t){e[37](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[bo]},$$scope:{ctx:e}};return void 0!==e[10]&&(r.open=e[10]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};53&i[0]|32768&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&1024&i[0]&&(n=!0,o.open=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function bo(e){let t,n;return t=new mo({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],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),1&n[0]&&(i.selection=e[0]),16&n[0]&&(i.unique=e[16].unique&&e[4].name),32&n[0]&&(i.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(i.id=e[5][e[21]||e[20]]),16&n[0]&&(i.target=e[4].name),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ko(e){let t,n,i,o,r,l,s,a,c,d=!e[16].single&&e[7].length&&po(e);function u(t){e[35](t)}function m(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:xo,minSearchLength:"3",$$slots:{"load-more-options-message":[$o]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),i=new e[12]({props:f}),K.push((()=>we(i,"selection",u))),K.push((()=>we(i,"maxOptions",m))),i.$on("change",e[22]);let p=!e[1]&&ho(e),$=e[10]&&wo(e);return{c(){t=q("div"),d&&d.c(),n=D(),be(i.$$.fragment),l=D(),p&&p.c(),s=D(),$&&$.c(),a=F(),M(t,"position","relative")},m(e,o){C(e,t,o),d&&d.m(t,null),_(t,n),ke(i,t,null),_(t,l),p&&p.m(t,null),C(e,s,o),$&&$.m(e,o),C(e,a,o),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=po(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!o&&128&l[0]&&(o=!0,s.selection=e[7],re((()=>o=!1))),!r&&512&l[0]&&(r=!0,s.maxOptions=e[9],re((()=>r=!1))),i.$set(s),e[1]?p&&(me(),$e(p,1,1,(()=>{p=null})),fe()):p?(p.p(e,l),2&l[0]&&pe(p,1)):(p=ho(e),p.c(),pe(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&pe($,1)):($=wo(e),$.c(),pe($,1),$.m(a.parentNode,a)):$&&(me(),$e($,1,1,(()=>{$=null})),fe())},i(e){c||(pe(i.$$.fragment,e),pe(p),pe($),c=!0)},o(e){$e(i.$$.fragment,e),$e(p),$e($),c=!1},d(e){e&&j(t),d&&d.d(),xe(i),p&&p.d(),e&&j(s),$&&$.d(e),e&&j(a)}}}async function*xo(e){yield[{name:e}]}function Io(e,t,i){const o=G(),{Modal:r,Autocomplete:l}=c;let{classId:s}=t,{id:a}=t,{item:d}=t,{record:u}=t,{value:m}=t,{noForm:f=!1}=t,{disabled:p}=t,{formnovalidate:$}=t,{numberInput:h}=t,{praefix:g}=t,{toDelete:v}=t,{reqQuantity:y}=t,{notifyList:w}=t;const{properties:b={}}=d;let{placeholder:k,hint:x,readonly:I,required:S=!1,lookup:_="",view:C=!1,multi:j,max:N=1e3,generate:q=!1,status:L=!0,refDoc:E}=b;const[D,F]=_.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(k="");Q((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&_&&e.addEventListener("focus",A)}));const A=()=>{if(_){document.getElementById(a).blur();const e=y||N;(j.unique||T.length<e)&&i(10,z=!0)}},B=()=>{i(10,z&&=!1)},O=({detail:e})=>{i(7,T=e.list.map((e=>({name:e})))),o("blur",{value:e.list}),o("multi",{view:j.view,lookup:_,name:d.name,value:e.list}),B()},V=async()=>{const e={[F]:u[F]},t=await n.getSectionView(D,e),i=Array.from({length:t.length},((e,n)=>t[n][d.name]));O({detail:{list:i}})},M=(e=!1)=>{if(p||!j.required)return;const t=j.maxItem;if(!t||j.unique)return;i(9,N=!1!==e?e:y||u[t]||0);const n=T.length!=N,r=document.getElementById(a);r?.classList?.toggle("invalid",n),o("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"item"in e&&i(4,d=e.item),"record"in e&&i(5,u=e.record),"value"in e&&i(0,m=e.value),"noForm"in e&&i(28,f=e.noForm),"disabled"in e&&i(1,p=e.disabled),"formnovalidate"in e&&i(29,$=e.formnovalidate),"numberInput"in e&&i(30,h=e.numberInput),"praefix"in e&&i(31,g=e.praefix),"toDelete"in e&&i(32,v=e.toDelete),"reqQuantity"in e&&i(33,y=e.reqQuantity),"notifyList"in e&&i(34,w=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&i(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&i(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&i(7,T=[]),128&e.$$.dirty[0]&&T&&(i(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:i}=e;void 0!==g&&g!==i||t&&t.name===j.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&i(6,S=S&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:t,value:r}=e||{};if(!r)return;if(d.refItem?.split(".")[0]!==t)return;const[l,s]=d.refItem.split("."),a=await n.getTask(l,r);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];o("record",{itemName:"quantity",value:u?.length||0}),i(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(w)},[m,p,s,a,d,u,S,T,k,N,z,r,l,I,_,C,j,q,L,E,D,F,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),i(7,T=t.map((e=>({name:e.trim()})))),o("blur",{value:T.map((e=>e.name))}),o("multi",{view:j.view,lookup:_,value:T.map((e=>e.name))})},B,O,()=>{const e=u[q.itemQuantity]||y;if(!e)return;const t=q.prefix||"",n=u[q.variable]||"",i=q.len||5,o=Array.from({length:e},((e,o)=>t+n+"-"+o.toString().padStart(i,"0")));O({detail:{list:o}})},async()=>{if(!0===C)return V();const e=y||u[j.maxItem];if(!e)return;let t={};F&&(t={[F]:u[F]}),L&&(t.status=!0);const i=[].concat(u[j.view]||[]);i.length&&(t[j.view]={$in:i});const o=await n.getSectionView(D,t),r=Array.from({length:e<o.length?e:o.length},((e,t)=>o[t][d.name]));O({detail:{list:r}})},()=>{O({detail:{list:[]}})},f,$,h,g,v,y,w,function(e){T=e,i(7,T),i(5,u),i(4,d),i(32,v)},function(e){N=e,i(9,N)},function(e){z=e,i(10,z)}]}class So extends Se{constructor(e){var t;super(),fo.getElementById("svelte-1rbaejz-style")||((t=q("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}",_(fo.head,t)),Ie(this,e,Io,ko,x,{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])}}const{document:_o}=ve;function Co(e){e[26]=e[28].list,e[27]=e[28].items}function jo(e,t,n){const i=e.slice();return i[29]=t[n],i}function No(e,t,n){const i=e.slice();return i[32]=t[n],i}function qo(e,t,n){const i=e.slice();return i[32]=t[n],i}function Lo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Eo(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}Co(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Do]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let b=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Fo(qo(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[27],r=0;r<i.length;r+=1){const l=qo(e,i,r);o[r]?o[r].p(l,t):(o[r]=Fo(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),N(o,e)}}}(e),k=e[26]?.length&&function(e){let t,n=e[26],i=[];for(let t=0;t<n.length;t+=1)i[t]=Ao(jo(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11779&o[0]){let r;for(n=e[26],r=0;r<n.length;r+=1){const l=jo(e,n,r);i[r]?i[r].p(l,o):(i[r]=Ao(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){N(i,e),e&&j(t)}}}(e);return{c(){t=q("div"),be(n.$$.fragment),i=D(),o=q("div"),r=E("Suchen: "),be(l.$$.fragment),a=D(),c=q("span"),be(d.$$.fragment),u=D(),m=q("div"),f=q("table"),b&&b.c(),p=D(),$=q("tbody"),k&&k.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),ke(n,t,null),C(s,i,y),C(s,o,y),_(o,r),ke(l,o,null),_(o,a),_(o,c),ke(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Co(e);const i={};64&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[27]?.length&&b.p(e,t),e[26]?.length&&k.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),xe(n),e&&j(i),e&&j(o),xe(l),xe(d),e&&j(u),e&&j(m),b&&b.d(),k&&k.d(),g=!1,v()}}}function Do(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Fo(e){let t,n,i=e[32]?.designation+"";return{c(){t=q("th"),n=E(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function zo(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=To(No(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=D(),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[29]._id===e[0])},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const s=No(e,i,l);o[l]?o[l].p(s,r):(o[l]=To(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}2049&r[0]&&W(t,"active",e[29]._id===e[0])},d(e){e&&j(t),N(o,e)}}}function To(e){let t,n,i,o,r=e[9](e[29],e[32])+"";return{c(){t=q("td"),n=E(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[29]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Ao(e){let t,n=e[13](e[29],e[27],e[1]),i=n&&zo(e);return{c(){i&&i.c(),t=F()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[29],e[27],e[1])),n?i?i.p(e,o):(i=zo(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function Bo(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Oo(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Bo,then:Eo,catch:Lo,value:28,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=D(),i=F(),r.block.c()},m(e,l){ke(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){xe(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function Vo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Oo]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};3&n[0]|64&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Mo(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{className:p}=t,{classId:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,k="",x=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(p);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&na(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(15,m=e.item),"className"in e&&o(16,p=e.className),"classId"in e&&o(17,h=e.classId),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(18,v=e.viewName),"viewValue"in e&&o(19,y=e.viewValue),"recordId"in e&&o(20,w=e.recordId),"filter"in e&&o(21,b=e.filter)},[g,k,r,l,s,a,d,u,x,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S,t="."+h+"#"+v;document.querySelector(t);let i={[v]:y},o=[];i[v]&&(o=await n.getSectionView(e.class,i,!0)),b&&(o=o.filter((e=>e._id!=b)));const r=e.display;return{list:o,items:Ct(r,e,o)}},({detail:{value:e}})=>{o(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,k="")},m,p,h,v,y,w,b,()=>r("back"),function(e){k=e,o(1,k)}]}class Wo extends Se{constructor(e){var t;super(),_o.getElementById("svelte-14hcfjl-style")||((t=q("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}",_(_o.head,t)),Ie(this,e,Mo,Vo,x,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Ro(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Po(e){let t,n,i,o,r;function l(t){e[21](t)}let s={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]&&(s.value=e[0]),n=new e[10]({props:s}),K.push((()=>we(n,"value",l)));let a=!e[6]&&Ho(e);return{c(){t=q("div"),be(n.$$.fragment),o=D(),a&&a.c(),M(t,"position","relative")},m(e,i){C(e,t,i),ke(n,t,null),_(t,o),a&&a.m(t,null),r=!0},p(e,o){const r={};4&o&&(r.id=e[2]),8&o&&(r.name=e[3].name),34&o&&(r.inputClass=e[5]||e[1]),64&o&&(r.disabled=e[6]),128&o&&(r.formnovalidate=e[7]),!i&&1&o&&(i=!0,r.value=e[0],re((()=>i=!1))),n.$set(r),e[6]?a&&(me(),$e(a,1,1,(()=>{a=null})),fe()):a?(a.p(e,o),64&o&&pe(a,1)):(a=Ho(e),a.c(),pe(a,1),a.m(t,null))},i(e){r||(pe(n.$$.fragment,e),pe(a),r=!0)},o(e){$e(n.$$.fragment,e),$e(a),r=!1},d(e){e&&j(t),xe(n),a&&a.d()}}}function Ho(e){let t,n,i,o,r;return n=new st({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-wbrqzu")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[17]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Qo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Yo(e){let t,n,i;function o(t){e[22](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[Go]},$$scope:{ctx:e}};return void 0!==e[8]&&(r.open=e[8]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};268435994&i&&(o.$$scope={dirty:i,ctx:e}),!n&&256&i&&(n=!0,o.open=e[8],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Go(e){let t,n;return t=new Wo({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.item=e[3]),8&n&&(i.className=e[3].refClass),2&n&&(i.classId=e[1]),16&n&&(i.recordId=e[4]._id),512&n&&(i.viewValue=e[9]),16&n&&(i.filter=e[4]._id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Uo(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Qo,then:Po,catch:Ro,value:27,blocks:[,,,]};he(e[16](),o);let r=e[8]&&Yo(e);return{c(){o.block.c(),t=D(),r&&r.c(),n=F()},m(e,l){o.block.m(e,o.anchor=l),o.mount=()=>t.parentNode,o.anchor=t,C(e,t,l),r&&r.m(e,l),C(e,n,l),i=!0},p(t,[i]){ge(o,e=t,i),e[8]?r?(r.p(e,i),256&i&&pe(r,1)):(r=Yo(e),r.c(),pe(r,1),r.m(n.parentNode,n)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){i||(pe(o.block),pe(r),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}$e(r),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&j(t),r&&r.d(e),e&&j(n)}}}function Jo(e,t,n){const{TextField:i,Modal:o}=c;let{classId:r}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:w=!1,view:b}=$,k=!1;const x=()=>{n(8,k=!1)};return e.$$set=e=>{"classId"in e&&n(1,r=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,r,l,s,a,u,m,f,k,h,i,o,g,y,w,b,async()=>(n(9,h=a[b.selection]),!0),()=>{n(8,k=!0)},({detail:e})=>{n(0,d=e.row[b.value?b.value:"_id"]),x()},x,p,function(e){d=e,n(0,d)},function(e){k=e,n(8,k)}]}class Ko extends Se{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=q("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),Ie(this,e,Jo,Uo,x,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Zo(e,t,n){const i=e.slice();return i[12]=t[n][0],i[13]=t[n][1],i}function Xo(e){let t;return{c(){t=q("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function er(e){let t;return{c(){t=q("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function tr(e){let t,n,i,o,r=e[12]+"";return{c(){t=q("option"),n=E(r),t.__value=i=e[13],t.value=t.__value,t.selected=o=e[0]==e[13]},m(e,i){C(e,t,i),_(t,n)},p(e,l){64&l&&r!==(r=e[12]+"")&&O(n,r),64&l&&i!==(i=e[13])&&(t.__value=i,t.value=t.__value),65&l&&o!==(o=e[0]==e[13])&&(t.selected=o)},d(e){e&&j(t)}}}function nr(e){let t,n,i,o,r,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?er:Xo}let i=n(e),o=i(e);return{c(){o.c(),t=F()},m(e,n){o.m(e,n),C(e,t,n)},p(e,r){i!==(i=n(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&j(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=tr(Zo(e,s,t));return{c(){t=q("select"),l&&l.c(),n=F();for(let e=0;e<a.length;e+=1)a[e].c();B(t,"class",i=S(e[3]||e[4])+" svelte-5xpzvo"),B(t,"id",e[2]),B(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(i,s){C(i,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);o||(r=z(t,"change",e[9]),o=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let i;for(s=e[6],i=0;i<s.length;i+=1){const o=Zo(e,s,i);a[i]?a[i].p(o,n):(a[i]=tr(o),a[i].c(),a[i].m(t,null))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}24&n&&i!==(i=S(e[3]||e[4])+" svelte-5xpzvo")&&B(t,"class",i),4&n&&B(t,"id",e[2]),4&n&&B(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:v,o:v,d(e){e&&j(t),l&&l.d(),N(a,e),o=!1,r()}}}function ir(e,t,n){const i=G();let{id:o}=t,{item:r}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=r.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=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,o=e.id),"item"in e&&n(10,r=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,o,s,a,d,u,m,f,e=>i("blur",{value:e.srcElement.value}),r]}class or extends Se{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=q("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}",_(document.head,t)),Ie(this,e,ir,nr,x,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function rr(e){let t;return{c(){t=E("Stunden")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function lr(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sr(e){let t;return{c(){t=E("Minuten")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ar(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[sr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function cr(e){let t;return{c(){t=E("Jetzt")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function dr(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[cr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ur(e){let t,n,i,o,r,l,s,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[dr],"minutes-label":[ar],"hours-label":[lr]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=q("input"),i=D(),be(o.$$.fragment),r=D(),be(l.$$.fragment),B(t,"type","string"),B(t,"class",n=e[2]||e[3]),B(t,"id",e[1]),B(t,"name",e[1]),t.hidden=!0},m(n,d){C(n,t,d),V(t,e[0]),C(n,i,d),ke(o,n,d),C(n,r,d),ke(l,n,d),s=!0,a||(c=z(t,"input",e[9]),a=!0)},p(e,[i]){(!s||12&i&&n!==(n=e[2]||e[3]))&&B(t,"class",n),(!s||2&i)&&B(t,"id",e[1]),(!s||2&i)&&B(t,"name",e[1]),1&i&&V(t,e[0]);const r={};1&i&&(r.value=e[0]),o.$set(r);const a={};1&i&&(a.value=e[0]),4096&i&&(a.$$scope={dirty:i,ctx:e}),l.$set(a)},i(e){s||(pe(o.$$.fragment,e),pe(l.$$.fragment,e),s=!0)},o(e){$e(o.$$.fragment,e),$e(l.$$.fragment,e),s=!1},d(e){e&&j(t),e&&j(i),xe(o,e),e&&j(r),xe(l,e),a=!1,c()}}}function mr(e,t,n){const i=G(),{Label:o,DatePicker:r,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>i("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[s,a,d,u,o,r,l,({detail:e})=>{var t,i;n(0,(t=e.value,i=s,s=null==t||null==i?t:(i.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),i))),m(s)},({detail:e})=>{n(0,s=Ln(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class fr extends Se{constructor(e){super(),Ie(this,e,mr,ur,x,{value:0,id:1,noForm:2,classId:3})}}function pr(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=q("input"),r=D(),l=q("input"),d=D(),be(u.$$.fragment),m=E(" /\n"),be(f.$$.fragment),B(t,"type","string"),B(t,"class",n=e[1]||e[2]),B(t,"id",i=e[0]+"_from"),B(t,"name",o=e[0]+"_from"),t.hidden=!0,B(l,"type","string"),B(l,"class",s=e[1]||e[2]),B(l,"id",a=e[0]+"_to"),B(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,i){C(n,t,i),V(t,e[7]),C(n,r,i),C(n,l,i),V(l,e[8]),C(n,d,i),ke(u,n,i),C(n,m,i),ke(f,n,i),p=!0,$||(h=[z(t,"input",e[13]),z(l,"input",e[14])],$=!0)},p(e,[r]){(!p||6&r&&n!==(n=e[1]||e[2]))&&B(t,"class",n),(!p||1&r&&i!==(i=e[0]+"_from"))&&B(t,"id",i),(!p||1&r&&o!==(o=e[0]+"_from"))&&B(t,"name",o),128&r&&V(t,e[7]),(!p||6&r&&s!==(s=e[1]||e[2]))&&B(l,"class",s),(!p||1&r&&a!==(a=e[0]+"_to"))&&B(l,"id",a),(!p||1&r&&c!==(c=e[0]+"_to"))&&B(l,"name",c),256&r&&V(l,e[8]);const d={};32&r&&(d.format=e[5]),8&r&&(d.required=e[3]),16&r&&(d.disabled=e[4]),128&r&&(d.value=e[7]),u.$set(d);const m={};64&r&&(m.format=e[6]),8&r&&(m.required=e[3]),16&r&&(m.disabled=e[4]),256&r&&(m.value=e[8]),f.$set(m)},i(e){p||(pe(u.$$.fragment,e),pe(f.$$.fragment,e),p=!0)},o(e){$e(u.$$.fragment,e),$e(f.$$.fragment,e),p=!1},d(e){e&&j(t),e&&j(r),e&&j(l),e&&j(d),xe(u,e),e&&j(m),xe(f,e),$=!1,b(h)}}}function $r(e,t,n){const i=G(),{DatePicker:o}=c;let{value:r}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=r?.from,$=r?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,r=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,o,({detail:e})=>{n(7,p=Ln(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),i("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=Ln(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),i("change",{value:$,range:"_to"})},r,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class hr extends Se{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=q("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),Ie(this,e,$r,pr,x,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function gr(e){let t,n,i;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:vr,placeholder:yr,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=q("div"),be(n.$$.fragment),M(t,"max-width","4em")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p(e,[t]){const i={};4&t&&(i.inputClass=e[2]),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),2&t&&(i.value=e[1]),8&t&&(i.readonly=e[3]),16&t&&(i.disabled=e[4]),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}const vr="([01][0-9]|2[0-3]):([0-5][0-9])",yr="";function wr(e,t,n){const i=G(),{TextField:o}=c;let{id:r}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix:m}=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,r=e.id),"item"in e&&n(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[r,s,a,d,u,o,({detail:e})=>{i("blur",{value:f(e.value)}),i("checkRange",{idx:m,fieldId:r,value:e.value})},l,m]}class br extends Se{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=q("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),Ie(this,e,wr,gr,x,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:kr}=ve;function xr(e,t,n){const i=e.slice();return i[0]=t[n],i}function Ir(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function Sr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function _r(e){let t,n,i=e[14],o=[];for(let t=0;t<i.length;t+=1)o[t]=jr(xr(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(14&n){let l;for(i=e[14],l=0;l<i.length;l+=1){const r=xr(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=jr(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Cr(e){let t,n,i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"",o=e[19]&&function(e){let t;return{c(){t=E(", ")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}();return{c(){t=q("span"),o&&o.c(),n=E(i),B(t,"class","lookupValue")},m(e,i){C(e,t,i),o&&o.m(t,null),_(t,n)},p(e,t){2&t&&i!==(i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"")&&O(n,i)},d(e){e&&j(t),o&&o.d()}}}function jr(e){let t,n,i,o,r,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=Cr(Ir(e,c,t));return o=new Re({props:{size:"18"}}),{c(){t=q("div");for(let e=0;e<d.length;e+=1)d[e].c();n=D(),i=q("span"),be(o.$$.fragment),r=D(),B(i,"class","feather pointer svelte-1u646ni"),B(t,"class","lookupItem svelte-1u646ni")},m(c,u){C(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,i),ke(o,i,null),_(t,r),l=!0,s||(a=z(i,"click",e[3](e[0]._id)),s=!0)},p(i,o){if(e=i,6&o){let i;for(c=e[1],i=0;i<c.length;i+=1){const r=Ir(e,c,i);d[i]?d[i].p(r,o):(d[i]=Cr(r),d[i].c(),d[i].m(t,n))}for(;i<d.length;i+=1)d[i].d(1);d.length=c.length}},i(e){l||(pe(o.$$.fragment,e),l=!0)},o(e){$e(o.$$.fragment,e),l=!1},d(e){e&&j(t),N(d,e),xe(o),s=!1,a()}}}function Nr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function qr(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Nr,then:_r,catch:Sr,value:14,blocks:[,,,]};return he(e[2](),i),{c(){t=q("div"),i.block.c(),B(t,"class","lookup svelte-1u646ni")},m(e,o){C(e,t,o),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null,n=!0},p(t,[n]){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(),i.token=null,i=null}}}function Lr(e,t,i){let{id:o}=t,{item:r}=t,{praefix:l}=t,{record:s}=t;const{refItem:a,view:c}=r.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ie().then((()=>{const e=document.querySelector("div.form-field."+r.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&i(4,o=e.id),"item"in e&&i(0,r=e.item),"praefix"in e&&i(5,l=e.praefix),"record"in e&&i(6,s=e.record)},[r,d,async()=>{let e=[];if(s._id){const t=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const o={[u]:s[u]||s._id};if(e=await n.getSectionView(f,o,t),!t){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),i(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const t=await n.getTaskByDocId(e);if(!t)return;const i=t._id,o=`/task/${t.event}/${i}/task?view=standalone`;window.open(o)},o,l,s]}class Er extends Se{constructor(e){var t;super(),kr.getElementById("svelte-1u646ni-style")||((t=q("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(kr.head,t)),Ie(this,e,Lr,qr,x,{id:4,item:0,praefix:5,record:6})}}function Dr(e){let t,n,i;return n=new Ze({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Fr(e){let t,n,i,o,r;return n=new Ze({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function zr(e){let t,n,i,o,r,l;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 s=[Fr,Dr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=D(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Tr(e,t,i){const{TextField:o}=c;let{inputClass:r}=t,{disabled:l}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:d}=t,{id:u}=t,{name:m}=t,{value:f}=t,{record:p}=t,{item:$}=t;return e.$$set=e=>{"inputClass"in e&&i(0,r=e.inputClass),"disabled"in e&&i(1,l=e.disabled),"formnovalidate"in e&&i(2,s=e.formnovalidate),"readonly"in e&&i(3,a=e.readonly),"required"in e&&i(4,d=e.required),"id"in e&&i(5,u=e.id),"name"in e&&i(6,m=e.name),"value"in e&&i(7,f=e.value),"record"in e&&i(10,p=e.record),"item"in e&&i(11,$=e.item)},[r,l,s,a,d,u,m,f,o,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:t,houseNo:i,postcode:o,location:r,country:l}=e,s=[t&&i?t+" "+i:t,o&&r?o+" "+r:o||r||"",l&&(await n.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){U(e,t)}]}class Ar extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Tr,zr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Br(e){let t,n,i;return n=new Qe({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Or(e){let t,n,i,o,r;return n=new Qe({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Vr(e){let t,n,i,o,r,l;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 s=[Or,Br],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=D(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Mr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){U(e,t)}]}class Wr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Mr,Vr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Rr(e){let t,n,i;return n=new tt({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Pr(e){let t,n,i,o,r;return n=new tt({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Hr(e){let t,n,i,o,r,l;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 s=[Pr,Rr],a=[];function c(e,t){return e[9]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=D(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};4&i&&(l.inputClass=e[2]),1&i&&(l.pattern=e[0]),2&i&&(l.placeholder=e[1]),8&i&&(l.disabled=e[3]),16&i&&(l.formnovalidate=e[4]),32&i&&(l.readonly=e[5]),64&i&&(l.required=e[6]),128&i&&(l.id=e[7]),256&i&&(l.name=e[8]),512&i&&(l.value=e[9]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Qr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,o=e.inputClass),"disabled"in e&&n(3,r=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class Yr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Qr,Hr,x,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Gr(e){let t,n,i;return n=new Ue({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),ke(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n)}}}function Ur(e){let t,n,i,o,r;return n=new Ue({props:{size:"18"}}),{c(){t=q("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),ke(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n),o=!1,r()}}}function Jr(e){let t,n,i,o,r,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],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 s=[Ur,Gr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),be(n.$$.fragment),i=D(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),256&i&&(l.pattern=e[8]),512&i&&(l.placeholder=e[9]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),xe(n),a[o].d()}}}function Kr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[o,r,l,s,a,d,u,m,f,p,i,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class Zr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("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}",_(document.head,t)),Ie(this,e,Kr,Jr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}const Xr=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","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 el(e){let t;return{c(){t=q("textarea"),B(t,"id",e[0]),M(t,"visibility","hidden")},m(n,i){C(n,t,i),e[18](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[18](null)}}}function tl(e){let t;return{c(){t=q("div"),B(t,"id",e[0])},m(n,i){C(n,t,i),e[17](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[17](null)}}}function nl(e){let t;function n(e,t){return e[1]?tl:el}let i=n(e),o=i(e);return{c(){t=q("div"),o.c(),B(t,"class",e[2])},m(n,i){C(n,t,i),o.m(t,null),e[19](t)},p(e,[r]){i===(i=n(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,null))),4&r&&B(t,"class",e[2])},i:v,o:v,d(n){n&&j(t),o.d(),e[19](null)}}}const il=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let ol=(()=>{let e={listeners:[],scriptId:il("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,i)=>{e.scriptLoaded?i():(e.listeners.push(i),e.injected||((t,n,i,o)=>{e.injected=!0;const r=n.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=i,r.onload=()=>{o()},n.head&&n.head.appendChild(r)})(e.scriptId,t,n,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0})))}}})();function rl(e,t,n){var i;let o,r,l,{id:s=il("tinymce-svelte")}=t,{inline:a}=t,{disabled:c=!1}=t,{apiKey:d="no-api-key"}=t,{channel:u="6"}=t,{scriptSrc:m}=t,{conf:f={}}=t,{modelEvents:p="change input undo redo"}=t,{value:$=""}=t,{text:h=""}=t,{cssClass:g="tinymce-wrapper"}=t,v=$,y=c;const w=G(),b=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},k=()=>{const e=Object.assign(Object.assign({},f),{target:r,inline:void 0!==a?a:void 0!==f.inline&&f.inline,readonly:c,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent($),e.on(p,(()=>{n(15,v=e.getContent()),v!==$&&(n(5,$=v),n(6,h=e.getContent({format:"text"})))}))})),((e,t)=>{Xr.forEach((n=>{e.on(n,(i=>{t(n.toLowerCase(),{eventName:n,event:i,editor:e})}))}))})(e,w),"function"==typeof f.setup&&f.setup(e)}});n(4,r.style.visibility="",r),b().init(e)};return Q((()=>{if(null!==b())k();else{const e=m||`https://cdn.tiny.cloud/1/${d}/tinymce/${u}/tinymce.min.js`;ol.load(o.ownerDocument,e,(()=>{k()}))}})),Y((()=>{var e;l&&(null===(e=b())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,c=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,u=e.channel),"scriptSrc"in e&&n(10,m=e.scriptSrc),"conf"in e&&n(11,f=e.conf),"modelEvents"in e&&n(12,p=e.modelEvents),"value"in e&&n(5,$=e.value),"text"in e&&n(6,h=e.text),"cssClass"in e&&n(2,g=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&v!==$&&(l.setContent($),n(6,h=l.getContent({format:"text"}))),l&&c!==y&&(n(16,y=c),"function"==typeof(null===n(13,i=l.mode)||void 0===i?void 0:i.set)?l.mode.set(c?"readonly":"design"):l.setMode(c?"readonly":"design")))},[s,a,g,o,r,$,h,c,d,u,m,f,p,i,l,v,y,function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class ll extends Se{constructor(e){super(),Ie(this,e,rl,nl,x,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function sl(e){let t,n,i,o,r,l,s;function a(t){e[7](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",conf:e[6],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new ll({props:c}),K.push((()=>we(n,"value",a))),{c(){t=q("div"),be(n.$$.fragment),o=D(),r=q("input"),B(r,"class",l=e[1]||e[2]),B(r,"id",e[3]),B(r,"name",e[3]),r.value=e[0],r.hidden=!0,M(t,"min-height","10em"),M(t,"margin-top","-1em")},m(e,i){C(e,t,i),ke(n,t,null),_(t,o),_(t,r),s=!0},p(e,[t]){const o={};16&t&&(o.disabled=e[4]),32&t&&(o.readonly=e[5]),!i&&1&t&&(i=!0,o.value=e[0],re((()=>i=!1))),n.$set(o),(!s||6&t&&l!==(l=e[1]||e[2]))&&B(r,"class",l),(!s||8&t)&&B(r,"id",e[3]),(!s||8&t)&&B(r,"name",e[3]),(!s||1&t&&r.value!==e[0])&&(r.value=e[0])},i(e){s||(pe(n.$$.fragment,e),s=!0)},o(e){$e(n.$$.fragment,e),s=!1},d(e){e&&j(t),xe(n)}}}function al(e,n,i){let o=JSON.parse(t.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let{value:r}=n,{noForm:l}=n,{classId:s}=n,{id:a}=n,{disabled:c}=n,{readonly:d}=n;const u={plugins:"advlist numlist 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 e.$$set=e=>{"value"in e&&i(0,r=e.value),"noForm"in e&&i(1,l=e.noForm),"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"disabled"in e&&i(4,c=e.disabled),"readonly"in e&&i(5,d=e.readonly)},[r,l,s,a,c,d,u,function(e){r=e,i(0,r)}]}class cl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zemw0w-style")||((t=q("style")).id="svelte-zemw0w-style",t.textContent="div.tox-statusbar__text-container{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",_(document.head,t)),Ie(this,e,al,sl,x,{value:0,noForm:1,classId:2,id:3,disabled:4,readonly:5})}}function dl(e){let t,n;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Ll,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1048577&n[0]&&(i.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(i.name=e[0].designation),1&n[0]&&(i.help=e[0].properties?.hint),13631487&n[0]|134217728&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ul(e){let t,n;return t=new e[28]({props:{text:e[0].designation}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.text=e[0].designation),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ml(e){let t,n,i,o;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint}}),i=new cl({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6]}}),i.$on("blur",e[35]()),{c(){be(t.$$.fragment),n=D(),be(i.$$.fragment)},m(e,r){ke(t,e,r),C(e,n,r),ke(i,e,r),o=!0},p(e,n){const o={};1048577&n[0]&&(o.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),8&n[0]&&(r.disabled=e[3]),524288&n[0]&&(r.readonly=e[19]),1&n[0]&&(r.name=e[0].name),4194304&n[0]&&(r.value=e[22]()),64&n[0]&&(r.noForm=e[6]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){xe(t,e),e&&j(n),xe(i,e)}}}function fl(e){let t,n,i,o,r,l;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+" hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[El]},$$scope:{ctx:e}}}),i=new e[28]({props:{text:e[23]}}),r=new Oi({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22]()}}),r.$on("setRefValue",e[40]),r.$on("safeReference",e[45]),{c(){be(t.$$.fragment),n=D(),be(i.$$.fragment),o=D(),be(r.$$.fragment)},m(e,s){ke(t,e,s),C(e,n,s),ke(i,e,s),C(e,o,s),ke(r,e,s),l=!0},p(e,n){const o={};1&n[0]&&(o.class=e[0].name+" hidden"),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),6291841&n[0]|134217728&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);const l={};8388608&n[0]&&(l.text=e[23]),i.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),1&n[0]&&(s.item=e[0]),131072&n[0]&&(s.currency=e[17]),4194304&n[0]&&(s.value=e[22]()),r.$set(s)},i(e){l||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){xe(t,e),e&&j(n),xe(i,e),e&&j(o),xe(r,e)}}}function pl(e){let t,n;return t=new e[25]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[29],required:!0===e[4],placeholder:e[30],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=!0===e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function $l(e){let t,n;return t=new Yr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function hl(e){let t,n;return t=new Wr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function gl(e){let t,n;return t=new Zr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function vl(e){let t,n;return t=new br({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[0],value:e[22](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[51]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function yl(e){let t,n;return t=new Er({props:{id:e[32],item:e[0],praefix:e[5],record:e[1]}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.item=e[0]),32&n[0]&&(i.praefix=e[5]),2&n[0]&&(i.record=e[1]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function wl(e){let t,n;return t=new Ar({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22](),record:e[1],item:e[0]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),2&n[0]&&(i.record=e[1]),1&n[0]&&(i.item=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function bl(e){let t,n;return t=new fr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function kl(e){let t,n;return t=new hr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xl(e){let t,n;return t=new e[26]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Il(e){let t,n;return t=new e[27]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),524296&n[0]&&(i.disabled=e[3]||e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.checked=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Sl(e){let t,n;return t=new Ko({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],view:e[0].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[50]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.view=e[0].properties.view),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _l(e){let t,n;return t=new So({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],multi:e[0].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[49]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.multi=e[0].properties.multi),4096&n[0]&&(i.numberInput=e[12]),32&n[0]&&(i.praefix=e[5]),32768&n[0]&&(i.toDelete=e[15]),65536&n[0]&&(i.reqQuantity=e[16]),262144&n[0]&&(i.notifyList=e[18]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Cl(e){let t,n;return t=new Ri({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22](),praefix:e[5],notifyList:e[18],noForm:e[6]}}),t.$on("blur",e[35]()),t.$on("formula",e[48]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),16&n[0]&&(i.required=e[4]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),131072&n[0]&&(i.currency=e[17]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),262144&n[0]&&(i.notifyList=e[18]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function jl(e){let t,n;return t=new or({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],value:e[22](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Nl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6],placeholder:e[0].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.name=e[0].name),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.placeholder=e[0].properties?.placeholder),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ql(e){let t,n;return t=new Cn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],value:e[22](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[46]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[47]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ll(e){let t,n,i,o;const r=[ql,Nl,jl,Cl,_l,Sl,Il,xl,kl,bl,wl,yl,vl,gl,hl,$l,pl],l=[];function s(e,t){return"object"===e[0].type?0:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?1:e[0].properties&&(e[0].properties.enum||e[0].properties.regulation)?2:"number"===e[0].type?3:e[0].properties&&e[0].properties.multi?4:e[0].properties&&e[0].properties.view&&"lookup"!==e[0].properties.format?5:"boolean"===e[0].type?6:"date"===e[0].type?7:"dateRange"===e[0].type?8:"datetime"===e[0].type?9:"map"===e[0].properties?.format?10:"lookup"===e[0].properties?.format?11:"time"===e[0].properties?.format?12:"email"===e[0].type||"email"===e[0].properties?.format?13:"url"===e[0].properties?.format?14:"tel"===e[0].properties?.format?15:16}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function El(e){let t,n;return t=new Cn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[0],value:e[22](),noList:!0,withRefValue:!0,refValue:e[21]}}),t.$on("setRefDesc",e[41]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),2097152&n[0]&&(i.refValue=e[21]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Dl(e){let t,n,i,o;const r=[fl,ml,ul,dl],l=[];function s(e,t){return e[5]||"reference"!==e[0].saveAs||"object"!==e[0].type?"html"===e[0].properties?.format?1:"divider"===e[0].type?2:3:0}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Fl(e,t,n){let i,o,r;const l=G(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:k}=t,{disabled:x}=t,{selectionFields:I}=t,{formnovalidate:S}=t,{selection:_=!1}=t,{notifyList:C}=t,{numberInput:j}=t,{deList:N}=t,{required:q}=t,{isTemplate:L}=t,{toDelete:E}=t,{reqQuantity:D}=t,{currency:F}=t,{changeValue:z}=t,{propSelection:T}=t;y||=v._id;let{required:A,readonly:B,hidden:O,pattern:V,placeholder:M}=h.properties||{};if(O=!0===O,void 0!==B&&(B=!0===B),void 0===q&&(q=A),x=x||!!B,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const W=(g?g+".":"")+h.name,R=W+(""!==$?"-"+$:""),P=(e,t=W)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let H=P(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(0,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(1,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,w=e.noForm),"classId"in e&&n(7,b=e.classId),"eventId"in e&&n(8,k=e.eventId),"disabled"in e&&n(3,x=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,S=e.formnovalidate),"selection"in e&&n(11,_=e.selection),"notifyList"in e&&n(18,C=e.notifyList),"numberInput"in e&&n(12,j=e.numberInput),"deList"in e&&n(13,N=e.deList),"required"in e&&n(4,q=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,E=e.toDelete),"reqQuantity"in e&&n(16,D=e.reqQuantity),"currency"in e&&n(17,F=e.currency),"changeValue"in e&&n(43,z=e.changeValue),"propSelection"in e&&n(44,T=e.propSelection)},e.$$.update=()=>{if(1&e.$$.dirty[0]|8192&e.$$.dirty[1]&&T&&h.properties?.selection){const{refClass:e,refItem:t,target:n}=h.properties.selection,i=T.record[e];l("propSelection",{itemName:h.name,itemType:h.type,prop:t,target:n,source:e,sourceId:i})}if(4096&e.$$.dirty[1])for(const e in z)e===W&&n(1,v[W]=z[e],v);2&e.$$.dirty[0]&&n(22,i=(e=W)=>{let t=P(v);return void 0===t?"":t}),2&e.$$.dirty[0]&&(r=P(v))},n(23,o=((e=W)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[h,v,y,x,q,$,w,b,k,I,S,_,j,N,L,E,D,F,C,B,O,H,i,o,s,a,d,m,p,V,M,W,R,(e=W)=>{let t=P(v);return t?new Date(t):""===$?new Date:void 0},(e=W)=>{const t=P(v,e+"_from"),n=P(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:i,checked:o,range:s}=t;void 0!==o&&(i=o);const a=W+(s||"");n(1,v[a]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(i,"%d.%m.%Y"):i,v);const c=Object.values(v).every((e=>!e))&&i;l("notify",{oldValue:r,value:i,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,O=!0),()=>"object"===h.type?"comment_"+R:R,({detail:e})=>{n(21,H=e)},({detail:e})=>{const{designation:t}=h;n(23,o=t+": "+(e||"(Neu)"))},g,z,T,function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)}]}class zl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zmu4lk-style")||((t=q("style")).id="svelte-zmu4lk-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),Ie(this,e,Fl,Dl,x,{praefix:5,item:0,listName:42,record:1,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43,propSelection:44},[-1,-1])}}const{document:Tl}=ve;function Al(e,t,n){const i=e.slice();return i[88]=t[n],i[90]=n,i}function Bl(e,t,n){const i=e.slice();return i[97]=t[n],i}function Ol(e,t,n){const i=e.slice();return i[92]=t[n].title,i[93]=t[n].toDelete,i[94]=t[n].icon,i}function Vl(e){let t,n;return t=new e[19]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[Ml]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ml(e){let t,n,i;function o(t){e[50](t)}let r={item:e[29],disabled:!0};return void 0!==e[11]&&(r.value=e[11]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&2048&i[0]&&(n=!0,o.value=e[11],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Wl(e){let t,n;return t=new e[19]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[Rl]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Rl(e){let t,n,i;function o(t){e[51](t)}let r={item:e[27],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Pl(e){let t,n;return t=new e[19]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[Hl]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};1152&n[0]|128&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Hl(e){let t,n,i;function o(t){e[52](t)}let r={item:e[25],disabled:!0,currency:e[7]};return void 0!==e[10]&&(r.value=e[10]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Ql(e){let t,n;return t=new e[22]({props:{class:e[16][e[90]],open:e[9]&&!e[1]&&0===e[90],$$slots:{handle:[es,({toggle:e,open:t})=>({91:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?536870912:0]],default:[Jl,({toggle:e,open:t})=>({91:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?536870912:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){k(e[43](e[90],e[87]))&&e[43](e[90],e[87]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};65536&i[0]&&(o.class=e[16][e[90]]),514&i[0]&&(o.open=e[9]&&!e[1]&&0===e[90]),439293&i[0]|536870912&i[2]|128&i[3]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Yl(e){let t,n;return t=new zl({props:{praefix:e[90],item:e[97],eventId:e[6],record:e[88],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:rs,classId:e[5],disabled:e[0],required:e[23],selectionFields:e[30],propSelection:e[15],numberInput:e[18],currency:e[7],formnovalidate:e[90]===e[12].length-1||e[12][e[90]]._delete}}),t.$on("notify",(function(){k(e[32](e[97],e[90]))&&e[32](e[97],e[90]).apply(this,arguments)})),t.$on("task",e[53]),t.$on("invalid",e[33]),t.$on("defPrep",e[34]),t.$on("checkRange",e[35]),t.$on("formula",e[44](e[90])),t.$on("record",e[54]),t.$on("propSelection",e[45](e[90])),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};8&i[0]&&(o.item=e[97]),64&i[0]&&(o.eventId=e[6]),4096&i[0]&&(o.record=e[88]),16&i[0]&&(o.recordId=e[4]._id),4&i[0]&&(o.reqQuantity=e[2]),256&i[0]&&(o.notifyList=e[8]),32&i[0]&&(o.classId=e[5]),1&i[0]&&(o.disabled=e[0]),32768&i[0]&&(o.propSelection=e[15]),262144&i[0]&&(o.numberInput=e[18]),128&i[0]&&(o.currency=e[7]),4096&i[0]&&(o.formnovalidate=e[90]===e[12].length-1||e[12][e[90]]._delete),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Gl(e){let t,n,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Yl(Bl(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082429949&n[0]|24606&n[1]){let l;for(i=e[3].item,l=0;l<i.length;l+=1){const r=Bl(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Yl(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function Ul(e){let t,n,i=e[12][e[90]]._delete,o=Gl(e);return{c(){o.c(),t=F()},m(e,i){o.m(e,i),C(e,t,i),n=!0},p(e,n){4096&n[0]&&x(i,i=e[12][e[90]]._delete)?(me(),$e(o,1,1,v),fe(),o=Gl(e),o.c(),pe(o),o.m(t.parentNode,t)):o.p(e,n)},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){e&&j(t),o.d(e)}}}function Jl(e){let t,n,i,o,r=e[12].length,l=Ul(e);return{c(){t=q("div"),l.c(),i=D(),B(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[90]}`)},m(e,n){C(e,t,n),l.m(t,null),C(e,i,n),o=!0},p(e,i){4096&i[0]&&x(r,r=e[12].length)?(me(),$e(l,1,1,v),fe(),l=Ul(e),l.c(),pe(l),l.m(t,null)):l.p(e,i),(!o||40&i[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[90]}`))&&B(t,"id",n)},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(t),l.d(e),e&&j(i)}}}function Kl(e){let t,n,i,o,r,l=e[31](e[13],e[90])+"";return{c(){t=q("div"),n=E(l),B(t,"class",i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1"),B(t,"draggable",!0),W(t,"delete",e[88]._delete),W(t,"is-active-top",e[17]?.top===e[90]),W(t,"is-active-bottom",e[17]?.bottom===e[90])},m(i,l){C(i,t,l),_(t,n),o||(r=[z(t,"dragover",e[41]),z(t,"dragleave",e[42](e[90])),z(t,"dragstart",e[39](e[90])),z(t,"drop",T(e[38](e[90]))),z(t,"dragenter",e[40](e[90]))],o=!0)},p(o,r){e=o,8192&r[0]&&l!==(l=e[31](e[13],e[90])+"")&&O(n,l),8&r[0]&&i!==(i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&B(t,"class",i),4104&r[0]&&W(t,"delete",e[88]._delete),131080&r[0]&&W(t,"is-active-top",e[17]?.top===e[90]),131080&r[0]&&W(t,"is-active-bottom",e[17]?.bottom===e[90])},d(e){e&&j(t),o=!1,b(r)}}}function Zl(e){let t,n,i;var o=e[94];return o&&(t=new o({props:{size:"20"}})),{c(){t&&be(t.$$.fragment),n=F()},m(e,o){t&&ke(t,e,o),C(e,n,o),i=!0},p(e,i){if(o!==(o=e[94])){if(t){me();const e=t;$e(e.$$.fragment,1,0,(()=>{xe(e,1)})),fe()}o?(t=new o({props:{size:"20"}}),be(t.$$.fragment),pe(t.$$.fragment,1),ke(t,n.parentNode,n)):t=null}},i(e){i||(t&&pe(t.$$.fragment,e),i=!0)},o(e){t&&$e(t.$$.fragment,e),i=!1},d(e){e&&j(n),t&&xe(t,e)}}}function Xl(e){let t,n,i,o,r,l=!e[0]&&!e[3].readonly&&Zl(e);return{c(){t=q("span"),l&&l.c(),B(t,"class","pointer icon svelte-1es1ap1"),B(t,"title",e[92]),t.hidden=n=e[90]===e[12].length-1||!(e[88]._delete^e[93])},m(n,s){C(n,t,s),l&&l.m(t,null),i=!0,o||(r=z(t,"click",(function(){k(e[37](e[90],e[9],e[91]))&&e[37](e[90],e[9],e[91]).apply(this,arguments)})),o=!0)},p(o,r){(e=o)[0]||e[3].readonly?l&&(me(),$e(l,1,1,(()=>{l=null})),fe()):l?(l.p(e,r),9&r[0]&&pe(l,1)):(l=Zl(e),l.c(),pe(l,1),l.m(t,null)),(!i||4096&r[0]&&n!==(n=e[90]===e[12].length-1||!(e[88]._delete^e[93])))&&(t.hidden=n)},i(e){i||(pe(l),i=!0)},o(e){$e(l),i=!1},d(e){e&&j(t),l&&l.d(),o=!1,r()}}}function es(e){let t,n,i,o,r,l;n=new e[20]({props:{$$slots:{default:[Kl]},$$scope:{ctx:e}}}),n.$on("click",(function(){k(e[36](e[91],e[90],e[9]))&&e[36](e[91],e[90],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:Ae}],a=[];for(let t=0;t<2;t+=1)a[t]=Xl(Ol(e,s,t));const c=e=>$e(a[e],1,1,(()=>{a[e]=null}));return{c(){t=q("div"),be(n.$$.fragment),i=D();for(let e=0;e<2;e+=1)a[e].c();o=D(),B(t,"class",r=S("accordion "+e[3].name)+" svelte-1es1ap1"),B(t,"slot","handle")},m(e,r){C(e,t,r),ke(n,t,null),_(t,i);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,o),l=!0},p(i,d){e=i;const u={};if(143368&d[0]|128&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|64&d[1]|536870912&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:Ae}],n=0;n<2;n+=1){const i=Ol(e,s,n);a[n]?(a[n].p(i,d),pe(a[n],1)):(a[n]=Xl(i),a[n].c(),pe(a[n],1),a[n].m(t,o))}for(me(),n=2;n<2;n+=1)c(n);fe()}(!l||8&d[0]&&r!==(r=S("accordion "+e[3].name)+" svelte-1es1ap1"))&&B(t,"class",r)},i(e){if(!l){pe(n.$$.fragment,e);for(let e=0;e<2;e+=1)pe(a[e]);l=!0}},o(e){$e(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)$e(a[e]);l=!1},d(e){e&&j(t),xe(n),N(a,e)}}}function ts(e){let t,n,i=(!e[1]&&!e[0]||e[90]<e[12].length-1)&&Ql(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){!e[1]&&!e[0]||e[90]<e[12].length-1?i?(i.p(e,n),4099&n[0]&&pe(i,1)):(i=Ql(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ns(e){let t,n,i=e[12],o=[];for(let t=0;t<i.length;t+=1)o[t]=ts(Al(e,i,t));const r=e=>$e(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082635263&n[0]|32767&n[1]|570425344&n[2]){let l;for(i=e[12],l=0;l<i.length;l+=1){const r=Al(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ts(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){N(o,e),e&&j(t)}}}function is(e){let t,n,i,o,r,l,s=e[28]&&e[11]&&0!=e[11]&&Vl(e),a=e[26]&&e[14]&&0!=e[14]&&Wl(e),c=e[24]&&e[10]&&0!=e[10]&&Pl(e);return r=new e[21]({props:{class:e[5]+e[3].name,$$slots:{default:[ns,({closeOtherPanels:e})=>({87:e}),({closeOtherPanels:e})=>[0,0,e?33554432:0]]},$$scope:{ctx:e}}}),{c(){t=q("div"),s&&s.c(),n=D(),a&&a.c(),i=D(),c&&c.c(),o=D(),be(r.$$.fragment),B(t,"class","formList")},m(e,d){C(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,i),c&&c.m(t,null),_(t,o),ke(r,t,null),l=!0},p(e,l){e[28]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&pe(s,1)):(s=Vl(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[26]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&pe(a,1)):(a=Wl(e),a.c(),pe(a,1),a.m(t,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),e[24]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&pe(c,1)):(c=Pl(e),c.c(),pe(c,1),c.m(t,o)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe());const d={};40&l[0]&&(d.class=e[5]+e[3].name),504831&l[0]|33554432&l[2]|128&l[3]&&(d.$$scope={dirty:l,ctx:e}),r.$set(d)},i(e){l||(pe(s),pe(a),pe(c),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(a),$e(c),$e(r.$$.fragment,e),l=!1},d(e){e&&j(t),s&&s.d(),a&&a.d(),c&&c.d(),xe(r)}}}let os=new Map;const rs=!0,ls="pos/target";function ss(e,t,i){let o,r;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=G();let{list:g}=t,{mainSchema:v}=t,{schema:y}=t,{record:w}=t,{classId:b}=t,{eventId:k}=t,{disabled:x}=t,{fixed:I}=t,{template:S={}}=t,{reqQuantity:_}=t,{open:C=!1}=t,{currency:j}=t,{notifyList:N}=t;const q=y.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),L=q&&y.find((e=>"quantity"===e.name));let E=0;const D=y.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let F=0;const z=y.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",T=!!z;let A=0;const B={};let O,V=y.properties?.readonly,M=b.split("form-")[1].slice(0,-4),W=new Map;g.group&&(I=!0);const R={};x||=V;let P,H,Q=[],Y=[],J=!1,K={},Z=[];y.filter((e=>e.selection)).map((e=>Q.push({className:M,parentClass:y,refClass:e.selection,value:""}))),y.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{y.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[i,o]=n.split(".");o||(o=i,i=void 0),Z.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));const X=async(e,t,n)=>{const i=w[n];if(!i?.length)return;const o=i[0][n];if(!o)return;const r=await ta(n,o);return r?r[g.name]:void 0},ee=async(e,t)=>{const n=Z.filter((e=>(e.refObj||M)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:o,refName:r,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(o){const t=P[e][o];o===M&&r?d=w:t&&(d=await ta(o,t))}!o&&r&&(d=P[e]),d&&(u=d[r],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&i(12,P[e][n]="",P))}},te=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(n);let r=!1;o.forEach((e=>{e.required&&""===e.value&&(r=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),i(16,Y[e]=r||t?"invalid":"",Y)},ne=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},oe=(e,t)=>{if(!t)return;const n=y.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:l}=o,s=l.map((t=>P[e][t.refItem]||w[t.refItem]));let a=0;"$add"===r&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,i]=e.split(":");e=i?(+n+ +i/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0}))),"$multiply"===r&&(a=s.reduce(((e,t)=>+e*+t)));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;i(12,P[e][t]="$multiply"===r?a?a.toFixed(n.properties.decimals||0):"":(a||0).toFixed(n.properties.decimals||0),P),i(18,K={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};H=y.filter((e=>e.refClass)).reduce(((e,t)=>{const n=y.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,i]=t.selection.split(":"),[o]=i?.split(".")||[];o&&e.push({refClass:o,items:[n],selection:t.selection})}const i={refClass:t.refClass,items:[]};return n.forEach((e=>{i.items.push(e.name)})),e.push(i),e}),[]);const re=async(e,t,n,o)=>{const r=(await H).find((e=>e.refClass===t.refClass));if(!r)return;const{refClass:l,items:s,selection:a}=r,c=t.name;if(Z.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async r=>{const c=y.find((e=>e.name===r));if(c.properties?.readonly&&!t.refInput){const n=P[e][t.refClass];return Promise.resolve(ta(t.refClass,n,!0)).then((t=>{let n=t[r];Array.isArray(n)&&(n=n.length?n[0][r]:""),i(12,P[e][r]=n,P)}))}let d="";const{refInput:u}=t;if(u&&P[e]){const[t,n]=u.split(".");d=n?P[e][n]:w[t]}if(a&&n!==o)s.map((t=>{i(12,P[e][t]="",P)}));else if(u&&!d||le(e,r)||o!==n){const n=y.find((e=>e.refClass===l)),o=P[e][n.name];if(t.selection){const n=ea(t.selection+o.toString());if(n)return Promise.resolve(n).then((t=>i(12,P[e][r]=t[r],P)))}return Promise.resolve(ta(n.refClass,o)).then((t=>i(12,P[e][r]=t[r],P)))}}))):Promise.resolve(s.map((t=>{i(12,P[e][t]="",P)})))},le=(e,t)=>{let n=P[e][t];return"number"===y.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},se=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let ae=!1;const ce=e=>!(!I&&e>=P.length-1),de=(e,t=!1)=>{const[n,i]=e.split(";");return g.name===i&&(!!ce(t)&&((!1===t||t!=n)&&parseInt(n)))};y.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=y.find((e=>e.name===t.refItem))||y.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ue=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,i=document.querySelectorAll(n);if(!i?.length)return;const o=i[i.length-1];ie().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(se)})).then((()=>{t&&o.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&i(3,g=e.list),"mainSchema"in e&&i(46,v=e.mainSchema),"schema"in e&&i(47,y=e.schema),"record"in e&&i(4,w=e.record),"classId"in e&&i(5,b=e.classId),"eventId"in e&&i(6,k=e.eventId),"disabled"in e&&i(0,x=e.disabled),"fixed"in e&&i(1,I=e.fixed),"template"in e&&i(48,S=e.template),"reqQuantity"in e&&i(2,_=e.reqQuantity),"open"in e&&i(9,C=e.open),"currency"in e&&i(7,j=e.currency),"notifyList"in e&&i(8,N=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&w&&(i(2,_=w.quantity),i(12,P=(w[g.name]||[]).concat({})),(e=>{i(15,O={record:e})})(w)),4096&e.$$.dirty[0]&&i(13,o=P),15368&e.$$.dirty[0]&&o&&((()=>{if(D)i(14,F=P?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(T)i(11,A=P?.reduce(((e,t)=>e+(t._delete?0:+(t[z]||0))),0)||0)})(),(()=>{if(q)i(10,E=P?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}else if(t.price){const n=(L?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ie().then((()=>h("save",{listName:g.name,value:P,amountValue:E,weeksValue:A})))),262144&e.$$.dirty[1]&&(r=e=>B[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[x,I,_,g,w,b,k,j,N,C,E,A,P,o,F,O,Y,J,K,l,a,d,u,undefined,q,{name:"amountValue",properties:{decimals:2}},D,{name:"hoursValue",properties:{decimals:2}},T,{name:"weeksValue",properties:{decimals:1}},Q,(e,t)=>{let n=e[t];return R["pos"+t]&&(n=R["pos"+t]),n&&y.filter((e=>!0!==e.properties?.hidden&&("dateRange"===e.type||void 0!==n[e.name])&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?r(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?$(n[e.name]):"dateRange"===e.type?((e,t)=>{let n,i;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{i=t[e+"_to"],i=new Date(i||"").toLocaleDateString(),"Invalid Date"===i&&(i="")}catch{i=""}return[n,i].filter((e=>""!==e)).join(" - ").trim()})(e.name,n):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:r,value:l,add:s,desc:a}=n;if(g.refItem){const n=await X(t,e,g.refItem);n&&i(12,P=n)}oe(t,e._formulaActor);const c=Q?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&P.length===t+1&&i(12,P=P.concat({})),a&&i(49,B[l]=a,B),await re(t,e,l,r),await ee(t,e.name),i(13,o=P),"number"===e.type&&i(18,K={item:e,value:l,idx:t}),te(t)},({detail:e})=>{const{idx:t,value:n}=e;te(t,n)},async({detail:{className:e,itemName:t,value:i}})=>{if(W.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===M+"."+g.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&W.set(e,r[0])},({detail:e})=>{const{idx:t,fieldId:n,value:i}=e;if(!i)return;const o=ne(i);let r=!1;P.forEach(((e,n)=>{if(t===n)return;const{start:i,end:l}=P[n];i&&l&&o>ne(i)&&o<ne(l)&&(r=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",r)},(e,t,n)=>n=>{P[t]._delete||(e(n),ue(t,!0))},(e,t,n)=>o=>{if(i(12,P[e]._delete=!P[e]._delete,P),P[e]._delete){R["pos"+e]={...P[e]};for(const t of y)i(12,P[e][t.name]="",P);t&&n(o)}else{if(R["pos"+e]){const t={};for(const n of y)t[n.name]=R["pos"+e][n.name];i(12,P[e]=t,P)}R["pos"+e]=void 0,t||n(o)}},e=>t=>{t.preventDefault(),i(17,J=!1);const n=de(t.dataTransfer.getData(ls),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const o=[...P].map(((e,t)=>(e._index=t,e)));n<e?(o.splice(e+1,0,o[n]),o.splice(n,1)):(o.splice(e,0,o[n]),o.splice(n+1,1)),o.map(((e,t)=>{return n=e._index,i=t,void os.set(i,n);var n,i}));let r=[];Y.map(((e,t)=>{r[t]=Y[(e=>{const t=os.get(e);return void 0===t?e:t})(t)]})),i(16,Y=r),i(12,P=o.map(((e,t)=>(delete e._index,e)))),ae=!1},e=>t=>{if(!ce(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(ls,e+";"+g.name),ae=e},e=>t=>{const n=de(t.dataTransfer.getData(ls),e)||ae;return!1===n||n===e?i(17,J=!1):void i(17,J={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{i(17,J=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(W).forEach((([t,n])=>{P[e][t]||i(12,P[e][t]=n._id,P)}))}),500);const o=new Set;for(const e of Z)o.add(e.refObj||M);for(const t of Array.from(o))ee(e,t);t(n),ue(e)},e=>({detail:t})=>{oe(e,t.item.name)},e=>async({detail:t})=>{const{itemName:n,itemType:o,source:r,target:l,sourceId:s,prop:a}=t;if(!s)return void i(12,P[e][n]="",P);let c=await ta(r,s);const d=c[a];c=await ta(g.name,w[g.name][e][g.name]);const u=c[l];let m="number"===o?0:"",f=0;u.forEach((e=>{const t=e[a];t.length<=f||t.every((e=>d.find((t=>t===e))))&&(m=e[n],f=t.length)})),i(12,P[e][n]=m,P)},v,y,S,B,function(e){A=e,i(11,A)},function(e){F=e,i(14,F)},function(e){E=e,i(10,E)},function(t){U(e,t)},function(t){U(e,t)}]}class as extends Se{constructor(e){var t;super(),Tl.getElementById("svelte-1es1ap1-style")||((t=q("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(Tl.head,t)),Ie(this,e,ss,is,x,{list:3,mainSchema:46,schema:47,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:48,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:cs,document:ds}=ve;function us(e,t,n){const i=e.slice();return i[127]=t[n],i}function ms(e,t,n){const i=e.slice();return i[130]=t[n],i}function fs(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function ps(e){let t,n,i=e[126]&&function(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g=e[2].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=hs(ms(e,g,t));const y=e=>$e(v[e],1,1,(()=>{v[e]=null}));let w=e[2].list&&gs(e),k=!e[0]&&!e[3]&&e[41]&&e[4]&&!e[22]&&Cs(e);d=new e[25]({props:{outline:!0,$$slots:{default:[Ns]},$$scope:{ctx:e}}}),d.$on("click",e[44]);const x=[Ls,qs],I=[];function L(e,t){return e[6]?0:e[41]?1:-1}~(m=L(e))&&(f=I[m]=x[m](e));return{c(){t=q("section"),n=q("form"),i=q("input"),r=D();for(let e=0;e<v.length;e+=1)v[e].c();l=D(),w&&w.c(),s=D(),k&&k.c(),a=D(),c=q("div"),be(d.$$.fragment),u=D(),f&&f.c(),B(i,"class",S(e[31])+" svelte-9xiaib"),B(i,"name","_id"),B(i,"type","hidden"),i.value=o=e[5]._id||"",B(n,"class",S(e[32])+" svelte-9xiaib"),B(n,"id",e[31]),B(c,"class","form--buttons svelte-9xiaib"),B(t,"class",S(e[33])+" svelte-9xiaib")},m(o,f){C(o,t,f),_(t,n),_(n,i),_(n,r);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),k&&k.m(t,null),_(t,a),_(t,c),ke(d,c,null),_(c,u),~m&&I[m].m(c,null),p=!0,$||(h=[z(n,"keydown",e[49]),z(n,"submit",T(e[43]))],$=!0)},p(e,r){if((!p||32&r[0]&&o!==(o=e[5]._id||""))&&(i.value=o),4264228&r[0]|58835457&r[1]){let t;for(g=e[2].items,t=0;t<g.length;t+=1){const i=ms(e,g,t);v[t]?(v[t].p(i,r),pe(v[t],1)):(v[t]=hs(i),v[t].c(),pe(v[t],1),v[t].m(n,l))}for(me(),t=g.length;t<v.length;t+=1)y(t);fe()}e[2].list?w?(w.p(e,r),4&r[0]&&pe(w,1)):(w=gs(e),w.c(),pe(w,1),w.m(n,null)):w&&(me(),$e(w,1,1,(()=>{w=null})),fe()),e[0]||e[3]||!e[41]||!e[4]||e[22]?k&&(me(),$e(k,1,1,(()=>{k=null})),fe()):k?(k.p(e,r),4194329&r[0]&&pe(k,1)):(k=Cs(e),k.c(),pe(k,1),k.m(t,a));const s={};512&r[4]&&(s.$$scope={dirty:r,ctx:e}),d.$set(s);let u=m;m=L(e),m===u?~m&&I[m].p(e,r):(f&&(me(),$e(I[u],1,1,(()=>{I[u]=null})),fe()),~m?(f=I[m],f?f.p(e,r):(f=I[m]=x[m](e),f.c()),pe(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)pe(v[e]);pe(w),pe(k),pe(d.$$.fragment,e),pe(f),p=!0}},o(e){v=v.filter(cs);for(let e=0;e<v.length;e+=1)$e(v[e]);$e(w),$e(k),$e(d.$$.fragment,e),$e(f),p=!1},d(e){e&&j(t),N(v,e),w&&w.d(),k&&k.d(),xe(d),~m&&I[m].d(),$=!1,b(h)}}}(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[126]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function $s(e){let t,n;return t=new zl({props:{classId:e[31],item:e[130],selection:e[130].selection,record:e[5],disabled:e[22],eventId:e[40],toDelete:e[12],currency:e[8],changeValue:e[16]}}),t.$on("task",e[45]),t.$on("notify",e[46]),t.$on("safeReference",e[55]),t.$on("multi",e[47]),t.$on("defPrep",e[54]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.item=e[130]),4&n[0]&&(i.selection=e[130].selection),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4096&n[0]&&(i.toDelete=e[12]),256&n[0]&&(i.currency=e[8]),65536&n[0]&&(i.changeValue=e[16]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function hs(e){let t,n,i="list"!==e[130].type&&$s(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[130].type?i?(i.p(e,n),4&n[0]&&pe(i,1)):(i=$s(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function gs(e){let t,n,i,o,r,l=e[36]&&e[9]&&0!=e[9]&&vs(e),s=e[10]&&ws(e),a=e[37]&&e[15]&&0!=e[15]&&ks(e),c=e[2].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=_s(us(e,c,t));const u=e=>$e(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=D(),s&&s.c(),n=D(),a&&a.c(),i=D();for(let e=0;e<d.length;e+=1)d[e].c();o=F()},m(e,c){l&&l.m(e,c),C(e,t,c),s&&s.m(e,c),C(e,n,c),a&&a.m(e,c),C(e,i,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);C(e,o,c),r=!0},p(e,r){if(e[36]&&e[9]&&0!=e[9]?l?(l.p(e,r),512&r[0]&&pe(l,1)):(l=vs(e),l.c(),pe(l,1),l.m(t.parentNode,t)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[10]?s?(s.p(e,r),1024&r[0]&&pe(s,1)):(s=ws(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[37]&&e[15]&&0!=e[15]?a?(a.p(e,r),32768&r[0]&&pe(a,1)):(a=ks(e),a.c(),pe(a,1),a.m(i.parentNode,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),4612524&r[0]|33686017&r[1]){let t;for(c=e[2].list,t=0;t<c.length;t+=1){const n=us(e,c,t);d[t]?(d[t].p(n,r),pe(d[t],1)):(d[t]=_s(n),d[t].c(),pe(d[t],1),d[t].m(o.parentNode,o))}for(me(),t=c.length;t<d.length;t+=1)u(t);fe()}},i(e){if(!r){pe(l),pe(s),pe(a);for(let e=0;e<c.length;e+=1)pe(d[e]);r=!0}},o(e){$e(l),$e(s),$e(a),d=d.filter(cs);for(let e=0;e<d.length;e+=1)$e(d[e]);r=!1},d(e){l&&l.d(e),e&&j(t),s&&s.d(e),e&&j(n),a&&a.d(e),e&&j(i),N(d,e),e&&j(o)}}}function vs(e){let t,n;return t=new e[26]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[ys]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function ys(e){let t,n,i;function o(t){e[64](t)}let r={item:e[34],disabled:!0,currency:e[8]};return void 0!==e[9]&&(r.value=e[9]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&512&i[0]&&(n=!0,o.value=e[9],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function ws(e){let t,n;return t=new e[26]({props:{name:"Total MWSt "+(e[11]?"("+e[11]+"%)":""),nameClass:"formField_italic",$$slots:{default:[bs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2048&n[0]&&(i.name="Total MWSt "+(e[11]?"("+e[11]+"%)":"")),1280&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function bs(e){let t,n,i;function o(t){e[65](t)}let r={item:e[35],disabled:!0,currency:e[8]};return void 0!==e[10]&&(r.value=e[10]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function ks(e){let t,n;return t=new e[26]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[xs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};32768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function xs(e){let t,n,i;function o(t){e[66](t)}let r={item:e[38],disabled:!0};return void 0!==e[15]&&(r.value=e[15]),t=new Ri({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};!n&&32768&i[0]&&(n=!0,o.value=e[15],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function Is(e){let t,n;return t=new ii({props:{classId:e[31],open:!e[3]&&1===e[2].list.length,list:e[127],template:e[17],eventId:e[40],schema:e[127].item,record:e[5],disabled:e[22],currency:e[8]}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};12&n[0]&&(i.open=!e[3]&&1===e[2].list.length),4&n[0]&&(i.list=e[127]),131072&n[0]&&(i.template=e[17]),4&n[0]&&(i.schema=e[127].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ss(e){let t,n;return t=new as({props:{classId:e[31],open:e[14],list:e[127],template:e[18],eventId:e[40],schema:e[127].item,mainSchema:e[2].item,record:e[5],disabled:e[22],fixed:e[127].fixed,reqQuantity:e[13],currency:e[8],notifyList:e[7]}}),t.$on("save",e[48]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.open=e[14]),4&n[0]&&(i.list=e[127]),262144&n[0]&&(i.template=e[18]),4&n[0]&&(i.schema=e[127].item),4&n[0]&&(i.mainSchema=e[2].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4&n[0]&&(i.fixed=e[127].fixed),8192&n[0]&&(i.reqQuantity=e[13]),256&n[0]&&(i.currency=e[8]),128&n[0]&&(i.notifyList=e[7]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function _s(e){let t,n,i,o,r,l;t=new e[24]({props:{text:e[127].designation}});const s=[Ss,Is],a=[];function c(e,t){return"array"===e[127].type?0:1}return i=c(e),o=a[i]=s[i](e),{c(){be(t.$$.fragment),n=D(),o.c(),r=F()},m(e,o){ke(t,e,o),C(e,n,o),a[i].m(e,o),C(e,r,o),l=!0},p(e,n){const l={};4&n[0]&&(l.text=e[127].designation),t.$set(l);let d=i;i=c(e),i===d?a[i].p(e,n):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),o=a[i],o?o.p(e,n):(o=a[i]=s[i](e),o.c()),pe(o,1),o.m(r.parentNode,r))},i(e){l||(pe(t.$$.fragment,e),pe(o),l=!0)},o(e){$e(t.$$.fragment,e),$e(o),l=!1},d(e){xe(t,e),e&&j(n),a[i].d(e),e&&j(r)}}}function Cs(e){let t,n,i,o;function r(t){e[67](t)}let l={title:"",$$slots:{default:[js]},$$scope:{ctx:e}};return void 0!==e[21]&&(l.checked=e[21]),n=new e[27]({props:l}),K.push((()=>we(n,"checked",r))),{c(){t=q("div"),be(n.$$.fragment),B(t,"class","askNext"),M(t,"margin-top","1em"),M(t,"margin-left","23em")},m(e,i){C(e,t,i),ke(n,t,null),o=!0},p(e,t){const o={};512&t[4]&&(o.$$scope={dirty:t,ctx:e}),!i&&2097152&t[0]&&(i=!0,o.checked=e[21],re((()=>i=!1))),n.$set(o)},i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){$e(n.$$.fragment,e),o=!1},d(e){e&&j(t),xe(n)}}}function js(e){let t;return{c(){t=q("span"),t.textContent="Weiter erfassen",M(t,"margin-left",".75em")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ns(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function qs(e){let t,n,i,o,r;t=new e[25]({props:{class:"close",disabled:e[22],form:e[31],filled:!0,type:"submit",$$slots:{default:[Es]},$$scope:{ctx:e}}});let l=e[4]&&!e[22]&&Ds(e),s=e[19]&&zs(e);return{c(){be(t.$$.fragment),n=D(),l&&l.c(),i=D(),s&&s.c(),o=F()},m(e,a){ke(t,e,a),C(e,n,a),l&&l.m(e,a),C(e,i,a),s&&s.m(e,a),C(e,o,a),r=!0},p(e,n){const r={};4194304&n[0]&&(r.disabled=e[22]),512&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[4]&&!e[22]?l?(l.p(e,n),4194320&n[0]&&pe(l,1)):(l=Ds(e),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=zs(e),s.c(),pe(s,1),s.m(o.parentNode,o)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){r||(pe(t.$$.fragment,e),pe(l),pe(s),r=!0)},o(e){$e(t.$$.fragment,e),$e(l),$e(s),r=!1},d(e){xe(t,e),e&&j(n),l&&l.d(e),e&&j(i),s&&s.d(e),e&&j(o)}}}function Ls(e){let t,n,i,o;t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Rs]},$$scope:{ctx:e}}}),t.$on("click",e[52]);let r=e[20]&&Ps(e);return{c(){be(t.$$.fragment),n=D(),r&&r.c(),i=F()},m(e,l){ke(t,e,l),C(e,n,l),r&&r.m(e,l),C(e,i,l),o=!0},p(e,n){const o={};512&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[20]?r?(r.p(e,n),1048576&n[0]&&pe(r,1)):(r=Ps(e),r.c(),pe(r,1),r.m(i.parentNode,i)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(t.$$.fragment,e),pe(r),o=!0)},o(e){$e(t.$$.fragment,e),$e(r),o=!1},d(e){xe(t,e),e&&j(n),r&&r.d(e),e&&j(i)}}}function Es(e){let t;return{c(){t=E("Speichern und schliessen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ds(e){let t,n;return t=new e[25]({props:{form:e[31],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[Fs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Fs(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function zs(e){let t,n,i,o,r;const l=[As,Ts],s=[];t=function(e,t){return e[39]?0:1}(e),n=s[t]=l[t](e);let a=e[20]&&Ms(e);return{c(){n.c(),i=D(),a&&a.c(),o=F()},m(e,n){s[t].m(e,n),C(e,i,n),a&&a.m(e,n),C(e,o,n),r=!0},p(e,t){n.p(e,t),e[20]?a?(a.p(e,t),1048576&t[0]&&pe(a,1)):(a=Ms(e),a.c(),pe(a,1),a.m(o.parentNode,o)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe())},i(e){r||(pe(n),pe(a),r=!0)},o(e){$e(n),$e(a),r=!1},d(e){s[t].d(e),e&&j(i),a&&a.d(e),e&&j(o)}}}function Ts(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[Bs]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[50](e[1]))&&e[50](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function As(e){let t,n;return t=new d({props:{text:e[39],extended:!0,$$slots:{default:[Vs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};2&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Bs(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Os(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Vs(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[Os]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[50](e[1]))&&e[50](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ms(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Ws]},$$scope:{ctx:e}}}),t.$on("click",(function(){k(e[51](e[1]))&&e[51](e[1]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Ws(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Rs(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Erstellen",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Ps(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Hs]},$$scope:{ctx:e}}}),t.$on("click",e[53]),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function Hs(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),ke(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),xe(n,e)}}}function Qs(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ys(e){let t,n,i,o;ds.title=t=e[23];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Qs,then:ps,catch:fs,value:126,blocks:[,,,]};return he(e[42](),r),{c(){n=D(),i=F(),r.block.c()},m(e,t){C(e,n,t),C(e,i,t),r.block.m(e,r.anchor=t),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(n,i){e=n,(!o||8388608&i[0])&&t!==(t=e[23])&&(ds.title=t),ge(r,e,i)},i(e){o||(pe(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}let Gs=new Map,Us=new Map,Js=new Map;const Ks=(e,t)=>{const i=t;return Gs.has(i)||Gs.set(i,n.getTasksList(t).then((({data:e})=>e))),Gs.get(i)},Zs=(e,t,i,o=!1)=>Us.get(i)||o?n.getTaskList(e,i).then((e=>(Us.set(i,e),e))):Ks(e,t).then((t=>t.find((({_id:e})=>e===i))||n.getTaskList(e,i))).then((e=>(Us.set(i,e),e))),Xs=(e,t)=>{Js.set(e,t)},ea=e=>Js.get(e),ta=(e,t,i=!1)=>!i&&Js.get(t)||n.getTask(e,t).then((e=>(Js.set(t,e),e))),na=(e,t)=>{if(!Gs.get(t))return;const i=t;Gs.set(i,n.getTasksList(t).then((({data:e})=>e)))};function ia(e,r,a){let d,f,p,$,v,y,w,b;I(e,m,(e=>a(78,v=e))),I(e,s,(e=>a(79,y=e))),I(e,o,(e=>a(80,w=e)));const{Divider:k,Button:x,FormField:S,Checkbox:_}=c,{loggedIn:C,currentTasks:j,environment:N}=u;I(e,C,(e=>a(81,b=e))),I(e,j,(e=>a(76,p=e))),I(e,N,(e=>a(77,$=e)));const q=JSON.parse(t.getItem("Locale")),L=G();let E,D,F,z,T,{schema:A}=r,{recID:B}=r,{prevEventID:O=!1}=r,{prev:V=!1}=r,{taskId:M=!1}=r,{description:W=""}=r,{root:R=!1}=r,{readonly:P}=r,{isStandalone:H}=r,U={},J={},K="form-"+A.class+Math.floor(9e3*Math.random()+1e3).toString();const Z=R?"fEmbedded":"fTask",X=R?"sEmbedded":"sTask";let ee="CHF";let te,ne,oe=0,re=0,le=0,se=0,ae=1,ce=!B&&A.list&&1===A.list.length;const de={},ue=A.items.find((e=>"price"===e.name&&!e.properties?.hidden)),me=A.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),fe=A.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),pe=!!ue||!!fe,$e=A.list?.filter((e=>"array"===e.type))?.length>1||pe,he=A.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,ge=!!he,ve=A.list?.filter((e=>"array"===e.type))?.length>1||ge,ye={},we=A.result?.resultDef[0].button?.description;let be,ke,xe,Ie,Se=0,_e=0,Ce=[],je=[],Ne=[],qe={},Le=new Map,Ee=A.class,De=A.id,Fe=!1,ze=-1!==window.location.search.indexOf("next=");const Te=!p?.length||p.find((e=>e===De));["readonly","hidden","required"].map((e=>{A.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");Ce.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));A.items.filter((e=>e.selection&&e.constraint)).map((e=>{je.push({name:e.name,selection:e.selection,constraint:e.constraint})}));A.items.filter((e=>e.lookup)).forEach((e=>{Ne.push({name:e.name,lookup:e.lookup})})),A.items.filter((e=>e.properties?.lookup)).forEach((e=>{Ne.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ae=async e=>{if(e?.length)for(const t of e){if(!t.lookup)break;const{name:e}=t;if(U[e])break;const{domain:i,value:o}=t.lookup;if("user"===i&&o){const t=b.user,i={[o]:t},r=await n.getSectionView(e,i);if(r?.length){const[{_id:t}]=r;t&&a(5,U[e]=t,U)}}}},Be=async e=>{if(!A.input)return;if(!A.input.length)return;if(A.input.length<2)return;const t=!e.input.class[0].name&&e.input.class[0].selection;if(!t)return;const i=e.input.class[1].name,[o,r]=e.input.class[1].destination?.split(".");if(!i||!r)return;const l=A.list?.find((e=>e.name===o));if(!l)return;const s=await n.getSchemaByClass(t),c=(await n.getTasks(s.id)).data;if(!c?.length)return;const d=[];for(const e of c)if(e.active??1){const t={};for(const n of l.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);d.push(t)}d.length&&a(5,U[o]=d,U)},Oe=async()=>{for(const e of A.items)"boolean"==typeof e.properties?.value&&a(5,U[e.name]=e.properties.value,U),e.properties?.value?.concatenation&&Ve(e);for(const e of A.list||[])for(const t of e.item)if("array"!==e.type&&"owner"===t.refItem){const i=await n.getSolitaire(t.refItem);i?.length&&(U[e.name]||a(5,U[e.name]={},U),a(5,U[e.name][t.name]=g(i[0],t.refPos||t.name),U))}},Ve=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await We(e.refItemNext));a(5,U[e.name]=n,U)},Me=async e=>{const t=Ce.filter((t=>t.refObj===e));if(t?.length){a(16,qe={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:r}=e;if(!n)break;let l,s,c=!i&&U[n];const d=U[n];d&&i&&(c=(await ta(n,d))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==r&&"readonly"!==r||(r="required"===r?r:"disabled",setTimeout((()=>{l=`#${K} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(r,""),s&&!c&&s.removeAttribute(r)}),0)),"hidden"===r&&(l=`#${K} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(16,qe[t]="",qe))}}},We=async e=>{const[t,i]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const l=e.refItem,s=await n.getLastId(A.class,l);if(!s?.length)return(o+r).toString().padStart(i,"0");const a=s[0][l];return((+a?.substring(t,t+i)||o)+r).toString().padStart(i,"0")},Re=(e,t,n,i=!1)=>{const o=n||t.name,r=o.startsWith("_")?o:o.split("_")[0],l=e.find((e=>e.name===r));let s=t.value;if(!l)return s;if(!i&&l.properties?.multi&&(s=U[o]),"dateRange"===l.type){if(null===s)return;let e=new Date(s);if("Invalid Date"==e)return;return e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString()}if(s&&l.type.startsWith("date"))try{return qn(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===l.type&&(s=!!t.checked),"number"===l.type){const e=Number("1.1").toLocaleString(q.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Pe=()=>H?window.close():R?window.singleSpaNavigate("/"):L("back"),He=async(e,t)=>{if(A.input&&A.input.length>1){if(A.input[0]!==e)return;const{recursive:i}=xe.input.class[1];if(t){const o=await n.getTaskOptions(`${e}:${t}`,De,i);a(5,U={...U,...o})}else{const e=A.input.slice(1);for(const t of e)a(5,U[t]=[],U)}}},Qe=()=>{let e=0;if(ue){let t=1;me&&(t=ae),e=se*t}fe&&(e=se);let t=0;for(const e in de)t+=de[e];a(9,oe=t+e)},Ye=()=>{let e=0;for(const t in ye)e+=ye[t];a(15,Se=e+ +_e)};i.subscribe((async e=>{if(!e)return;if(!B)return;const t=await n.getSchema(e.eventId);if(!t)return;const i=A.list?.find((e=>e.name===t.class));if(!i)return;const o=await n.getTaskById(e.taskId);((e,t,n)=>{if(!Gs.get(e))return;const i=t;Us.set(i,n)})(o.event,o.docId,o.data);const r=await n.getTask(t.class,o.docId),l=U[t.class].filter((e=>e[t.class]==r._id));l?.length&&l.map((e=>{e[t.class]=o.docId})),a(5,U),a(63,D),a(62,E),a(2,A)})),Q((()=>{Gs=new Map,Us=new Map,Js=new Map,Ge()}));const Ge=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(K))&&++n<20;)await e(50);t&&(()=>{if(B)return;const e=new Set;for(const t of Ce)e.add(t.refObj||Ee);Array.from(e).forEach((e=>Me(e)))})(),Ue()},Ue=()=>{setTimeout((()=>{Array.from(Le).forEach((([e,t])=>{U[e]||a(5,U[e]=t._id,U)}))}),350)};Y((()=>{B&&function(e,t,n=t){e.set(n)}(m,v={[B]:{record:U,lists:J}},v)}));const Je=()=>{const e={};Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,i]=t.name.split("."),o=A.list.find((e=>e.name===n));e[t.name]=Re(o.item,t)}else e[t.name]=Re(A.items,t,t.name.split("_")[0])})),A.list&&A.list.map((t=>{"array"===t.type&&J[t.name]&&(e[t.name]=J[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,i])=>("_delete"!==n&&(e[n]=Re(t.item,{name:n,value:i,checked:i},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const i=A.items.find((t=>t.name===e));i?.properties?.required&&!n&&(t=!1)})),t&&e},Ke=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(2,A=e.schema),"recID"in e&&a(3,B=e.recID),"prevEventID"in e&&a(0,O=e.prevEventID),"prev"in e&&a(60,V=e.prev),"taskId"in e&&a(1,M=e.taskId),"description"in e&&a(58,W=e.description),"root"in e&&a(4,R=e.root),"readonly"in e&&a(59,P=e.readonly),"isStandalone"in e&&a(61,H=e.isStandalone)},e.$$.update=()=>{268435456&e.$$.dirty[1]&&a(22,d=P),4&e.$$.dirty[0]|3&e.$$.dirty[2]&&D&&E&&A.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const i=E.items.find((t=>t.name===e));if(!i)return;if(t!==i.type)return;const o="_"+e;D[e]?a(5,U[e]=D[e],U):a(5,U[e]="",U),D[o]&&a(5,U[o]=D[o],U),a(14,ce=!1)})),16&e.$$.dirty[0]|134217728&e.$$.dirty[1]&&a(23,f=R?W||"enablerr - Form":document.title)},[O,M,A,B,R,U,F,T,ee,oe,re,le,te,ne,ce,Se,qe,be,ke,Fe,Ie,ze,d,f,k,x,S,_,C,j,N,K,Z,X,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},$e,ve,{name:"weekValue",properties:{decimals:1}},we,De,Te,async()=>{if(a(18,ke=[]),$.currency?a(8,ee=$.currency.designation):n.getSectionView("owner",{}).then((e=>{e?.length&&e[0].currency&&n.getSectionView("currency",{_id:e[0].currency}).then((e=>{e?.length&&e[0].designation&&a(8,ee=e[0].designation)}))})),xe=await n.getEvent(De),B||(a(17,be=ke),Ae(xe.input?.class),Oe(),Be(xe)),B){if(v&&v[B]){const e=v[B].record;A.items.map((t=>{e[t.name]=Re(A.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(5,U=e),A.list&&A.list.map((e=>{"array"===e.type&&v[B].lists[e.name]&&a(5,U[e.name]=v[B].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]),U)}))}else a(5,U=await n.getTask(A.class,B));a(58,W=h(A,U)),a(19,Fe=!!A.result?.resultDef&&!A.result.resultDef[0].createAfterSave),a(10,re=U._tax?._amount),a(11,le=100*U._tax?._rate||"")}if(O){a(59,P=!1),a(62,E=await n.getSchema(O)),"string"==typeof V&&a(63,D=await n.getTask(E.class,V));const e=A.items.find((e=>e.refClass===E.class));a(5,U[e.name]=D._id,U)}if(ve&&(_e=U[he]||0),xe.trigger?.startOn&&!xe.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(59,P=!0),y.role?.length&&A.authorization?.length){const e=A.authorization.some((e=>w?.find((t=>t===e.role&&"edit"===e.activity))));a(59,P||=!e)}if(a(6,F="report"===xe.output.type),$.userSetting){const e=$.userSetting;if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}else n.getUserSettings().then((e=>{if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}));return!0},async e=>{B||a(22,d=!0);const t=e.submitter?.className?.includes("close"),i={};if(Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),o=A.list.find((e=>e.name===t));i[e.name]=Re(o.item,e)}else i[e.name]=Re(A.items,e)})),A.list&&A.list.map((e=>{"array"===e.type&&J[e.name]&&(i[e.name]=J[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]))})),i._event=De,i._prevEventId=O,i._taskId=M,z){const e=z.record;for(const t in e)t.includes(".")&&delete e[t];e._event=z.event,e._taskId=z.taskId;const{id:t}=await n.saveData(z.class,e);i[z.class]||(i[z.class]=t)}const{id:o,task:r,tax:s,error:c}=await n.saveData(A.class,i);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(22,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(10,re=s?._amount||0),a(11,le=100*(s?._rate||0)||""),i._id=o;const u=await n.getTaskList(A.class,o);if(L("choose",{row:u}),t)return Pe();if(!B){if(ze){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${De}/${De}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${De}/${r}/task`)}},()=>!F&&O?window.history.back():Pe(),async({detail:e})=>{const{row:t}=e;let{eventId:i}=e;if((()=>{if(B)for(const e of Ce)e.refName||Me(e.itemName)})(),B)return;if(i||=t._task?.event,i&&(await(async(e,t)=>{if(!e)return;const i=(await n.getEvent(e)).output.class[0].name,o=Ne.filter((e=>e.lookup===i));if(o?.length)for(const e of o){const{lookup:n,name:i}=e;let o="";if(t){let e=await ta(n,t);e&&e[i]?.length&&(o=e[i][0][i])}a(5,U[i]=o,U)}})(i,t._id),A.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const t=await n.getEvent(i);t.output.class[0]?.name===e.properties.lookup&&a(5,U[e.name]="",U)}))),await(async()=>{let e,t=!1;const i={...U};for(const o of A.items)o.refItem&&U[o.refItem]&&(e=await n.getTask(o.refItem,U[o.refItem]),e&&(i[o.name]=e[o.name],t=!0));for(const o of A.list||[])if(o.refItem&&U[o.refItem]){e=await n.getTask(o.refItem,U[o.refItem]);const r=[];for(const n of e[o.name]){const e={};for(const t of o.item)n[t.name]&&(e[t.name]=n[t.name]);r.push(e),t=!0}i[o.name]=r}t&&a(5,U=i)})(),!t._task)return;const o=t._task.event,r=await n.getEvent(o);if(!xe.output?.class?.length)return;const l=xe.output.class[0]?.item.find((e=>(e.refClass||e.name)===r.output.class[0]?.name));(xe.input?.class?.length&&xe.input.class[0].name===r.output.class[0]?.name||l?.asInput)&&(a(62,E=await n.getSchema(o)),a(0,O=o),a(1,M=t._task._id),a(63,D=M?await n.getTask(E.class,t._task.docId):{}),He(E.class,t?._task?.docId))},async({detail:e})=>{if(a(7,T=e),"quantity"===e.itemName&&a(13,ne=U.quantity),(async(e,t)=>{const n=je.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(12,te=!1);for(const i of n){const{selection:n,constraint:o,name:r}=i;if(t)break;a(5,U[r]="",U),e===n&&a(12,te=o);const l=U[n];if(l&&e===o){let e=await ta(n,l);const t=U[o];if(t?.length){const n=t[0].split(", ");e=e[o];let i="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(i=t[r])}));a(5,U[r]=i,U)}}}}})(e.itemName,e.oldValue===e.value),Me(e.itemName),ve&&he&&(e.itemName===he&&(_e=+e.value),Ye()),pe&&$e){if(e.itemName===ue?.name)se=e.value;else if(e.itemName===me?.name)ae=e.value;else{if(e.itemName!==fe?.name)return;se=e.value}Qe()}},async({detail:e})=>{if(!(A.input?.length&&A.input.length>1))return;if(E?.class!==A.input[0])return;const{value:t,lookup:i,view:o}=e;if(!i)return;const[r]=i.split(":"),l=(await n.getSectionView(r,{[o]:{$in:t}})).map((e=>e._id));for(const e of A.input.slice(1)){a(5,U[e]=[],U);const t=await n.getSchemaByClass(e);t.id;let i=await n.getTasks(t.id);if(i=i.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[r]))),i?.length){const t=i.map((e=>e._id)),o=await n.getSectionView(e,{_id:{$in:t}});for(const t of o)t[e]=t._id;a(5,U[e]=o,U)}}},({detail:e})=>{J[e.listName]=e.value,$e&&(de[e.listName]=e.amountValue,Qe()),ve&&(ye[e.listName]=e.weeksValue||0,Ye())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const t=await n.getReportDoc(e)||{},{userReportId:i,type:o}=t;if(!i)return;const r="/api/userreport/"+i;if("ics"===o)return window.open(r,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+r+"&type="+o;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await n.getDocData(M);(async(e,t)=>{const n=window.screen.height,i=window.open("","_blank","width=800,height="+n+",location=no");await ie(),i?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),i?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),A.identity.designation)},async()=>{const e=Je();if(!e)return;const t=xe.result?.resultDef[0]?.addToReports;if(t){const i=e[t];if(i){const t={docId:i},o=(await n.getSectionView("_task",t))[0];e._taskId=o._id}}const{reportId:i,type:o}=await n.createReport(De,e);Ke(i),setTimeout(Pe,2e3)},async()=>{const e=Je();if(!e)return;const t=await n.getReportData(De,e),i=window.screen.height,o=window.open("","_blank","width=800,height="+i+",location=no");await ie(),o?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(t,null,4)+"</textarea>")},async({detail:{className:e,itemName:t,value:i}})=>{if(Ee!==i)return;if(Le.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===Ee))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&Le.set(e,r[0])},({detail:e})=>{z=e},({detail:e})=>{setTimeout((()=>{a(5,U[e.itemName]=e.value,U)}),200)},()=>A.result.resultDef[0].button?.designation||"Dokument erstellen",W,P,V,H,E,D,function(e){oe=e,a(9,oe)},function(e){re=e,a(10,re)},function(e){Se=e,a(15,Se)},function(e){ze=e,a(21,ze)}]}class oa extends Se{constructor(e){var t;super(),ds.getElementById("svelte-9xiaib-style")||((t=q("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(ds.head,t)),Ie(this,e,ia,Ys,x,{schema:2,recID:3,prevEventID:0,prev:60,taskId:1,description:58,root:4,readonly:59,isStandalone:61},[-1,-1,-1,-1,-1])}}function ra(e){let t,n,i;function o(t){e[4](t)}let r={schema:e[5],recID:e[6]};return void 0!==e[0]&&(r.description=e[0]),t=new oa({props:r}),K.push((()=>we(t,"description",o))),t.$on("back",e[2]),{c(){be(t.$$.fragment)},m(e,n){ke(t,e,n),i=!0},p(e,i){const o={};32&i&&(o.schema=e[5]),64&i&&(o.recID=e[6]),!n&&1&i&&(n=!0,o.description=e[0],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){xe(t,e)}}}function la(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[ra,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){ke(t,e,i),n=!0},p(e,[n]){const i={};1&n&&(i.description=e[0]),353&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){xe(t,e)}}}function sa(e,t,i){let o,{refresh:r}=t;return e.$$set=e=>{"refresh"in e&&i(3,r=e.refresh)},[o,(e,t)=>n.getSchema(e).then((n=>({schema:n,recID:t,eventID:e,title:n.identity.designation}))),e=>{},r,function(e){o=e,i(0,o)}]}function aa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ca,da,ua=(ca=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r="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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==r(e))throw new Error("single-spa-svelte requires a configuration object");var t=i(i({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(l),r=Object.keys(e).reduce((function(t,n){return o.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),l=o();t.instance=new e.component(i(i({},r),{},{target:l,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},ca(da={exports:{}},da.exports),da.exports);const ma=aa(ua)({component:class extends Se{constructor(e){super(),Ie(this,e,sa,la,x,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:fa,mount:pa,unmount:$a}=ma;e({bootstrap:fa,mount:pa,unmount:$a});e("Form",oa),e("List",Nt),e("Template",class extends Se{constructor(e){var t;super(),En.getElementById("svelte-1phofh5-style")||((t=q("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(En.head,t)),Ie(this,e,Qn,Pn,x,{schema:0,record:1})}})}}}));