@enablerr-ui/detail 0.2.567 → 0.2.568

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,o,r,i,l,s,a,c,d,u;return{setters:[function(e){t=e.Request,n=e.task_notification,o=e.currentRoles,r=e.TextArea,i=e.Storage,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions},function(e){d=e.user},function(e){u=e.taskClipboard}],execute:function(){e("version","0.2.567");const m=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),f=e=>{try{return new Date(e).toLocaleString()}catch{return e}},p=e=>e?"(ja)":"(nein)",$=(e,t)=>{const n={...t};return(e.display?.reduce(((t,o)=>{let[r,i]=o.split(".");if(e.list?.find((({name:e})=>e===r))&&i&&void 0!==n[r]){const e=`${r}_${i}`;n[e]=n[r][i],r=e}return t.find((e=>e===r))||t.push(r),t}),[]).map((e=>"boolean"==typeof n[e]?p(n[e]):m(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&p(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function h(){}function g(e){return e()}function v(){return Object.create(null)}function y(e){e.forEach(g)}function b(e){return"function"==typeof e}function w(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function k(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return h;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function x(e){return null==e?"":e}function I(e,t){e.appendChild(t)}function _(e,t,n){e.insertBefore(t,n||null)}function q(e){e.parentNode.removeChild(e)}function S(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function N(e){return document.createElement(e)}function j(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function C(e){return document.createTextNode(e)}function L(){return C(" ")}function F(){return C("")}function E(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function D(e){return function(t){return t.preventDefault(),e.call(this,t)}}function z(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function T(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function V(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function A(e,t){e.value=null==t?"":t}function B(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function O(e,t,n){e.classList[n?"add":"remove"](t)}let M;function W(e){M=e}function R(){if(!M)throw new Error("Function called outside component initialization");return M}function P(e){R().$$.on_mount.push(e)}function H(){const e=R();return(t,n)=>{const o=e.$$.callbacks[t];if(o){const r=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);o.slice().forEach((t=>{t.call(e,r)}))}}}function Q(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const Y=[],G=[],J=[],U=[],Z=Promise.resolve();let K=!1;function X(){K||(K=!0,Z.then(ie))}function ee(){return X(),Z}function te(e){J.push(e)}function ne(e){U.push(e)}let oe=!1;const re=new Set;function ie(){if(!oe){oe=!0;do{for(let e=0;e<Y.length;e+=1){const t=Y[e];W(t),le(t.$$)}for(W(null),Y.length=0;G.length;)G.pop()();for(let e=0;e<J.length;e+=1){const t=J[e];re.has(t)||(re.add(t),t())}J.length=0}while(Y.length);for(;U.length;)U.pop()();K=!1,oe=!1,re.clear()}}function le(e){if(null!==e.fragment){e.update(),y(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(te)}}const se=new Set;let ae;function ce(){ae={r:0,c:[],p:ae}}function de(){ae.r||y(ae.c),ae=ae.p}function ue(e,t){e&&e.i&&(se.delete(e),e.i(t))}function me(e,t,n,o){if(e&&e.o){if(se.has(e))return;se.add(e),ae&&ae.c.push((()=>{se.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}function fe(e,t){const n=t.token={};function o(e,o,r,i){if(t.token!==n)return;t.resolved=i;let l=t.ctx;void 0!==r&&(l=l.slice(),l[r]=i);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==o&&e&&(ce(),me(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),de())})):t.block.d(1),s.c(),ue(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[o]=s),a&&ie()}if((r=e)&&"object"==typeof r&&"function"==typeof r.then){const n=R();if(e.then((e=>{W(n),o(t.then,1,t.value,e),W(null)}),(e=>{if(W(n),o(t.catch,2,t.error,e),W(null),!t.hasCatch)throw e})),t.current!==t.pending)return o(t.pending,0),!0}else{if(t.current!==t.then)return o(t.then,1,t.value,e),!0;t.resolved=e}var r}function pe(e,t,n){const o=t.slice(),{resolved:r}=e;e.current===e.then&&(o[e.value]=r),e.current===e.catch&&(o[e.error]=r),e.block.p(o,n)}const $e="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function he(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function ge(e){e&&e.c()}function ve(e,t,n,o){const{fragment:r,on_mount:i,on_destroy:l,after_update:s}=e.$$;r&&r.m(t,n),o||te((()=>{const t=i.map(g).filter(b);l?l.push(...t):y(t),e.$$.on_mount=[]})),s.forEach(te)}function ye(e,t){const n=e.$$;null!==n.fragment&&(y(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function be(e,t,n,o,r,i,l=[-1]){const s=M;W(e);const a=e.$$={fragment:null,ctx:null,props:i,update:h,not_equal:r,bound:v(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:v(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return a.ctx&&r(a.ctx[t],a.ctx[t]=i)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](i),c&&function(e,t){-1===e.$$.dirty[0]&&(Y.push(e),X(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,y(a.before_update),a.fragment=!!o&&o(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(q)}else a.fragment&&a.fragment.c();t.intro&&ue(e.$$.fragment),ve(e,t.target,t.anchor,t.customElement),ie()}W(s)}class we{$destroy(){ye(this,1),this.$destroy=h}$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 ke(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("circle"),o=j("polyline"),r=j("line"),T(n,"cx","12"),T(n,"cy","12"),T(n,"r","10"),T(o,"points","8 12 12 16 16 12"),T(r,"x1","12"),T(r,"y1","8"),T(r,"x2","12"),T(r,"y2","16"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-arrow-down-circle "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-arrow-down-circle "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function xe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ie extends we{constructor(e){super(),be(this,e,xe,ke,w,{size:0,strokeWidth:1,class:2})}}function _e(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),T(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),T(o,"points","22 4 12 14.01 9 11.01"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-check-circle "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-check-circle "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function qe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Se extends we{constructor(e){super(),be(this,e,qe,_e,w,{size:0,strokeWidth:1,class:2})}}function Ne(e){let t,n,o;return{c(){t=j("svg"),n=j("path"),T(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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",o="feather feather-command "+e[2])},m(e,o){_(e,t,o),I(t,n)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-command "+e[2])&&T(t,"class",o)},i:h,o:h,d(e){e&&q(t)}}}function je(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ce extends we{constructor(e){super(),be(this,e,je,Ne,w,{size:0,strokeWidth:1,class:2})}}function Le(e){let t,n,o,r;return{c(){t=j("svg"),n=j("polyline"),o=j("path"),T(n,"points","9 10 4 15 9 20"),T(o,"d","M20 4v7a4 4 0 0 1-4 4H4"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-corner-down-left "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-corner-down-left "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Fe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ee extends we{constructor(e){super(),be(this,e,Fe,Le,w,{size:0,strokeWidth:1,class:2})}}function De(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("path"),o=j("line"),r=j("line"),T(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),T(o,"x1","18"),T(o,"y1","9"),T(o,"x2","12"),T(o,"y2","15"),T(r,"x1","12"),T(r,"y1","9"),T(r,"x2","18"),T(r,"y2","15"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-delete "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-delete "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function ze(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Te extends we{constructor(e){super(),be(this,e,ze,De,w,{size:0,strokeWidth:1,class:2})}}function Ve(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),r=j("line"),T(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),T(o,"points","15 3 21 3 21 9"),T(r,"x1","10"),T(r,"y1","14"),T(r,"x2","21"),T(r,"y2","3"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-external-link "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-external-link "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Ae(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Be extends we{constructor(e){super(),be(this,e,Ae,Ve,w,{size:0,strokeWidth:1,class:2})}}function Oe(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("circle"),o=j("line"),r=j("path"),T(n,"cx","12"),T(n,"cy","12"),T(n,"r","10"),T(o,"x1","2"),T(o,"y1","12"),T(o,"x2","22"),T(o,"y2","12"),T(r,"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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-globe "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-globe "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Me(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class We extends we{constructor(e){super(),be(this,e,Me,Oe,w,{size:0,strokeWidth:1,class:2})}}function Re(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),T(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"),T(o,"points","22,6 12,13 2,6"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-mail "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-mail "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Pe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class He extends we{constructor(e){super(),be(this,e,Pe,Re,w,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("circle"),T(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),T(o,"cx","12"),T(o,"cy","10"),T(o,"r","3"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-map-pin "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-map-pin "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Ye(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ge extends we{constructor(e){super(),be(this,e,Ye,Qe,w,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("polyline"),o=j("line"),r=j("path"),T(n,"points","23 7 23 1 17 1"),T(o,"x1","16"),T(o,"y1","8"),T(o,"x2","23"),T(o,"y2","1"),T(r,"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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-phone-outgoing "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-phone-outgoing "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Ue(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ze extends we{constructor(e){super(),be(this,e,Ue,Je,w,{size:0,strokeWidth:1,class:2})}}function Ke(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("polyline"),o=j("path"),r=j("rect"),T(n,"points","6 9 6 2 18 2 18 9"),T(o,"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"),T(r,"x","6"),T(r,"y","14"),T(r,"width","12"),T(r,"height","8"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-printer "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-printer "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Xe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class et extends we{constructor(e){super(),be(this,e,Xe,Ke,w,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,o,r;return{c(){t=j("svg"),n=j("circle"),o=j("line"),T(n,"cx","11"),T(n,"cy","11"),T(n,"r","8"),T(o,"x1","21"),T(o,"y1","21"),T(o,"x2","16.65"),T(o,"y2","16.65"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-search "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-search "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function nt(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class ot extends we{constructor(e){super(),be(this,e,nt,tt,w,{size:0,strokeWidth:1,class:2})}}const{document:rt}=$e;function it(e){e[33]=e[35].list,e[34]=e[35].items}function lt(e,t,n){const o=e.slice();return o[36]=t[n],o}function st(e,t,n){const o=e.slice();return o[39]=t[n],o}function at(e,t,n){const o=e.slice();return o[39]=t[n],o}function ct(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function dt(e){let t,n,o,r,i,l;it(e);let s=e[33]?.length&&ut(e),a=e[34]?.length&&mt(e),c=e[33]?.length&&$t(e);return{c(){s&&s.c(),t=L(),n=N("div"),o=N("table"),a&&a.c(),r=L(),i=N("tbody"),c&&c.c(),T(o,"striped",""),T(o,"class","svelte-btngop"),T(n,"class","eList svelte-btngop")},m(e,d){s&&s.m(e,d),_(e,t,d),_(e,n,d),I(n,o),a&&a.m(o,null),I(o,r),I(o,i),c&&c.m(i,null),l=!0},p(e,n){it(e),e[33]?.length?s?(s.p(e,n),4&n[0]&&ue(s,1)):(s=ut(e),s.c(),ue(s,1),s.m(t.parentNode,t)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[34]?.length?a?a.p(e,n):(a=mt(e),a.c(),a.m(o,r)):a&&(a.d(1),a=null),e[33]?.length?c?(c.p(e,n),4&n[0]&&ue(c,1)):(c=$t(e),c.c(),ue(c,1),c.m(i,null)):c&&(ce(),me(c,1,1,(()=>{c=null})),de())},i(e){l||(ue(s),ue(c),l=!0)},o(e){me(s),me(c),l=!1},d(e){s&&s.d(e),e&&q(t),e&&q(n),a&&a.d(),c&&c.d()}}}function ut(e){let t,n,o,r,i,l,s,a,c,d;function u(t){e[25](t)}let m={id:e[8]};return void 0!==e[3]&&(m.value=e[3]),o=new e[6]({props:m}),G.push((()=>he(o,"value",u))),o.$on("input",e[12]),s=new Te({props:{size:"18"}}),{c(){t=N("div"),n=C("Suchen: "),ge(o.$$.fragment),i=L(),l=N("span"),ge(s.$$.fragment),T(l,"class","feather pointer svelte-btngop"),B(t,"margin-bottom","1em"),B(t,"position","relative")},m(r,u){_(r,t,u),I(t,n),ve(o,t,null),I(t,i),I(t,l),ve(s,l,null),a=!0,c||(d=E(l,"click",e[15]),c=!0)},p(e,t){const n={};!r&&8&t[0]&&(r=!0,n.value=e[3],ne((()=>r=!1))),o.$set(n)},i(e){a||(ue(o.$$.fragment,e),ue(s.$$.fragment,e),a=!0)},o(e){me(o.$$.fragment,e),me(s.$$.fragment,e),a=!1},d(e){e&&q(t),ye(o),ye(s),c=!1,d()}}}function mt(e){let t,n,o,r=e[4]&&e[0]&&ft(),i=e[34],l=[];for(let t=0;t<i.length;t+=1)l[t]=pt(at(e,i,t));return{c(){t=N("thead"),n=N("tr"),r&&r.c(),o=L();for(let e=0;e<l.length;e+=1)l[e].c();T(n,"class","svelte-btngop"),T(t,"class","svelte-btngop")},m(e,i){_(e,t,i),I(t,n),r&&r.m(n,null),I(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?r||(r=ft(),r.c(),r.m(n,o)):r&&(r.d(1),r=null),2052&t[0]){let o;for(i=e[34],o=0;o<i.length;o+=1){const r=at(e,i,o);l[o]?l[o].p(r,t):(l[o]=pt(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&q(t),r&&r.d(),S(l,e)}}}function ft(e){let t;return{c(){t=N("th"),T(t,"class","svelte-btngop")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function pt(e){let t,n,o=e[39]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-btngop")},m(e,o){_(e,t,o),I(t,n)},p(e,t){4&t[0]&&o!==(o=e[39]?.designation+"")&&V(n,o)},d(e){e&&q(t)}}}function $t(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=yt(lt(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(28191&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=lt(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=yt(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function ht(e){let t,n,o,r,i=e[4]&&e[0]&&gt(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=vt(st(e,l,t));return{c(){t=N("tr"),i&&i.c(),n=L();for(let e=0;e<s.length;e+=1)s[e].c();o=L(),T(t,"class","pointer svelte-btngop"),O(t,"active",e[36]._id===e[1])},m(e,l){_(e,t,l),i&&i.m(t,null),I(t,n);for(let e=0;e<s.length;e+=1)s[e].m(t,null);I(t,o),r=!0},p(e,r){if(e[4]&&e[0]?i?(i.p(e,r),17&r[0]&&ue(i,1)):(i=gt(e),i.c(),ue(i,1),i.m(t,n)):i&&(ce(),me(i,1,1,(()=>{i=null})),de()),3588&r[0]){let n;for(l=e[34],n=0;n<l.length;n+=1){const i=st(e,l,n);s[n]?s[n].p(i,r):(s[n]=vt(i),s[n].c(),s[n].m(t,o))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}2054&r[0]&&O(t,"active",e[36]._id===e[1])},i(e){r||(ue(i),r=!0)},o(e){me(i),r=!1},d(e){e&&q(t),i&&i.d(),S(s,e)}}}function gt(e){let t,n,o,r,i;return o=new Be({props:{size:"18"}}),{c(){t=N("td"),n=N("a"),ge(o.$$.fragment),T(n,"href",r=e[14](e[36])),T(n,"target","_blank"),T(t,"class","editRow svelte-btngop")},m(e,r){_(e,t,r),I(t,n),ve(o,n,null),i=!0},p(e,t){(!i||4&t[0]&&r!==(r=e[14](e[36])))&&T(n,"href",r)},i(e){i||(ue(o.$$.fragment,e),i=!0)},o(e){me(o.$$.fragment,e),i=!1},d(e){e&&q(t),ye(o)}}}function vt(e){let t,n,o,r,i=e[9](e[36],e[39])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-btngop")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z((function(){b(e[10](e[36]))&&e[10](e[36]).apply(this,arguments)}))),o=!0)},p(t,o){e=t,4&o[0]&&i!==(i=e[9](e[36],e[39])+"")&&V(n,i)},d(e){e&&q(t),o=!1,r()}}}function yt(e){let t,n,o=e[13](e[36],e[34],e[3]),r=o&&ht(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){12&n[0]&&(o=e[13](e[36],e[34],e[3])),o?r?(r.p(e,n),12&n[0]&&ue(r,1)):(r=ht(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function bt(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function wt(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:bt,then:dt,catch:ct,value:35,blocks:[,,,]};return fe(n=e[2]&&e[11](),r),{c(){t=F(),r.block.c()},m(e,n){_(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,4&o[0]&&n!==(n=e[2]&&e[11]())&&fe(n,r)||pe(r,e,o)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),r.block.d(e),r.token=null,r=null}}}function kt(e,o,r){let i;const l=H(),{Loading:s,TextField:a}=c,{currentTasks:u}=d;k(e,u,(e=>r(26,i=e)));let f,{inputList:$}=o,{eventId:h}=o,{prevEventId:g}=o,{className:v}=o,{rowId:y}=o,{filterForReady:b=!1}=o,{refStatus:w}=o,{showEdit:x=!1}=o,{praefix:I=""}=o,{selectionFields:_=!1}=o,{deList:q}=o,S=!0,N="",j=v+Math.floor(9e3*Math.random()+1e3).toString()+"search";const C=(e,t)=>{if(!t)return;let n=e[t.name];if(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"boolean"==typeof n?p(n):m(e[`_${t.name}`]||n||"")},L=t.getSchemaByClass(v),F=async(e,n)=>{if(w)return r(16,w=[].concat(w)),e.filter((e=>!!w.find((t=>e._task.status===t))));if("Information"===n.state.task)return e;if(g){const n=await t.getEvent(g);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===v)return"Information"===n.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},E=async(e,t,n,o)=>{const{value:r,refClass:i}=o,[l,s]=n.split("."),a=r?.get(I),c=a&&await Fs(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let o=e?.find((e=>e._id===n[t]))||{};o={...o};for(const e in o)n[e]&&(o[e]=n[e]);for(const e in n)n[e]&&(o[e]=n[e]);return Cs(i+o._id.toString(),o),o})):e};P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(j)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await L;e.eventId===t.id&&(Es(t.class,e.eventId),r(2,S=!r(2,S=!1)))}));return e.$$set=e=>{"inputList"in e&&r(17,$=e.inputList),"eventId"in e&&r(18,h=e.eventId),"prevEventId"in e&&r(19,g=e.prevEventId),"className"in e&&r(20,v=e.className),"rowId"in e&&r(1,y=e.rowId),"filterForReady"in e&&r(21,b=e.filterForReady),"refStatus"in e&&r(16,w=e.refStatus),"showEdit"in e&&r(0,x=e.showEdit),"praefix"in e&&r(22,I=e.praefix),"selectionFields"in e&&r(23,_=e.selectionFields),"deList"in e&&r(24,q=e.deList)},[x,y,S,N,f,s,a,u,j,C,e=>()=>l("choose",{row:e}),async()=>{const e=await L;let n;r(4,f=(e=>!i?.length||!!i.find((t=>t===e)))(e.id));let o,s=n=$||await Ns(e.class,e.id),a=!1,c="";const d=_&&_?.find((t=>e.class===t.refClass.split(":")[0])),u=d?.value?.get&&d.value.get(I);if(u){const[n,r]=d.refClass.split(":");e.class===n&&(s=await E(s,n,r,d)),a=d.parentClass?.find((e=>"quantity"===e.name)),c=d.className,o=await t.getCountedSection(c,r.split(".")[0],u,n,"quantity")}r(0,x&&=!d),d||!b&&!w||(s=await F(s,e));let m=[],{display:p}=e;return p&&p.length?p.map((t=>{const[n,o]=t.split(".");let r=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));r&&(r={...r},r.name=`${n}_${o}`,s=s.map((e=>(e[n]&&(e[r.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),r||(r=e.items.find((e=>e.name===n))),m.find((e=>e?.name===n))||m.push(r)})):m=e.items,!x&&a?(m=m.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),s=s.map((e=>{const t=o.find((t=>t._id===e._id));return t&&(e.ist=t.quantity.$numberDecimal),e})),o.map((e=>{if(!s.find((t=>t._id===e._id))){const t=n.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,s.push(t)}})),l("init",s)):q&&(s=s.filter((e=>!q.find((t=>t._id===e._id))))),{list:s,items:m}},({detail:{value:e}})=>{r(3,N=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(C(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},e=>`/task/${e._task.event}/${e._task._id}/task?view=standalone`,()=>{r(3,N="")},w,$,h,g,v,b,I,_,q,function(e){N=e,r(3,N)}]}class xt extends we{constructor(e){var t;super(),rt.getElementById("svelte-btngop-style")||((t=N("style")).id="svelte-btngop-style",t.textContent=".feather.svelte-btngop.svelte-btngop{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-btngop.svelte-btngop{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-btngop .editRow.svelte-btngop{width:1em}.eList.svelte-btngop table.svelte-btngop{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-btngop table thead.svelte-btngop{position:sticky;top:0;background:#326173;color:white}.eList.svelte-btngop table thead tr.svelte-btngop{height:2.3em}.eList.svelte-btngop table tbody tr.svelte-btngop{height:2.75em !important}th.svelte-btngop.svelte-btngop,td.svelte-btngop.svelte-btngop{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-btngop.svelte-btngop:hover{background-color:#DAE1E5}tr.active.svelte-btngop.svelte-btngop{color:#326173;background-color:#fcebd5}",I(rt.head,t)),be(this,e,kt,wt,w,{inputList:17,eventId:18,prevEventId:19,className:20,rowId:1,filterForReady:21,refStatus:16,showEdit:0,praefix:22,selectionFields:23,deList:24},[-1,-1])}}function It(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function _t(e){let t,n,o=e[39]&&qt(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[39]?o?(o.p(e,n),8&n[0]&&ue(o,1)):(o=qt(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function qt(e){let t,n;return t=new e[19]({props:{title:e[15]?"Auswahl":e[0],class:"eList "+(e[13]?"form":""),$$slots:{default:[Tt]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};32769&n[0]&&(o.title=e[15]?"Auswahl":e[0]),8192&n[0]&&(o.class="eList "+(e[13]?"form":"")),524286&n[0]|512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function St(e){let t,n;return t=new zs({props:{schema:e[2],recID:e[1],readonly:e[14]}}),t.$on("choose",(function(){b(e[28](e[39]))&&e[28](e[39]).apply(this,arguments)})),t.$on("back",e[25]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};4&o[0]&&(r.schema=e[2]),2&o[0]&&(r.recID=e[1]),16384&o[0]&&(r.readonly=e[14]),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Nt(e){let t,n,o,r,i,l,s;t=new e[20]({props:{text:e[15]?"Zusätzliche Auswahl":""}});const a=[Ct,jt],c=[];function d(e,t){return e[15]?0:1}return o=d(e),r=c[o]=a[o](e),l=new xt({props:{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],showEdit:e[8]}}),l.$on("edit",e[29]),l.$on("choose",e[32]),l.$on("init",e[30]),{c(){ge(t.$$.fragment),n=L(),r.c(),i=L(),ge(l.$$.fragment)},m(e,r){ve(t,e,r),_(e,n,r),c[o].m(e,r),_(e,i,r),ve(l,e,r),s=!0},p(e,n){const s={};32768&n[0]&&(s.text=e[15]?"Zusätzliche Auswahl":""),t.$set(s);let u=o;o=d(e),o===u?c[o].p(e,n):(ce(),me(c[u],1,1,(()=>{c[u]=null})),de(),r=c[o],r?r.p(e,n):(r=c[o]=a[o](e),r.c()),ue(r,1),r.m(i.parentNode,i));const m={};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]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(ue(t.$$.fragment,e),ue(r),ue(l.$$.fragment,e),s=!0)},o(e){me(t.$$.fragment,e),me(r),me(l.$$.fragment,e),s=!1},d(e){ye(t,e),e&&q(n),c[o].d(e),e&&q(i),ye(l,e)}}}function jt(e){let t,n,o,r;n=new e[21]({props:{outline:!0,$$slots:{default:[Lt]},$$scope:{ctx:e}}}),n.$on("click",e[26]);let i=e[23]&&e[10]&&Ft(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),i&&i.c(),T(t,"class","form--buttons svelte-jb5mrh")},m(e,l){_(e,t,l),ve(n,t,null),I(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};512&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[23]&&e[10]?i?(i.p(e,o),1024&o[0]&&ue(i,1)):(i=Ft(e),i.c(),ue(i,1),i.m(t,null)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(n.$$.fragment,e),ue(i),r=!0)},o(e){me(n.$$.fragment,e),me(i),r=!1},d(e){e&&q(t),ye(n),i&&i.d()}}}function Ct(e){let t,n,o,r,i,l,s=e[18]&&Dt(e);return o=new e[21]({props:{outline:!0,$$slots:{default:[zt]},$$scope:{ctx:e}}}),o.$on("click",e[26]),i=new e[20]({props:{text:"Liste aus "+e[12]}}),{c(){s&&s.c(),t=L(),n=N("div"),ge(o.$$.fragment),r=L(),ge(i.$$.fragment),T(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),_(e,t,a),_(e,n,a),ve(o,n,null),_(e,r,a),ve(i,e,a),l=!0},p(e,n){e[18]?s?(s.p(e,n),262144&n[0]&&ue(s,1)):(s=Dt(e),s.c(),ue(s,1),s.m(t.parentNode,t)):s&&(ce(),me(s,1,1,(()=>{s=null})),de());const r={};512&n[1]&&(r.$$scope={dirty:n,ctx:e}),o.$set(r);const l={};4096&n[0]&&(l.text="Liste aus "+e[12]),i.$set(l)},i(e){l||(ue(s),ue(o.$$.fragment,e),ue(i.$$.fragment,e),l=!0)},o(e){me(s),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&q(t),e&&q(n),ye(o),e&&q(r),ye(i,e)}}}function Lt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Ft(e){let t,n;return t=new e[21]({props:{filled:!0,$$slots:{default:[Et]},$$scope:{ctx:e}}}),t.$on("click",e[27]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Et(e){let t;return{c(){t=C("Neu")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Dt(e){let t,n;return t=new hl({props:{item:e[16],record:{_id:"",[e[16].name]:""},noForm:"true",classId:"sel_"+e[16].name,eventId:e[17],required:!1,hidden:!1,readonly:!1,deList:e[18]}}),t.$on("notify",e[31]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};65536&n[0]&&(o.item=e[16]),65536&n[0]&&(o.record={_id:"",[e[16].name]:""}),65536&n[0]&&(o.classId="sel_"+e[16].name),131072&n[0]&&(o.eventId=e[17]),262144&n[0]&&(o.deList=e[18]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function zt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Tt(e){let t,n,o,r;const i=[Nt,St],l=[];function s(e,t){return e[39].length&&!e[13]?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function Vt(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function At(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Vt,then:_t,catch:It,value:39,blocks:[,,,]};return fe(n=e[24](e[3]),r),{c(){t=F(),r.block.c()},m(e,n){_(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,8&o[0]&&n!==(n=e[24](e[3]))&&fe(n,r)||pe(r,e,o)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),r.block.d(e),r.token=null,r=null}}}function Bt(e,n,o){let r;const{Dialog:i,Divider:l,Button:s}=c,a=H(),{currentTasks:u}=d;k(e,u,(e=>o(35,r=e)));let{title:m}=n,{schema:f}=n,{recID:p}=n,{isOpening:$=!0}=n,{filterForReady:h=!1}=n,{refStatus:g}=n,{praefix:v=""}=n,{selectionFields:y=!1}=n,{showEdit:b=!0}=n,{deList:w}=n,{newAllowed:x=!0}=n,{prevEventId:I}=n,_=f.id;f.class;let q,S,N,j,C,L,F,E="",D=!1;m??=f.identity.designation;const z=!r?.length||r.find((e=>e===_));return e.$$set=e=>{"title"in e&&o(0,m=e.title),"schema"in e&&o(2,f=e.schema),"recID"in e&&o(1,p=e.recID),"isOpening"in e&&o(3,$=e.isOpening),"filterForReady"in e&&o(4,h=e.filterForReady),"refStatus"in e&&o(5,g=e.refStatus),"praefix"in e&&o(6,v=e.praefix),"selectionFields"in e&&o(7,y=e.selectionFields),"showEdit"in e&&o(8,b=e.showEdit),"deList"in e&&o(9,w=e.deList),"newAllowed"in e&&o(10,x=e.newAllowed),"prevEventId"in e&&o(11,I=e.prevEventId)},[m,p,f,$,h,g,v,y,b,w,x,I,E,D,q,N,C,L,F,i,l,s,u,z,async e=>{if(!e)return!1;const n=await Ns(f.class,f.id);if(S=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),o(15,N=S?.value?.get&&S.value.get(v)),N){j=S.refClass;const[e,n]=j.split(":"),[r]=n.split(".");o(16,C=S.parentClass.find((t=>t.name===e)));const i=await t.getSchemaByClass(C.refClass);o(17,L=i.id),o(12,E=S.parentClass.find((e=>e.name===r)).designation)}return n},()=>{o(13,D=!1),p||a("back"),b||a("back")},()=>{o(13,D=!1),a("back")},()=>{o(1,p=!1),o(14,q=!1),o(13,D=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,o]=t.split(".");let r=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));if(r){e[`${n}_${o}`]=e[n][o]}})),a("choose",{row:e})},({detail:e})=>{o(14,q=!!e._task.visum||"Closed"===e._task.status),o(1,p=e._docId),o(13,D=!0)},({detail:e})=>{N&&o(18,F=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){Q(e,t)}]}class Ot extends we{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=N("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}",I(document.head,t)),be(this,e,Bt,At,w,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11},[-1,-1])}}const{document:Mt}=$e;function Wt(e){e[27]=e[29].list,e[28]=e[29].items}function Rt(e,t,n){const o=e.slice();return o[30]=t[n],o}function Pt(e,t,n){const o=e.slice();return o[33]=t[n],o}function Ht(e,t,n){const o=e.slice();return o[33]=t[n],o}function Qt(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Yt(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Wt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Gt]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[28]?.length&&function(e){let t,n,o,r,i=e[28],l=[];for(let t=0;t<i.length;t+=1)l[t]=Jt(Ht(e,i,t));return{c(){t=N("thead"),n=N("tr"),o=N("th"),r=L();for(let e=0;e<l.length;e+=1)l[e].c();T(o,"class","svelte-14hcfjl"),T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,i){_(e,t,i),I(t,n),I(n,o),I(n,r);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(i=e[28],o=0;o<i.length;o+=1){const r=Ht(e,i,o);l[o]?l[o].p(r,t):(l[o]=Jt(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&q(t),S(l,e)}}}(e),k=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Kt(Rt(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(44547&n[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const i=Rt(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Kt(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){Wt(e);const o={};128&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[28]?.length&&w.p(e,t),e[27]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),ue(k),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),me(k),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Gt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jt(e){let t,n,o=e[33]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function Ut(e){let t,n,o,r,i,l,s,a;o=new Be({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=Zt(Pt(e,c,t));return{c(){t=N("tr"),n=N("td"),ge(o.$$.fragment),r=L();for(let e=0;e<d.length;e+=1)d[e].c();i=L(),T(n,"class","editRow svelte-14hcfjl"),T(t,"class","pointer svelte-14hcfjl"),O(t,"active",e[30]._id===e[0])},m(c,u){_(c,t,u),I(t,n),ve(o,n,null),I(t,r);for(let e=0;e<d.length;e+=1)d[e].m(t,null);I(t,i),l=!0,s||(a=E(n,"click",e[15](e[30])),s=!0)},p(n,o){if(e=n,3584&o[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const r=Pt(e,c,n);d[n]?d[n].p(r,o):(d[n]=Zt(r),d[n].c(),d[n].m(t,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&o[0]&&O(t,"active",e[30]._id===e[0])},i(e){l||(ue(o.$$.fragment,e),l=!0)},o(e){me(o.$$.fragment,e),l=!1},d(e){e&&q(t),ye(o),S(d,e),s=!1,a()}}}function Zt(e){let t,n,o,r,i=e[9](e[30],e[33])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[30]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function Kt(e){let t,n,o=e[13](e[30],e[28],e[1]),r=o&&Ut(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){2&n[0]&&(o=e[13](e[30],e[28],e[1])),o?r?(r.p(e,n),2&n[0]&&ue(r,1)):(r=Ut(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function Xt(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function en(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:Xt,then:Yt,catch:Qt,value:29,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function tn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[en]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};3&n[0]|128&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function nn(e,o,r){const i=H(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:f}=o,{classId:$}=o,{className:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,k="",x=$+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?p(n):m(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(h);P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Es(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(16,f=e.item),"classId"in e&&r(17,$=e.classId),"className"in e&&r(18,h=e.className),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(19,v=e.viewName),"viewValue"in e&&r(20,y=e.viewValue),"recordId"in e&&r(21,b=e.recordId),"filter"in e&&r(22,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _;let n=[];if(f.lookup){const e="."+$+"#"+f.lookup,o=document.querySelector(e),r=o?.value||b;if(r){const e=await t.getTask(f.lookup,r);if(e){const o=e[f.name]?.map((e=>e[f.name]));o&&(n=await t.getSectionView(f.name,{_id:{$in:o}},!0))}}}else{const o="."+$+"#"+v.split(":")[0],r=document.querySelector(o);let i={[v]:r?.value||b};if(f.refItem){const e="."+$+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};i={...i,...e}}}catch{}}i[v]&&(n=await t.getSectionView(e.class,i,!0)),w&&(n=n.filter((e=>e._id!=w)))}let o=[],r=e.display;return r&&r.length?r.map((t=>{const[r,i]=t.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,n=n.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e)))),l||(l=e.items.find((e=>e.name===r))),o.find((e=>e?.name===r))||o.push(l)})):o=e.items,{list:n,items:o}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},e=>async()=>{const n=await t.getTaskByDocId(e._id),o=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(o)},f,$,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class on extends we{constructor(e){var t;super(),Mt.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(Mt.head,t)),be(this,e,nn,tn,w,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:rn}=$e;function ln(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function sn(e){let t,n,o=e[51]&&function(e){let t,n,o,i,l,s,a,c,d,u,m,f,p,$,h;n=new r({props:{class:"full-width",id:e[24],value:e[2],rows:"1",required:e[1],disabled:e[3],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}}),n.$on("click",e[28]()),n.$on("onFocus",e[28](e[24]));const g=[cn,an],v=[];function y(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(i=y(e))&&(l=v[i]=g[i](e));let b=(!e[3]||e[14])&&dn(e);function w(t){e[39](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[pn]},$$scope:{ctx:e}};void 0!==e[16]&&(k.open=e[16]);m=new e[23]({props:k}),G.push((()=>he(m,"open",w)));let S=e[17]&&$n(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),l&&l.c(),s=L(),a=N("input"),d=L(),b&&b.c(),u=L(),ge(m.$$.fragment),p=L(),S&&S.c(),$=F(),T(a,"class",c=x(e[7]||e[8])+" svelte-jox15l"),T(a,"id",e[5]),T(a,"name",e[5]),a.value=e[0],a.hidden=!0,B(t,"position","relative")},m(e,r){_(e,t,r),ve(n,t,null),I(t,o),~i&&v[i].m(t,null),I(t,s),I(t,a),I(t,d),b&&b.m(t,null),_(e,u,r),ve(m,e,r),_(e,p,r),S&&S.m(e,r),_(e,$,r),h=!0},p(e,o){const r={};4&o[0]&&(r.value=e[2]),2&o[0]&&(r.required=e[1]),8&o[0]&&(r.disabled=e[3]),n.$set(r);let d=i;i=y(e),i===d?~i&&v[i].p(e,o):(l&&(ce(),me(v[d],1,1,(()=>{v[d]=null})),de()),~i?(l=v[i],l?l.p(e,o):(l=v[i]=g[i](e),l.c()),ue(l,1),l.m(t,s)):l=null),(!h||384&o[0]&&c!==(c=x(e[7]||e[8])+" svelte-jox15l"))&&T(a,"class",c),(!h||32&o[0])&&T(a,"id",e[5]),(!h||32&o[0])&&T(a,"name",e[5]),(!h||1&o[0]&&a.value!==e[0])&&(a.value=e[0]),!e[3]||e[14]?b?(b.p(e,o),16392&o[0]&&ue(b,1)):(b=dn(e),b.c(),ue(b,1),b.m(t,null)):b&&(ce(),me(b,1,1,(()=>{b=null})),de());const u={};3260241&o[0]|2097152&o[1]&&(u.$$scope={dirty:o,ctx:e}),!f&&65536&o[0]&&(f=!0,u.open=e[16],ne((()=>f=!1))),m.$set(u),e[17]?S?(S.p(e,o),131072&o[0]&&ue(S,1)):(S=$n(e),S.c(),ue(S,1),S.m($.parentNode,$)):S&&(ce(),me(S,1,1,(()=>{S=null})),de())},i(e){h||(ue(n.$$.fragment,e),ue(l),ue(b),ue(m.$$.fragment,e),ue(S),h=!0)},o(e){me(n.$$.fragment,e),me(l),me(b),me(m.$$.fragment,e),me(S),h=!1},d(e){e&&q(t),ye(n),~i&&v[i].d(),b&&b.d(),e&&q(u),ye(m,e),e&&q(p),S&&S.d(e),e&&q($)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,t){e[51]&&o.p(e,t)},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function an(e){let t,n,o,r,i;return n=new Be({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[32]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function cn(e){let t,n,o,r,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=[E(t,"click",e[28]()),E(t,"choose",e[29])],r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,y(i)}}}function dn(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[31]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function un(e){let t,n,o,r;const i=[fn,mn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function mn(e){let t,n;return t=new Ot({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]}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.title=e[6].designation),1048576&n[0]&&(o.newAllowed=e[20]),512&n[0]&&(o.prevEventId=e[9]),32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),65536&n[0]&&(o.isOpening=e[16]),2097152&n[0]&&(o.filterForReady=e[21]),64&n[0]&&(o.refStatus=e[6].refStatus),4096&n[0]&&(o.selectionFields=e[12]),8192&n[0]&&(o.deList=e[13]),2048&n[0]&&(o.praefix=e[11]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function fn(e){let t,n;return t=new on({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[29]),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.item=e[6]),32768&n[0]&&(o.className=e[15].class),256&n[0]&&(o.classId=e[8]),1&n[0]&&(o.rowId=e[0]),1024&n[0]&&(o.recordId=e[10]),16&n[0]&&(o.viewName=e[4]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function pn(e){let t,n,o=e[16]&&un(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[16]?o?(o.p(e,n),65536&n[0]&&ue(o,1)):(o=un(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function $n(e){let t,n,o;function r(t){e[40](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[gn]},$$scope:{ctx:e}};return void 0!==e[17]&&(i.open=e[17]),t=new e[23]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};294913&o[0]|2097152&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&131072&o[0]&&(n=!0,r.open=e[17],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function hn(e){let t,n;return t=new zs({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function gn(e){let t,n;return t=new e[22]({props:{title:e[18],$$slots:{default:[hn]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};262144&n[0]&&(o.title=e[18]),32769&n[0]|2097152&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function vn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function yn(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:vn,then:sn,catch:ln,value:51,blocks:[,,,]};return fe(e[27](),o),{c(){t=F(),o.block.c()},m(e,r){_(e,t,r),o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,n=!0},p(t,n){pe(o,e=t,n)},i(e){n||(ue(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){me(o.blocks[e])}n=!1},d(e){e&&q(t),o.block.d(e),o.token=null,o=null}}}function bn(e,n,r){let i,l,s;k(e,o,(e=>r(38,i=e)));const a=H(),{Dialog:u,Modal:m}=c;let{id:f}=n,{item:p}=n,{value:h=""}=n,{desc:g=""}=n,{noForm:v=!1}=n,{classId:y}=n,{eventId:b}=n,{recordId:w}=n,{withRefValue:x=!1}=n,{refValue:I=""}=n,{required:_}=n,{disabled:q}=n,{readonly:S}=n,{praefix:N}=n,{selectionFields:j}=n,{formnovalidate:C}=n,{selection:L}=n,{deList:F}=n,{isTemplate:E}=n;const D="comment_"+f;let z,T,V,A,B,O,M=!1,W=!0,R=!0;S||=w&&p.asInput,q||=S,!L&&p.selection&&1===p.selection.split(":").length&&(L=p.selection);const{currentTasks:P,loggedIn:Q}=d;k(e,P,(e=>r(42,l=e))),k(e,Q,(e=>r(43,s=e)));const Y=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},G=e=>{e&&(r(2,g=$(V,e)),a("setRefDesc",g.split(" •")[0]),a("change",{value:h,description:g}),a("task",{row:e,eventId:V.id}))},J=()=>{r(16,M=!1),r(17,z=!1)};return e.$$set=e=>{"id"in e&&r(5,f=e.id),"item"in e&&r(6,p=e.item),"value"in e&&r(0,h=e.value),"desc"in e&&r(2,g=e.desc),"noForm"in e&&r(7,v=e.noForm),"classId"in e&&r(8,y=e.classId),"eventId"in e&&r(9,b=e.eventId),"recordId"in e&&r(10,w=e.recordId),"withRefValue"in e&&r(33,x=e.withRefValue),"refValue"in e&&r(34,I=e.refValue),"required"in e&&r(1,_=e.required),"disabled"in e&&r(3,q=e.disabled),"readonly"in e&&r(35,S=e.readonly),"praefix"in e&&r(11,N=e.praefix),"selectionFields"in e&&r(12,j=e.selectionFields),"formnovalidate"in e&&r(36,C=e.formnovalidate),"selection"in e&&r(4,L=e.selection),"deList"in e&&r(13,F=e.deList),"isTemplate"in e&&r(14,E=e.isTemplate)},e.$$.update=()=>{if(2&e.$$.dirty[0]|32&e.$$.dirty[1]&&r(1,_=_&&!C),12&e.$$.dirty[1]&&x&&r(0,h=I),32833&e.$$.dirty[0]&&h&&V&&Promise.resolve(js(p.refClass,V.id,h)).then((e=>G(e))),65&e.$$.dirty[0]|192&e.$$.dirty[1]&&h&&A&&p.name===A.input?.at(0)&&A.inputLookup?.length){const{domain:e}=A.inputLookup[0]||{};"user"===e&&(i.some((e=>A.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0))}32769&e.$$.dirty[0]&&!h&&V&&G({})},[h,_,g,q,L,f,p,v,y,b,w,N,j,F,E,V,M,z,T,B,W,R,u,m,D,P,Q,async()=>{try{const e=await t.getEvent(b);if(O="report"===e.output.type,r(21,R=!p.asInput),r(20,W=e.output?.class[0].name!==p.refClass),r(15,V=await t.getSchemaByClass(p.refClass)),Y(V),r(19,B=(e=>!l?.length||!!l.find((t=>t===e)))(V.id)),r(37,A=await t.getSchema(b)),b&&w&&h&&!q&&A.input?.find((e=>e===p.refClass))&&r(3,q=!0),p.properties?.query?.lookup){const{domain:e,value:n}=p.properties.query.lookup;if("user"===e){const e={[n]:s.user},o=await t.getSectionView(p.refClass,e);if(o?.length){const[{_id:e}]=o;e&&(r(34,I=e),r(33,x=!0))}i.some((e=>V.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0)}}return r(18,T=V.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if("BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}r(16,M=!0)},({detail:e})=>{r(0,h=e.row._id),J()},J,()=>{(O||B)&&(r(0,h=r(2,g="")),a("change",{value:h,description:g}),a("task",{row:{_task:{event:V.id,_id:!1}}}))},async()=>{if(!h)return;const e=await js(p.refClass,V.id,h);if(!e._task)return;const t=e._task._id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},x,I,S,C,A,i,function(e){M=e,r(16,M)},function(e){z=e,r(17,z)}]}class wn extends we{constructor(e){var t;super(),rn.getElementById("svelte-jox15l-style")||((t=N("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}",I(rn.head,t)),be(this,e,bn,yn,w,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:33,refValue:34,required:1,disabled:3,readonly:35,praefix:11,selectionFields:12,formnovalidate:36,selection:4,deList:13,isTemplate:14},[-1,-1])}}const kn=/\d+/g,xn=/%[HMSpPdmyY%]/g;function In(e,t,n){const o=Math.floor((new Date).getFullYear()/100);let r=!1;if(""===e)return null;const i=t.split(xn);let l=0,s=0;const a=new Date(0);for(const c of i){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)r=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;r=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{kn.lastIndex=l;const i=kn.exec(e);if(null==i)return n;switch(t[s]){case"H":a.setHours(parseInt(i[0])+12*r);break;case"M":a.setMinutes(i[0]);break;case"S":a.setSeconds(i[0]);break;case"d":a.setDate(i[0]);break;case"m":a.setMonth(i[0]-1);break;case"y":a.setFullYear(100*o+parseInt(i[0]));break;case"Y":a.setFullYear(i[0])}l+=i[0].length}s++}return isNaN(a.valueOf())?n:a}function _n(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:qn}=$e;function Sn(e,t,n){const o=e.slice();return o[17]=t[n],o}function Nn(e,t,n){const o=e.slice();return o[20]=t[n],o}function jn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Cn(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Fn(Nn(e,p,t));const h=e=>me($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&En(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[zn]},$$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:[Tn]},$$scope:{ctx:e}}}),{c(){t=N("form"),n=N("input"),r=L();for(let e=0;e<$.length;e+=1)$[e].c();i=L(),g&&g.c(),l=L(),s=N("div"),ge(a.$$.fragment),c=L(),ge(d.$$.fragment),T(n,"class",x(e[6])+" svelte-1phofh5"),T(n,"name","_id"),T(n,"type","hidden"),n.value=o=e[1]._id||"",T(t,"class","fTask svelte-1phofh5"),T(t,"id",e[6]),T(s,"class","form--buttons svelte-1phofh5")},m(o,p){_(o,t,p),I(t,n),I(t,r);for(let e=0;e<$.length;e+=1)$[e].m(t,null);I(t,i),g&&g.m(t,null),_(o,l,p),_(o,s,p),ve(a,s,null),I(s,c),ve(d,s,null),u=!0,m||(f=[E(t,"keydown",e[8]),E(t,"submit",D(e[10]))],m=!0)},p(e,r){if((!u||2&r&&o!==(o=e[1]._id||""))&&(n.value=o),75&r){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const o=Nn(e,p,n);$[n]?($[n].p(o,r),ue($[n],1)):($[n]=Fn(o),$[n].c(),ue($[n],1),$[n].m(t,i))}for(ce(),n=p.length;n<$.length;n+=1)h(n);de()}e[0].list?g?(g.p(e,r),1&r&&ue(g,1)):(g=En(e),g.c(),ue(g,1),g.m(t,null)):g&&(ce(),me(g,1,1,(()=>{g=null})),de());const l={};8388608&r&&(l.$$scope={dirty:r,ctx:e}),a.$set(l);const s={};4&r&&(s.disabled=e[2]),8388608&r&&(s.$$scope={dirty:r,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)ue($[e]);ue(g),ue(a.$$.fragment,e),ue(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)me($[e]);me(g),me(a.$$.fragment,e),me(d.$$.fragment,e),u=!1},d(e){e&&q(t),S($,e),g&&g.d(),e&&q(l),e&&q(s),ye(a),ye(d),m=!1,y(f)}}}function Ln(e){let t,n;return t=new hl({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.item=e[20]),1&n&&(o.selection=e[20].selection),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),1&n&&(o.eventId=e[0].id),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Fn(e){let t,n,o=Bn(!0,e[20]),r=o&&Ln(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){1&n&&(o=Bn(!0,e[20])),o?r?(r.p(e,n),1&n&&ue(r,1)):(r=Ln(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function En(e){let t,n,o=e[0].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=Dn(Sn(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(75&n){let l;for(o=e[0].list,l=0;l<o.length;l+=1){const i=Sn(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Dn(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Dn(e){let t,n,o,r;return t=new e[4]({props:{text:e[17].designation}}),o=new Zn({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(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment)},m(e,i){ve(t,e,i),_(e,n,i),ve(o,e,i),r=!0},p(e,n){const r={};1&n&&(r.text=e[17].designation),t.$set(r);const i={};1&n&&(i.list=e[17]),1&n&&(i.eventId=e[0].id),1&n&&(i.schema=e[17].item),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),o.$set(i)},i(e){r||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),r=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),r=!1},d(e){ye(t,e),e&&q(n),ye(o,e)}}}function zn(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Tn(e){let t;return{c(){t=C("Speichern")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Vn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function An(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Vn,then:Cn,catch:jn,value:16,blocks:[,,,]};return fe(e[7](),r),{c(){t=L(),n=N("section"),r.block.c(),qn.title="Vorgaben",T(n,"class","sTask svelte-1phofh5")},m(e,i){_(e,t,i),_(e,n,i),r.block.m(n,r.anchor=null),r.mount=()=>n,r.anchor=null,o=!0},p(t,[n]){pe(r,e=t,n)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),e&&q(n),r.block.d(),r.token=null,r=null}}}const Bn=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function On(e,n,r){let a,d,u;k(e,s,(e=>r(11,d=e))),k(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(i.getItem("Locale"));let{schema:h}=n,{record:g}=n,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const b=()=>window.history.back(),w=(e,t,n=!1)=>{const o=t.id,r=e.find((e=>e.name===o));let i=t.value;if(!n&&r&&r.properties?.multi&&(i=g[o]),i&&r&&r.type.startsWith("date"))try{return In(i,"%d.%m.%Y").toISOString()}catch{return new Date(i).toISOString()}if(r&&"boolean"===r.type&&(i=!!t.checked),r&&"number"===r.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{i=Number(i.replace(e,".")).toString()}catch{}}return i};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 t.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()},b,async e=>{const n={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[o,r]=t.split("."),i=h.list.find((e=>e.name===o));n[t]=w(i.item,e)}else n[t]=w(h.items,e)})),await t.saveTemplate(h.class,n),l.success("Die Vorgaben wurden gespeichert.",2e3),b()}]}const{document:Mn}=$e;function Wn(e,t,n){const o=e.slice();return o[28]=t[n],o}function Rn(e){let t,n;return t=new hl({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),2&n[0]&&(o.item=e[28]),2&n[0]&&(o.listName=e[1].name),8&n[0]&&(o.eventId=e[3]),1&n[0]&&(o.record=e[0]),16&n[0]&&(o.disabled=e[4]),32&n[0]&&(o.required=e[5]),256&n[0]&&(o.currency=e[8]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Pn(e){let t,n,o=Bn(e[7],e[28]),r=o&&Rn(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){130&n[0]&&(o=Bn(e[7],e[28])),o?r?(r.p(e,n),130&n[0]&&ue(r,1)):(r=Rn(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function Hn(e){let t,n,o,r=e[1].item,i=[];for(let t=0;t<r.length;t+=1)i[t]=Pn(Wn(e,r,t));const l=e=>me(i[e],1,1,(()=>{i[e]=null}));return{c(){t=N("div");for(let e=0;e<i.length;e+=1)i[e].c();T(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){_(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,s){if(82367&s[0]){let n;for(r=e[1].item,n=0;n<r.length;n+=1){const o=Wn(e,r,n);i[n]?(i[n].p(o,s),ue(i[n],1)):(i[n]=Pn(o),i[n].c(),ue(i[n],1),i[n].m(t,null))}for(ce(),n=r.length;n<i.length;n+=1)l(n);de()}(!o||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&T(t,"id",n)},i(e){if(!o){for(let e=0;e<r.length;e+=1)ue(i[e]);o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)me(i[e]);o=!1},d(e){e&&q(t),S(i,e)}}}function Qn(e){let t,n,o=e[13](e[9])+"";return{c(){t=N("span"),n=C(o)},m(e,o){_(e,t,o),I(t,n)},p(e,t){512&t[0]&&o!==(o=e[13](e[9])+"")&&V(n,o)},d(e){e&&q(t)}}}function Yn(e){let t,n,o;return n=new e[10]({props:{$$slots:{default:[Qn]},$$scope:{ctx:e}}}),n.$on("click",(function(){b(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","accordion svelte-148ktt9"),T(t,"slot","handle")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(t,o){e=t;const r={};512&o[0]|1&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Gn(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Yn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Hn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.open=e[6]),134218687&n[0]|1&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Jn(e){let t,n,o;return n=new e[11]({props:{$$slots:{default:[Gn]},$$scope:{ctx:e}}}),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","formList")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,t){const o={};1023&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Un(e,n,o){const{Button:r,Accordion:i,AccordionSection:l}=c;let{list:s}=n,{schema:a}=n,{record:d}=n,{classId:u}=n,{eventId:$}=n,{disabled:h}=n,{required:g}=n,{open:v=!1}=n,{template:y={}}=n,{isTemplate:b=!1}=n,{currency:w}=n,{update:k=!1}=n,x=new Map;const I={};let _=d[s.name]||{};d[s.name]=_;const q=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&o(1,s=e.list),"schema"in e&&o(18,a=e.schema),"record"in e&&o(0,d=e.record),"classId"in e&&o(2,u=e.classId),"eventId"in e&&o(3,$=e.eventId),"disabled"in e&&o(4,h=e.disabled),"required"in e&&o(5,g=e.required),"open"in e&&o(6,v=e.open),"template"in e&&o(19,y=e.template),"isTemplate"in e&&o(7,b=e.isTemplate),"currency"in e&&o(8,w=e.currency),"update"in e&&o(20,k=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&k&&d&&o(9,_=d[s.name]||{})},[d,s,u,$,h,g,v,b,w,_,r,i,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?q(t.name):"boolean"===t.type?p(e[t.name]):"date"===t.type?m(e[t.name]):"datetime"===t.type?f(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 r=d[t];o(0,d[t]={...r,[n]:e.value},d),o(9,_=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&o(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,r=document.querySelector(n);ee().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)})).then((()=>r.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:n,value:o}})=>{if(x.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===className+"."+s.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&x.set(e,i[0])},()=>{setTimeout((()=>{Array.from(x).forEach((([e,t])=>{d[s.name][e]||o(0,d[s.name][e]=t._id,d)}))}),500)},a,y,k,function(t){Q(e,t)}]}class Zn extends we{constructor(e){var t;super(),Mn.getElementById("svelte-148ktt9-style")||((t=N("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}}",I(Mn.head,t)),be(this,e,Un,Jn,w,{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:Kn}=$e;function Xn(e){e[0]=e[23].list,e[22]=e[23].items}function eo(e,t,n){const o=e.slice();return o[24]=t[n],o}function to(e,t,n){const o=e.slice();return o[27]=t[n],o}function no(e,t,n){const o=e.slice();return o[27]=t[n],o}function oo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function ro(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}Xn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[io]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[22]?.length&&function(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=lo(no(e,o,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[22],i=0;i<o.length;i+=1){const l=no(e,o,i);r[i]?r[i].p(l,t):(r[i]=lo(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}(e),k=e[0]?.length&&function(e){let t,n=e[0],o=[];for(let t=0;t<n.length;t+=1)o[t]=co(eo(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);_(e,t,n)},p(e,r){if(11778&r[0]){let i;for(n=e[0],i=0;i<n.length;i+=1){const l=eo(e,n,i);o[i]?o[i].p(l,r):(o[i]=co(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){S(o,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){Xn(e);const o={};2&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[22]?.length&&w.p(e,t),e[0]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function io(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function lo(e){let t,n,o=e[27]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function so(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=ao(to(e,o,t));return{c(){t=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=L(),T(t,"class","pointer svelte-14hcfjl")},m(e,o){_(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);I(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[22],l=0;l<o.length;l+=1){const s=to(e,o,l);r[l]?r[l].p(s,i):(r[l]=ao(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}function ao(e){let t,n,o,r,i=e[9](e[24],e[27])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[24]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function co(e){let t,n=e[13](e[24],e[22],e[1]),o=n&&so(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),_(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[24],e[22],e[1])),n?o?o.p(e,r):(o=so(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&q(t)}}}function uo(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function mo(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:uo,then:ro,catch:oo,value:23,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function fo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[mo]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]|2&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function po(e,n,o){const r=H(),{Dialog:i,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:$}=n,{list:h}=n,g="",v=$+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?p(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(f);P((()=>{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&&o(15,u=e.item),"className"in e&&o(16,f=e.className),"classId"in e&&o(17,$=e.classId),"list"in e&&o(0,h=e.list)},[h,g,r,i,l,s,a,d,v,y,e=>()=>r("choose",{row:e}),async()=>{const e=await b;let t=[],n=e.display;return n&&n.length?n.map((n=>{const[r,i]=n.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,o(0,h=h.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e))))),l||(l=e.items.find((e=>e.name===r))),t.find((e=>e?.name===r))||t.push(l)})):t=e.items,{list:h,items:t}},({detail:{value:e}})=>{o(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(y(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,g="")},u,f,$,()=>r("back"),function(e){g=e,o(1,g)}]}class $o extends we{constructor(e){var t;super(),Kn.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(Kn.head,t)),be(this,e,po,fo,w,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ho}=$e;function go(e,t,n){const o=e.slice();return o[11]=t[n],o}function vo(e,t,n){const o=e.slice();return o[2]=t[n],o}function yo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function bo(e){let t,n,o,r=e[6].items,i=[];for(let t=0;t<r.length;t+=1)i[t]=_o(vo(e,r,t));const l=e=>me(i[e],1,1,(()=>{i[e]=null}));let s=e[6].list&&qo(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L(),s&&s.c(),n=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);_(e,t,r),s&&s.m(e,r),_(e,n,r),o=!0},p(e,o){if(5161971&o[0]){let n;for(r=e[6].items,n=0;n<r.length;n+=1){const l=vo(e,r,n);i[n]?(i[n].p(l,o),ue(i[n],1)):(i[n]=_o(l),i[n].c(),ue(i[n],1),i[n].m(t.parentNode,t))}for(ce(),n=r.length;n<i.length;n+=1)l(n);de()}e[6].list?s?(s.p(e,o),64&o[0]&&ue(s,1)):(s=qo(e),s.c(),ue(s,1),s.m(n.parentNode,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de())},i(e){if(!o){for(let e=0;e<r.length;e+=1)ue(i[e]);ue(s),o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)me(i[e]);me(s),o=!1},d(e){S(i,e),e&&q(t),s&&s.d(e),e&&q(n)}}}function wo(e){let t,n,o,r;const i=[xo,ko],l=[];function s(e,t){return e[2].name!==e[14]||e[15]?"lookup"!==e[2].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(ce(),me(l[a],1,1,(()=>{l[a]=null})),de()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){~t&&l[t].d(e),e&&q(o)}}}function ko(e){let t,n;return t=new hl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[2].name===e[14]&&e[15]||e[0],eventId:e[4],currency:e[8],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),64&n[0]&&(o.item=e[2]),32&n[0]&&(o.record=e[5]),65&n[0]&&(o.disabled=e[2].name===e[14]&&e[15]||e[0]),16&n[0]&&(o.eventId=e[4]),256&n[0]&&(o.currency=e[8]),512&n[0]&&(o.changeValue=e[9]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function xo(e){let t,n,o,r;n=new hl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[0]||!!e[1],required:!0,eventId:e[4],currency:e[8],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let i=e[1]&&Io(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),i&&i.c(),B(t,"padding-top",".25em"),B(t,"background-color","lightyellow"),B(t,"position","relative")},m(e,l){_(e,t,l),ve(n,t,null),I(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};128&o[0]&&(r.classId=e[7]),64&o[0]&&(r.item=e[2]),32&o[0]&&(r.record=e[5]),3&o[0]&&(r.disabled=e[0]||!!e[1]),16&o[0]&&(r.eventId=e[4]),256&o[0]&&(r.currency=e[8]),512&o[0]&&(r.changeValue=e[9]),n.$set(r),e[1]?i?(i.p(e,o),2&o[0]&&ue(i,1)):(i=Io(e),i.c(),ue(i,1),i.m(t,null)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(n.$$.fragment,e),ue(i),r=!0)},o(e){me(n.$$.fragment,e),me(i),r=!1},d(e){e&&q(t),ye(n),i&&i.d()}}}function Io(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[22]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function _o(e){let t,n,o="list"!==e[2].type&&wo(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"list"!==e[2].type?o?(o.p(e,n),64&n[0]&&ue(o,1)):(o=wo(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function qo(e){let t,n,o=e[6].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=No(go(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(497&n[0]){let l;for(o=e[6].list,l=0;l<o.length;l+=1){const i=go(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=No(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function So(e){let t,n,o,r;return t=new e[12]({props:{text:e[11].designation}}),o=new Zn({props:{classId:e[7],list:e[11],eventId:e[4],schema:e[11].item,record:e[5],disabled:e[0],currency:e[8],update:!0}}),{c(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment)},m(e,i){ve(t,e,i),_(e,n,i),ve(o,e,i),r=!0},p(e,n){const r={};64&n[0]&&(r.text=e[11].designation),t.$set(r);const i={};128&n[0]&&(i.classId=e[7]),64&n[0]&&(i.list=e[11]),16&n[0]&&(i.eventId=e[4]),64&n[0]&&(i.schema=e[11].item),32&n[0]&&(i.record=e[5]),1&n[0]&&(i.disabled=e[0]),256&n[0]&&(i.currency=e[8]),o.$set(i)},i(e){r||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),r=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),r=!1},d(e){ye(t,e),e&&q(n),ye(o,e)}}}function No(e){let t,n,o="array"!==e[11].type&&So(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"array"!==e[11].type?o?(o.p(e,n),64&n[0]&&ue(o,1)):(o=So(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function jo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Co(e){let t,n;return t=new $o({props:{item:e[2],className:e[3],classId:e[7],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.item=e[2]),8&n[0]&&(o.className=e[3]),128&n[0]&&(o.classId=e[7]),2048&n[0]&&(o.list=e[11]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Lo(e){let t,n,o=e[10]&&Co(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[10]?o?(o.p(e,n),1024&n[0]&&ue(o,1)):(o=Co(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Fo(e){let t,n,o,r,i,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:jo,then:bo,catch:yo,value:52,blocks:[,,,]};function a(t){e[28](t)}fe(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Lo]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),r=new e[13]({props:c}),G.push((()=>he(r,"open",a))),{c(){s.block.c(),t=L(),ge(n.$$.fragment),o=L(),ge(r.$$.fragment)},m(e,i){s.block.m(e,s.anchor=i),s.mount=()=>t.parentNode,s.anchor=t,_(e,t,i),ve(n,e,i),_(e,o,i),ve(r,e,i),l=!0},p(t,n){pe(s,e=t,n);const o={};3212&n[0]|67108864&n[1]&&(o.$$scope={dirty:n,ctx:e}),!i&&1024&n[0]&&(i=!0,o.open=e[10],ne((()=>i=!1))),r.$set(o)},i(e){l||(ue(s.block),ue(n.$$.fragment,e),ue(r.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){me(s.blocks[e])}me(n.$$.fragment,e),me(r.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&q(t),ye(n,e),e&&q(o),ye(r,e)}}}function Eo(e,n,o){const{Divider:r,FormField:i,Modal:l}=c,s=H();let a,d,u,m,f,{required:p}=n,{disabled:$}=n,{readonly:h}=n,{id:g}=n,{item:v}=n,{value:y}=n,{refValue:b}=n,w={},k="CHF",x=[],I=[],_={},q=new Map,S=!1,N="";const j=v.checkOn,C=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");x.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))},F=()=>{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)})}))},E=async e=>{const t=x.filter((t=>t.refObj===e));if(t?.length){o(9,_={});for(const e of t){const{itemName:t,refObj:n,refName:r,op:i}=e;let{action:l}=e;if(!n)break;let s,a,c=!r&&w[n];const u=w[n];u&&r&&(c=(await getTaskFull(n,u))[r]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===i&&(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&&o(9,_[t]="",_))}}};P((()=>{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=>E(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(q).forEach((([e,t])=>{w[e]||o(5,w[e]=t._id,w)}))}),250)},T=async e=>{if(!e.value)return void A();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},r=await t.getSectionView(u,n);r?.length?(o(11,N=r),o(10,S=!0)):(o(1,y=""),o(23,b=""),s("setRefValue",b))},V=()=>{o(10,S=!1)},A=()=>{o(1,y=""),o(23,b=y),o(5,w={}),s("setRefValue",b)};return e.$$set=e=>{"required"in e&&o(24,p=e.required),"disabled"in e&&o(0,$=e.disabled),"readonly"in e&&o(25,h=e.readonly),"id"in e&&o(26,g=e.id),"item"in e&&o(2,v=e.item),"value"in e&&o(1,y=e.value),"refValue"in e&&o(23,b=e.refValue)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&o(0,$=$||h),134217784&e.$$.dirty[0]&&w&&s("safeReference",{record:w,class:u,event:m,taskId:f})},[$,y,v,u,m,w,a,d,k,_,S,N,r,l,j,C,async()=>{try{if(y){const e=await t.getTask(v.refClass,y);delete e._task,o(5,w=e),o(27,f=(await t.getTaskByDocId(e._id))._id)}else o(5,w={})}catch{}const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&o(8,k=n[0].designation)}return o(6,a=await t.getSchemaByClass(v.refClass)),o(7,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),o(3,u=a.class),a.identity.designation,o(4,m=a.id),["readonly","hidden","required"].map(L),F(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(o(5,w[t]=n,w),t===j)return T(e);E(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:n,lookup:r,view:i}=e,[l]=r.split(":"),s=(await t.getSectionView(l,{[i]:{$in:n}})).map((e=>e._id));for(const e of a.input.slice(1)){o(5,w[e]=[],w);const n=await t.getSchemaByClass(e);n.id;let r=await t.getTasks(n.id);if(r=r.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),r?.length){const n=r.map((e=>e._id)),i=await t.getSectionView(e,{_id:{$in:n}});for(const t of i)t[e]=t._id;o(5,w[e]=i,w)}}},async({detail:{className:e,itemName:n,value:o}})=>{if(q.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===u))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&q.set(e,i[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(o(1,y=n[0]._id),o(23,b=y),s("setRefValue",b),o(5,w=n[0])),V()},V,A,b,p,h,g,f,function(e){S=e,o(10,S)}]}class Do extends we{constructor(e){var t;super(),ho.getElementById("svelte-16mo2c-style")||((t=N("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",I(ho.head,t)),be(this,e,Eo,Fo,w,{required:24,disabled:0,readonly:25,id:26,item:2,value:1,refValue:23},[-1,-1])}}function zo(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=N("span"),n=C(e[4]),T(t,"class","item")},m(e,o){_(e,t,o),I(t,n)},p(e,t){16&t&&V(n,e[4])},d(e){e&&q(t)}}}(e);return{c(){n&&n.c(),t=F()},m(e,o){n&&n.m(e,o),_(e,t,o)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&q(t)}}}function To(e){let t,n,o;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:[zo]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=N("div"),ge(n.$$.fragment),B(t,"position","relative"),B(t,"max-width","10em")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,[t]){const o={};6&t&&(o.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),256&t&&(o.value=e[8]),64&t&&(o.pattern=e[6]),128&t&&(o.readonly=e[7]),8&t&&(o.disabled=e[3]),32&t&&(o.required=e[5]),536870928&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Vo(e,t,n){let o;const r=H(),{TextField:l}=c;let{id:s}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t,{formnovalidate:p}=t,{currency:$}=t;const h=JSON.parse(i.getItem("Locale")),g=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),v=Number("1.1").toLocaleString(h.id).substring(1,2),{properties:y={}}=a;let{min:b,max:w,step:k,pattern:x,decimals:I=0,unit:_="",placeholder:q,hint:S,readonly:N,negative:j,required:C=!1}=y;N=!0===N||void 0,x||(x=I?`[0-9]+([${v}][0-9]{1,${I}})?`:"[0-9]*"),j&&(x="-?"+x);return e.$$set=e=>{"id"in e&&n(0,s=e.id),"item"in e&&n(16,a=e.item),"value"in e&&n(17,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled),"formnovalidate"in e&&n(18,p=e.formnovalidate),"currency"in e&&n(4,$=e.currency)},e.$$.update=()=>{262176&e.$$.dirty&&n(5,C=C&&!p),131072&e.$$.dirty&&n(8,o=Number(d.toString().replace(v,".")).toFixed(I).toString().replace(".",v))},[s,u,m,f,$,C,x,N,o,l,h,g,k,q,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{N||Number(d.toString().replace(v,"."))||n(8,o="")},a,d,p]}class Ao extends we{constructor(e){super(),be(this,e,Vo,To,w,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4})}}const{document:Bo}=$e;function Oo(e){e[33]=e[35].list,e[34]=e[35].items}function Mo(e,t,n){const o=e.slice();return o[36]=t[n],o[38]=n,o}function Wo(e,t,n){const o=e.slice();return o[39]=t[n],o[41]=n,o}function Ro(e,t,n){const o=e.slice();return o[39]=t[n],o}function Po(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ho(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Oo(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Qo]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let b=!e[1]&&Yo(e);function w(t){e[31](t)}let k={id:e[11]};void 0!==e[2]&&(k.value=e[2]),s=new e[6]({props:k}),G.push((()=>he(s,"value",w))),s.$on("input",e[14]),u=new Te({props:{size:"18"}});let x=e[34]?.length&&function(e){let t,n,o,r,i=!e[1]&&Jo(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=Uo(Ro(e,l,t));return{c(){t=N("thead"),n=N("tr"),i&&i.c(),o=L();for(let e=0;e<s.length;e+=1)s[e].c();T(n,"class","svelte-1m010ne"),T(t,"class","svelte-1m010ne")},m(e,l){_(e,t,l),I(t,n),i&&i.m(n,null),I(n,o);for(let e=0;e<s.length;e+=1)s[e].m(n,null);r=!0},p(e,t){if(e[1]?i&&(ce(),me(i,1,1,(()=>{i=null})),de()):i?(i.p(e,t),2&t[0]&&ue(i,1)):(i=Jo(e),i.c(),ue(i,1),i.m(n,o)),8192&t[0]){let o;for(l=e[34],o=0;o<l.length;o+=1){const r=Ro(e,l,o);s[o]?s[o].p(r,t):(s[o]=Uo(r),s[o].c(),s[o].m(n,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=l.length}},i(e){r||(ue(i),r=!0)},o(e){me(i),r=!1},d(e){e&&q(t),i&&i.d(),S(s,e)}}}(e),j=e[33]?.length&&function(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=tr(Mo(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(569359&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=Mo(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=tr(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),b&&b.c(),r=L(),i=N("div"),l=C("Suchen: "),ge(s.$$.fragment),c=L(),d=N("span"),ge(u.$$.fragment),m=L(),f=N("div"),p=N("table"),x&&x.c(),$=L(),h=N("tbody"),j&&j.c(),T(t,"class","form--buttons svelte-1m010ne"),T(d,"class","feather pointer svelte-1m010ne"),B(i,"margin-bottom","1em"),B(i,"position","relative"),T(p,"striped",""),T(p,"class","svelte-1m010ne"),T(f,"class","eList svelte-1m010ne")},m(a,w){_(a,t,w),ve(n,t,null),I(t,o),b&&b.m(t,null),_(a,r,w),_(a,i,w),I(i,l),ve(s,i,null),I(i,c),I(i,d),ve(u,d,null),_(a,m,w),_(a,f,w),I(f,p),x&&x.m(p,null),I(p,$),I(p,h),j&&j.m(h,null),g=!0,v||(y=E(d,"click",e[16]),v=!0)},p(e,o){Oo(e);const r={};8192&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[1]?b&&(ce(),me(b,1,1,(()=>{b=null})),de()):b?(b.p(e,o),2&o[0]&&ue(b,1)):(b=Yo(e),b.c(),ue(b,1),b.m(t,null));const i={};!a&&4&o[0]&&(a=!0,i.value=e[2],ne((()=>a=!1))),s.$set(i),e[34]?.length&&x.p(e,o),e[33]?.length&&j.p(e,o)},i(e){g||(ue(n.$$.fragment,e),ue(b),ue(s.$$.fragment,e),ue(u.$$.fragment,e),ue(x),ue(j),g=!0)},o(e){me(n.$$.fragment,e),me(b),me(s.$$.fragment,e),me(u.$$.fragment,e),me(x),me(j),g=!1},d(e){e&&q(t),ye(n),b&&b.d(),e&&q(r),e&&q(i),ye(s),ye(u),e&&q(m),e&&q(f),x&&x.d(),j&&j.d(),v=!1,y()}}}function Qo(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Yo(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Go]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Go(e){let t;return{c(){t=C("Bestätigen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jo(e){let t,n,o,r,i;return n=new Se({props:{size:"20"}}),{c(){t=N("th"),ge(n.$$.fragment),T(t,"class","svelte-1m010ne")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[18](e[33])),r=!0)},p(t,n){e=t},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Uo(e){let t,n,o=e[39]+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-1m010ne")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function Zo(e){let t,n,o,r,i,l,s,a=e[0],c=Xo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=er(Wo(e,d,t));return{c(){t=N("tr"),c.c(),n=L();for(let e=0;e<u.length;e+=1)u[e].c();o=L(),T(t,"style",r=e[1]?"cursor: default;":"cursor: zoom-in;"),T(t,"title","übernimmt den Wert direkt"),T(t,"class","svelte-1m010ne"),O(t,"active",e[0].includes(e[36]))},m(r,a){_(r,t,a),c.m(t,null),I(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);I(t,o),i=!0,l||(s=E(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&w(a,a=e[0])?(ce(),me(c,1,1,h),de(),c=Xo(e),c.c(),ue(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 r=Wo(e,d,n);u[n]?u[n].p(r,s):(u[n]=er(r),u[n].c(),u[n].m(t,o))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!i||2&s[0]&&r!==(r=e[1]?"cursor: default;":"cursor: zoom-in;"))&&T(t,"style",r),8193&s[0]&&O(t,"active",e[0].includes(e[36]))},i(e){i||(ue(c),i=!0)},o(e){me(c),i=!1},d(e){e&&q(t),c.d(e),S(u,e),l=!1,s()}}}function Ko(e){let t,n,o;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=N("td"),ge(n.$$.fragment),T(t,"title","Wählt den Wert aus"),T(t,"class","svelte-1m010ne")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,t){const o={};1&t[0]&&(o.checked=e[0].includes(e[36])),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Xo(e){let t,n,o=!e[1]&&Ko(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[1]?o&&(ce(),me(o,1,1,(()=>{o=null})),de()):o?(o.p(e,n),2&n[0]&&ue(o,1)):(o=Ko(e),o.c(),ue(o,1),o.m(t.parentNode,t))},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function er(e){let t,n,o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=N("td"),n=C(o),T(t,"class","svelte-1m010ne")},m(e,o){_(e,t,o),I(t,n)},p(e,t){8&t[0]&&o!==(o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&V(n,o)},d(e){e&&q(t)}}}function tr(e){let t,n,o=e[15](e[36],e[2]),r=o&&Zo(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){4&n[0]&&(o=e[15](e[36],e[2])),o?r?(r.p(e,n),4&n[0]&&ue(r,1)):(r=Zo(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function nr(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function or(e){let t,n,o,r;t=new e[9]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:nr,then:Ho,catch:Po,value:35,blocks:[,,,]};return fe(e[13](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function rr(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[or]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};15&n[0]|8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ir(e,n,o){const r=H(),{Loading:i,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=n,{id:f}=n,{selection:p}=n,{refDoc:$}=n,{tableName:h}=n,{idName:g}=n,{target:v}=n,{view:y}=n,{unique:b}=n,{uniqueView:w}=n,{status:k}=n,{single:x}=n;p||=[];let I="",_=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=[];const S=h+g+v+"checkbox",N=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&o(21,m=e.classId),"id"in e&&o(22,f=e.id),"selection"in e&&o(0,p=e.selection),"refDoc"in e&&o(23,$=e.refDoc),"tableName"in e&&o(24,h=e.tableName),"idName"in e&&o(25,g=e.idName),"target"in e&&o(20,v=e.target),"view"in e&&o(26,y=e.view),"unique"in e&&o(27,b=e.unique),"uniqueView"in e&&o(28,w=e.uniqueView),"status"in e&&o(29,k=e.status),"single"in e&&o(1,x=e.single)},[p,x,I,q,r,i,l,s,a,d,u,_,S,async()=>{let e=[],n=[],r={};if(o(3,q=[]),g)if(y){const n=m.split("-")[1].slice(0,-4),o="input."+m+"[name='_id']",i=document.querySelector(o).value;r={[g]:f},k&&(r.$or=[{status:!0},{[n]:i}]),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const o=e=>(e[n]||"z").toString()+e[v];return N(o(e),o(t))}))}else w?(r={[g]:f,status:!0},Object.entries(w).map((([e,t])=>{t?.length&&(r[e]={$in:t}),n.push(e)})),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})),o(3,q=e.map((e=>{const t=[e[v]];return n.map((n=>t.push(e[n]))),t})))):b?(e=await t.getSection(h,g,f,b),e=e.sort(((e,t)=>N(e,t)))):(e=await t.getSection(h,g,f),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})));else r={},Array.isArray(f)||(r._id=f),e=await t.getSectionView(h,r);const i=await t.getSchemaByClass(h),l=[];if($){const t=e.find((e=>e.type===$));e=t.values,o(20,v="designation")}e.map((e=>{let t=e[v];if(t||h!==v||(o(20,v=i.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=i.items.find((e=>e.name===v))?.designation;return n=n.map((e=>i.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...n]}},({detail:{value:e}})=>{o(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{o(2,I="")},e=>()=>{const t=document.getElementsByName(S),n=[];t.forEach(((t,o)=>{t.checked&&n.push(e[+t.attributes.data.value])})),r("choose",{list:n})},e=>()=>{document.getElementsByName(S).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(x?r("choose",{list:[].concat(e)}):(o(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),r("choose",{list:p})))},v,m,f,$,h,g,y,b,w,k,()=>r("back"),function(e){I=e,o(2,I)}]}class lr extends we{constructor(e){var t;super(),Bo.getElementById("svelte-1m010ne-style")||((t=N("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}",I(Bo.head,t)),be(this,e,ir,rr,w,{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:sr}=$e;function ar(e){let t,n,o,r,i,l=e[7].length+"";return{c(){t=N("span"),n=C("("),o=C(l),r=C(")"),T(t,"class",i=x(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&V(o,l),2&n[0]&&i!==(i=x(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&T(t,"class",i)},d(e){e&&q(t)}}}function cr(e){let t;return{c(){t=N("div"),T(t,"class","load-more-options"),T(t,"slot","load-more-options-message slot")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function dr(e){let t,n,o,r;const i=[fr,mr,ur],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]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(ce(),me(l[a],1,1,(()=>{l[a]=null})),de()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){~t&&l[t].d(e),e&&q(o)}}}function ur(e){let t,n,o,r,i;return n=new Ie({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title","Übernehmen"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[26]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function mr(e){let t,n,o,r,i;return n=new Ce({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title",e[17].title||"Generieren"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[25]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function fr(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title","Löschen"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[27]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function pr(e){let t,n,o;function r(t){e[37](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[$r]},$$scope:{ctx:e}};return void 0!==e[10]&&(i.open=e[10]),t=new e[11]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};53&o[0]|32768&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&1024&o[0]&&(n=!0,r.open=e[10],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function $r(e){let t,n;return t=new lr({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),1&n[0]&&(o.selection=e[0]),16&n[0]&&(o.unique=e[16].unique&&e[4].name),32&n[0]&&(o.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(o.id=e[5][e[21]||e[20]]),16&n[0]&&(o.target=e[4].name),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function hr(e){let t,n,o,r,i,l,s,a,c,d=!e[16].single&&e[7].length&&ar(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:gr,minSearchLength:"3",$$slots:{"load-more-options-message slot":[cr]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),o=new e[12]({props:f}),G.push((()=>he(o,"selection",u))),G.push((()=>he(o,"maxOptions",m))),o.$on("change",e[22]);let p=!e[1]&&dr(e),$=e[10]&&pr(e);return{c(){t=N("div"),d&&d.c(),n=L(),ge(o.$$.fragment),l=L(),p&&p.c(),s=L(),$&&$.c(),a=F(),B(t,"position","relative")},m(e,r){_(e,t,r),d&&d.m(t,null),I(t,n),ve(o,t,null),I(t,l),p&&p.m(t,null),_(e,s,r),$&&$.m(e,r),_(e,a,r),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=ar(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}),!r&&128&l[0]&&(r=!0,s.selection=e[7],ne((()=>r=!1))),!i&&512&l[0]&&(i=!0,s.maxOptions=e[9],ne((()=>i=!1))),o.$set(s),e[1]?p&&(ce(),me(p,1,1,(()=>{p=null})),de()):p?(p.p(e,l),2&l[0]&&ue(p,1)):(p=dr(e),p.c(),ue(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&ue($,1)):($=pr(e),$.c(),ue($,1),$.m(a.parentNode,a)):$&&(ce(),me($,1,1,(()=>{$=null})),de())},i(e){c||(ue(o.$$.fragment,e),ue(p),ue($),c=!0)},o(e){me(o.$$.fragment,e),me(p),me($),c=!1},d(e){e&&q(t),d&&d.d(),ye(o),p&&p.d(),e&&q(s),$&&$.d(e),e&&q(a)}}}async function*gr(e){yield[{name:e}]}function vr(e,n,o){const r=H(),{Modal:i,Autocomplete:l}=c;let{classId:s}=n,{id:a}=n,{item:d}=n,{record:u}=n,{value:m}=n,{noForm:f=!1}=n,{disabled:p}=n,{formnovalidate:$}=n,{numberInput:h}=n,{praefix:g}=n,{toDelete:v}=n,{reqQuantity:y}=n,{notifyList:b}=n;const{properties:w={}}=d;let{placeholder:k,hint:x,readonly:I,required:_=!1,lookup:q="",view:S=!1,multi:N,max:j=1e3,generate:C=!1,status:L=!0,refDoc:F}=w;const[E,D]=q.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(k="");P((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&q&&e.addEventListener("focus",V)}));const V=()=>{if(q){document.getElementById(a).blur();const e=y||j;(N.unique||T.length<e)&&o(10,z=!0)}},A=()=>{o(10,z&&=!1)},B=({detail:e})=>{o(7,T=e.list.map((e=>({name:e})))),r("blur",{value:e.list}),r("multi",{view:N.view,lookup:q,name:d.name,value:e.list}),A()},O=async()=>{const e={[D]:u[D]},n=await t.getSectionView(E,e),o=Array.from({length:n.length},((e,t)=>n[t][d.name]));B({detail:{list:o}})},M=(e=!1)=>{if(p||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;o(9,j=!1!==e?e:y||u[t]||0);const n=T.length!=j,i=document.getElementById(a);i?.classList?.toggle("invalid",n),r("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&o(2,s=e.classId),"id"in e&&o(3,a=e.id),"item"in e&&o(4,d=e.item),"record"in e&&o(5,u=e.record),"value"in e&&o(0,m=e.value),"noForm"in e&&o(28,f=e.noForm),"disabled"in e&&o(1,p=e.disabled),"formnovalidate"in e&&o(29,$=e.formnovalidate),"numberInput"in e&&o(30,h=e.numberInput),"praefix"in e&&o(31,g=e.praefix),"toDelete"in e&&o(32,v=e.toDelete),"reqQuantity"in e&&o(33,y=e.reqQuantity),"notifyList"in e&&o(34,b=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&o(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&o(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&o(7,T=[]),128&e.$$.dirty[0]&&T&&(o(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:o}=e;void 0!==g&&g!==o||t&&t.name===N.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&o(6,_=_&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:n,value:i}=e||{};if(!i)return;if(d.refItem?.split(".")[0]!==n)return;const[l,s]=d.refItem.split("."),a=await t.getTask(l,i);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];r("record",{itemName:"quantity",value:u?.length||0}),o(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(b)},[m,p,s,a,d,u,_,T,k,j,z,i,l,I,q,S,N,C,L,F,E,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),o(7,T=t.map((e=>({name:e.trim()})))),r("blur",{value:T.map((e=>e.name))}),r("multi",{view:N.view,lookup:q,value:T.map((e=>e.name))})},A,B,()=>{const e=u[C.itemQuantity]||y;if(!e)return;const t=C.prefix||"",n=u[C.variable]||"",o=C.len||5,r=Array.from({length:e},((e,r)=>t+n+"-"+r.toString().padStart(o,"0")));B({detail:{list:r}})},async()=>{if(!0===S)return O();const e=y||u[N.maxItem];if(!e)return;const n={[D]:u[D],status:!0},o=[].concat(u[N.view]||[]);o.length&&(n[N.view]={$in:o});const r=await t.getSectionView(E,n),i=Array.from({length:e<r.length?e:r.length},((e,t)=>r[t][d.name]));B({detail:{list:i}})},()=>{B({detail:{list:[]}})},f,$,h,g,v,y,b,function(e){T=e,o(7,T),o(5,u),o(4,d),o(32,v)},function(e){j=e,o(9,j)},function(e){z=e,o(10,z)}]}class yr extends we{constructor(e){var t;super(),sr.getElementById("svelte-1rbaejz-style")||((t=N("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}",I(sr.head,t)),be(this,e,vr,hr,w,{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:br}=$e;function wr(e){e[26]=e[28].list,e[27]=e[28].items}function kr(e,t,n){const o=e.slice();return o[29]=t[n],o}function xr(e,t,n){const o=e.slice();return o[32]=t[n],o}function Ir(e,t,n){const o=e.slice();return o[32]=t[n],o}function _r(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function qr(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}wr(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Sr]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Nr(Ir(e,o,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[27],i=0;i<o.length;i+=1){const l=Ir(e,o,i);r[i]?r[i].p(l,t):(r[i]=Nr(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}(e),k=e[26]?.length&&function(e){let t,n=e[26],o=[];for(let t=0;t<n.length;t+=1)o[t]=Lr(kr(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);_(e,t,n)},p(e,r){if(11779&r[0]){let i;for(n=e[26],i=0;i<n.length;i+=1){const l=kr(e,n,i);o[i]?o[i].p(l,r):(o[i]=Lr(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){S(o,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){wr(e);const o={};64&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[27]?.length&&w.p(e,t),e[26]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Sr(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Nr(e){let t,n,o=e[32]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function jr(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Cr(xr(e,o,t));return{c(){t=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=L(),T(t,"class","pointer svelte-14hcfjl"),O(t,"active",e[29]._id===e[0])},m(e,o){_(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);I(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const s=xr(e,o,l);r[l]?r[l].p(s,i):(r[l]=Cr(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}2049&i[0]&&O(t,"active",e[29]._id===e[0])},d(e){e&&q(t),S(r,e)}}}function Cr(e){let t,n,o,r,i=e[9](e[29],e[32])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[29]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function Lr(e){let t,n=e[13](e[29],e[27],e[1]),o=n&&jr(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),_(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[29],e[27],e[1])),n?o?o.p(e,r):(o=jr(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&q(t)}}}function Fr(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Er(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:Fr,then:qr,catch:_r,value:28,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function Dr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Er]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};3&n[0]|64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function zr(e,o,r){const i=H(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:f}=o,{className:$}=o,{classId:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,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?p(n):m(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass($);P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Es(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(15,f=e.item),"className"in e&&r(16,$=e.className),"classId"in e&&r(17,h=e.classId),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(18,v=e.viewName),"viewValue"in e&&r(19,y=e.viewValue),"recordId"in e&&r(20,b=e.recordId),"filter"in e&&r(21,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _,n="."+h+"#"+v;document.querySelector(n);let o={[v]:y},r=[];o[v]&&(r=await t.getSectionView(e.class,o,!0)),w&&(r=r.filter((e=>e._id!=w)));let i=[],l=e.display;return l&&l.length?l.map((t=>{const[n,o]=t.split(".");let l=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));l&&(l={...l},l.name=`${n}_${o}`,r=r.map((e=>(e[n]&&(e[l.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),l||(l=e.items.find((e=>e.name===n))),i.find((e=>e?.name===n))||i.push(l)})):i=e.items,{list:r,items:i}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},f,$,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class Tr extends we{constructor(e){var t;super(),br.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(br.head,t)),be(this,e,zr,Dr,w,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Vr(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ar(e){let t,n,o,r,i;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}),G.push((()=>he(n,"value",l)));let a=!e[6]&&Br(e);return{c(){t=N("div"),ge(n.$$.fragment),r=L(),a&&a.c(),B(t,"position","relative")},m(e,o){_(e,t,o),ve(n,t,null),I(t,r),a&&a.m(t,null),i=!0},p(e,r){const i={};4&r&&(i.id=e[2]),8&r&&(i.name=e[3].name),34&r&&(i.inputClass=e[5]||e[1]),64&r&&(i.disabled=e[6]),128&r&&(i.formnovalidate=e[7]),!o&&1&r&&(o=!0,i.value=e[0],ne((()=>o=!1))),n.$set(i),e[6]?a&&(ce(),me(a,1,1,(()=>{a=null})),de()):a?(a.p(e,r),64&r&&ue(a,1)):(a=Br(e),a.c(),ue(a,1),a.m(t,null))},i(e){i||(ue(n.$$.fragment,e),ue(a),i=!0)},o(e){me(n.$$.fragment,e),me(a),i=!1},d(e){e&&q(t),ye(n),a&&a.d()}}}function Br(e){let t,n,o,r,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-wbrqzu")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[17]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Or(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Mr(e){let t,n,o;function r(t){e[22](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[Wr]},$$scope:{ctx:e}};return void 0!==e[8]&&(i.open=e[8]),t=new e[11]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};268435994&o&&(r.$$scope={dirty:o,ctx:e}),!n&&256&o&&(n=!0,r.open=e[8],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Wr(e){let t,n;return t=new Tr({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.item=e[3]),8&n&&(o.className=e[3].refClass),2&n&&(o.classId=e[1]),16&n&&(o.recordId=e[4]._id),512&n&&(o.viewValue=e[9]),16&n&&(o.filter=e[4]._id),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Rr(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Or,then:Ar,catch:Vr,value:27,blocks:[,,,]};fe(e[16](),r);let i=e[8]&&Mr(e);return{c(){r.block.c(),t=L(),i&&i.c(),n=F()},m(e,l){r.block.m(e,r.anchor=l),r.mount=()=>t.parentNode,r.anchor=t,_(e,t,l),i&&i.m(e,l),_(e,n,l),o=!0},p(t,[o]){pe(r,e=t,o),e[8]?i?(i.p(e,o),256&o&&ue(i,1)):(i=Mr(e),i.c(),ue(i,1),i.m(n.parentNode,n)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){o||(ue(r.block),ue(i),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}me(i),o=!1},d(e){r.block.d(e),r.token=null,r=null,e&&q(t),i&&i.d(e),e&&q(n)}}}function Pr(e,t,n){const{TextField:o,Modal:r}=c;let{classId:i}=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:b=!1,view:w}=$,k=!1;const x=()=>{n(8,k=!1)};return e.$$set=e=>{"classId"in e&&n(1,i=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,i,l,s,a,u,m,f,k,h,o,r,g,y,b,w,async()=>(n(9,h=a[w.selection]),!0),()=>{n(8,k=!0)},({detail:e})=>{n(0,d=e.row[w.value?w.value:"_id"]),x()},x,p,function(e){d=e,n(0,d)},function(e){k=e,n(8,k)}]}class Hr extends we{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=N("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",I(document.head,t)),be(this,e,Pr,Rr,w,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Qr(e,t,n){const o=e.slice();return o[12]=t[n][0],o[13]=t[n][1],o}function Yr(e){let t;return{c(){t=N("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Gr(e){let t;return{c(){t=N("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jr(e){let t,n,o,r,i=e[12]+"";return{c(){t=N("option"),n=C(i),t.__value=o=e[13],t.value=t.__value,t.selected=r=e[0]==e[13]},m(e,o){_(e,t,o),I(t,n)},p(e,l){64&l&&i!==(i=e[12]+"")&&V(n,i),64&l&&o!==(o=e[13])&&(t.__value=o,t.value=t.__value),65&l&&r!==(r=e[0]==e[13])&&(t.selected=r)},d(e){e&&q(t)}}}function Ur(e){let t,n,o,r,i,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Gr:Yr}let o=n(e),r=o(e);return{c(){r.c(),t=F()},m(e,n){r.m(e,n),_(e,t,n)},p(e,i){o!==(o=n(e))&&(r.d(1),r=o(e),r&&(r.c(),r.m(t.parentNode,t)))},d(e){r.d(e),e&&q(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=Jr(Qr(e,s,t));return{c(){t=N("select"),l&&l.c(),n=F();for(let e=0;e<a.length;e+=1)a[e].c();T(t,"class",o=x(e[3]||e[4])+" svelte-5xpzvo"),T(t,"id",e[2]),T(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(o,s){_(o,t,s),l&&l.m(t,null),I(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);r||(i=E(t,"change",e[9]),r=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let o;for(s=e[6],o=0;o<s.length;o+=1){const r=Qr(e,s,o);a[o]?a[o].p(r,n):(a[o]=Jr(r),a[o].c(),a[o].m(t,null))}for(;o<a.length;o+=1)a[o].d(1);a.length=s.length}24&n&&o!==(o=x(e[3]||e[4])+" svelte-5xpzvo")&&T(t,"class",o),4&n&&T(t,"id",e[2]),4&n&&T(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:h,o:h,d(e){e&&q(t),l&&l.d(),S(a,e),r=!1,i()}}}function Zr(e,t,n){const o=H();let{id:r}=t,{item:i}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=i.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,r=e.id),"item"in e&&n(10,i=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,r,s,a,d,u,m,f,e=>o("blur",{value:e.srcElement.value}),i]}class Kr extends we{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=N("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}",I(document.head,t)),be(this,e,Zr,Ur,w,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Xr(e){let t;return{c(){t=C("Stunden")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ei(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Xr]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ti(e){let t;return{c(){t=C("Minuten")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ni(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ti]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function oi(e){let t;return{c(){t=C("Jetzt")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ri(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[oi]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ii(e){let t,n,o,r,i,l,s,a,c;return r=new e[5]({props:{value:e[0],closeOnSelection:!0}}),r.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[ri],"minutes-label":[ni],"hours-label":[ei]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=N("input"),o=L(),ge(r.$$.fragment),i=L(),ge(l.$$.fragment),T(t,"type","string"),T(t,"class",n=e[2]||e[3]),T(t,"id",e[1]),T(t,"name",e[1]),t.hidden=!0},m(n,d){_(n,t,d),A(t,e[0]),_(n,o,d),ve(r,n,d),_(n,i,d),ve(l,n,d),s=!0,a||(c=E(t,"input",e[9]),a=!0)},p(e,[o]){(!s||12&o&&n!==(n=e[2]||e[3]))&&T(t,"class",n),(!s||2&o)&&T(t,"id",e[1]),(!s||2&o)&&T(t,"name",e[1]),1&o&&A(t,e[0]);const i={};1&o&&(i.value=e[0]),r.$set(i);const a={};1&o&&(a.value=e[0]),4096&o&&(a.$$scope={dirty:o,ctx:e}),l.$set(a)},i(e){s||(ue(r.$$.fragment,e),ue(l.$$.fragment,e),s=!0)},o(e){me(r.$$.fragment,e),me(l.$$.fragment,e),s=!1},d(e){e&&q(t),e&&q(o),ye(r,e),e&&q(i),ye(l,e),a=!1,c()}}}function li(e,t,n){const o=H(),{Label:r,DatePicker:i,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>o("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,r,i,l,({detail:e})=>{var t,o;n(0,(t=e.value,o=s,s=null==t||null==o?t:(o.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),o))),m(s)},({detail:e})=>{n(0,s=_n(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class si extends we{constructor(e){super(),be(this,e,li,ii,w,{value:0,id:1,noForm:2,classId:3})}}function ai(e){let t,n,o,r,i,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=N("input"),i=L(),l=N("input"),d=L(),ge(u.$$.fragment),m=C(" /\n"),ge(f.$$.fragment),T(t,"type","string"),T(t,"class",n=e[1]||e[2]),T(t,"id",o=e[0]+"_from"),T(t,"name",r=e[0]+"_from"),t.hidden=!0,T(l,"type","string"),T(l,"class",s=e[1]||e[2]),T(l,"id",a=e[0]+"_to"),T(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,o){_(n,t,o),A(t,e[7]),_(n,i,o),_(n,l,o),A(l,e[8]),_(n,d,o),ve(u,n,o),_(n,m,o),ve(f,n,o),p=!0,$||(h=[E(t,"input",e[13]),E(l,"input",e[14])],$=!0)},p(e,[i]){(!p||6&i&&n!==(n=e[1]||e[2]))&&T(t,"class",n),(!p||1&i&&o!==(o=e[0]+"_from"))&&T(t,"id",o),(!p||1&i&&r!==(r=e[0]+"_from"))&&T(t,"name",r),128&i&&A(t,e[7]),(!p||6&i&&s!==(s=e[1]||e[2]))&&T(l,"class",s),(!p||1&i&&a!==(a=e[0]+"_to"))&&T(l,"id",a),(!p||1&i&&c!==(c=e[0]+"_to"))&&T(l,"name",c),256&i&&A(l,e[8]);const d={};32&i&&(d.format=e[5]),8&i&&(d.required=e[3]),16&i&&(d.disabled=e[4]),128&i&&(d.value=e[7]),u.$set(d);const m={};64&i&&(m.format=e[6]),8&i&&(m.required=e[3]),16&i&&(m.disabled=e[4]),256&i&&(m.value=e[8]),f.$set(m)},i(e){p||(ue(u.$$.fragment,e),ue(f.$$.fragment,e),p=!0)},o(e){me(u.$$.fragment,e),me(f.$$.fragment,e),p=!1},d(e){e&&q(t),e&&q(i),e&&q(l),e&&q(d),ye(u,e),e&&q(m),ye(f,e),$=!1,y(h)}}}function ci(e,t,n){const o=H(),{DatePicker:r}=c;let{value:i}=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=i?.from,$=i?.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,i=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,$,r,({detail:e})=>{n(7,p=_n(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),o("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=_n(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),o("change",{value:$,range:"_to"})},i,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class di extends we{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=N("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",I(document.head,t)),be(this,e,ci,ai,w,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function ui(e){let t,n,o;return n=new e[6]({props:{type:"string",inputClass:e[2]?"":" "+e[3],id:e[0],name:e[0],value:e[1],pattern:mi,placeholder:fi,readonly:e[4],disabled:e[5]}}),n.$on("change",e[7]),{c(){t=N("div"),ge(n.$$.fragment),B(t,"max-width","4em")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,[t]){const o={};12&t&&(o.inputClass=e[2]?"":" "+e[3]),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),2&t&&(o.value=e[1]),16&t&&(o.readonly=e[4]),32&t&&(o.disabled=e[5]),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}const mi="([01][0-9]|2[0-3]):([0-5][0-9])",fi="";function pi(e,t,n){const o=H(),{TextField:r}=c;let{id:i}=t,{item:l}=t,{value:s}=t,{noForm:a=!1}=t,{classId:d}=t,{readonly:u}=t,{disabled:m}=t,{praefix:f}=t;const p=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,i=e.id),"item"in e&&n(8,l=e.item),"value"in e&&n(1,s=e.value),"noForm"in e&&n(2,a=e.noForm),"classId"in e&&n(3,d=e.classId),"readonly"in e&&n(4,u=e.readonly),"disabled"in e&&n(5,m=e.disabled),"praefix"in e&&n(9,f=e.praefix)},[i,s,a,d,u,m,r,({detail:e})=>{o("blur",{value:p(e.value)}),o("checkRange",{idx:f,fieldId:i,value:e.value})},l,f]}class $i extends we{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=N("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",I(document.head,t)),be(this,e,pi,ui,w,{id:0,item:8,value:1,noForm:2,classId:3,readonly:4,disabled:5,praefix:9})}}const{document:hi}=$e;function gi(e,t,n){const o=e.slice();return o[0]=t[n],o}function vi(e,t,n){const o=e.slice();return o[17]=t[n],o[19]=n,o}function yi(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function bi(e){let t,n,o=e[14],r=[];for(let t=0;t<o.length;t+=1)r[t]=ki(gi(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(14&n){let l;for(o=e[14],l=0;l<o.length;l+=1){const i=gi(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=ki(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function wi(e){let t,n,o=(e[0]["_"+e[17]]||e[0][e[17]])+"",r=e[19]&&function(e){let t;return{c(){t=C(", ")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}();return{c(){t=N("span"),r&&r.c(),n=C(o),T(t,"class","lookupValue")},m(e,o){_(e,t,o),r&&r.m(t,null),I(t,n)},p(e,t){2&t&&o!==(o=(e[0]["_"+e[17]]||e[0][e[17]])+"")&&V(n,o)},d(e){e&&q(t),r&&r.d()}}}function ki(e){let t,n,o,r,i,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=wi(vi(e,c,t));return r=new Be({props:{size:"18"}}),{c(){t=N("div");for(let e=0;e<d.length;e+=1)d[e].c();n=L(),o=N("span"),ge(r.$$.fragment),i=L(),T(o,"class","feather pointer svelte-1u646ni"),T(t,"class","lookupItem svelte-1u646ni")},m(c,u){_(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);I(t,n),I(t,o),ve(r,o,null),I(t,i),l=!0,s||(a=E(o,"click",e[3](e[0]._id)),s=!0)},p(o,r){if(e=o,6&r){let o;for(c=e[1],o=0;o<c.length;o+=1){const i=vi(e,c,o);d[o]?d[o].p(i,r):(d[o]=wi(i),d[o].c(),d[o].m(t,n))}for(;o<d.length;o+=1)d[o].d(1);d.length=c.length}},i(e){l||(ue(r.$$.fragment,e),l=!0)},o(e){me(r.$$.fragment,e),l=!1},d(e){e&&q(t),S(d,e),ye(r),s=!1,a()}}}function xi(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ii(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:xi,then:bi,catch:yi,value:14,blocks:[,,,]};return fe(e[2](),o),{c(){t=N("div"),o.block.c(),T(t,"class","lookup svelte-1u646ni")},m(e,r){_(e,t,r),o.block.m(t,o.anchor=null),o.mount=()=>t,o.anchor=null,n=!0},p(t,[n]){pe(o,e=t,n)},i(e){n||(ue(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){me(o.blocks[e])}n=!1},d(e){e&&q(t),o.block.d(),o.token=null,o=null}}}function _i(e,n,o){let{id:r}=n,{item:i}=n,{praefix:l}=n,{record:s}=n;const{refItem:a,view:c}=i.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ee().then((()=>{const e=document.querySelector("div.form-field."+i.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&o(4,r=e.id),"item"in e&&o(0,i=e.item),"praefix"in e&&o(5,l=e.praefix),"record"in e&&o(6,s=e.record)},[i,d,async()=>{let e=[];if(s._id){const n=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const r={[u]:s[u]||s._id};if(e=await t.getSectionView(f,r,n),!n){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})),o(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const n=await t.getTaskByDocId(e);if(!n)return;const o=n._id,r=`/task/${n.event}/${o}/task?view=standalone`;window.open(r)},r,l,s]}class qi extends we{constructor(e){var t;super(),hi.getElementById("svelte-1u646ni-style")||((t=N("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}",I(hi.head,t)),be(this,e,_i,Ii,w,{id:4,item:0,praefix:5,record:6})}}function Si(e){let t,n,o;return n=new Ge({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ni(e){let t,n,o,r,i;return n=new Ge({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[9]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function ji(e){let t,n,o,r,i,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=[Ni,Si],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Ci(e,n,o){const{TextField:r}=c;let{inputClass:i}=n,{disabled:l}=n,{formnovalidate:s}=n,{readonly:a}=n,{required:d}=n,{id:u}=n,{name:m}=n,{value:f}=n,{record:p}=n,{item:$}=n;return e.$$set=e=>{"inputClass"in e&&o(0,i=e.inputClass),"disabled"in e&&o(1,l=e.disabled),"formnovalidate"in e&&o(2,s=e.formnovalidate),"readonly"in e&&o(3,a=e.readonly),"required"in e&&o(4,d=e.required),"id"in e&&o(5,u=e.id),"name"in e&&o(6,m=e.name),"value"in e&&o(7,f=e.value),"record"in e&&o(10,p=e.record),"item"in e&&o(11,$=e.item)},[i,l,s,a,d,u,m,f,r,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:n,houseNo:o,postcode:r,location:i,country:l}=e,s=[n&&o?n+" "+o:n,r&&i?r+" "+i:r||i||"",(await t.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){Q(e,t)}]}class Li extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Ci,ji,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Fi(e){let t,n,o;return n=new We({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ei(e){let t,n,o,r,i;return n=new We({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[9]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Di(e){let t,n,o,r,i,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=[Ei,Fi],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function zi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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,r=e.inputClass),"disabled"in e&&n(1,i=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)},[r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){Q(e,t)}]}class Ti extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,zi,Di,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Vi(e){let t,n,o;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ai(e){let t,n,o,r,i;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[11]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Bi(e){let t,n,o,r,i,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=[Ai,Vi],a=[];function c(e,t){return e[9]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};4&o&&(l.inputClass=e[2]),1&o&&(l.pattern=e[0]),2&o&&(l.placeholder=e[1]),8&o&&(l.disabled=e[3]),16&o&&(l.formnovalidate=e[4]),32&o&&(l.readonly=e[5]),64&o&&(l.required=e[6]),128&o&&(l.id=e[7]),256&o&&(l.name=e[8]),512&o&&(l.value=e[9]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Oi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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{7,8})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,r=e.inputClass),"disabled"in e&&n(3,i=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,r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){Q(e,t)}]}class Mi extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Oi,Bi,w,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Wi(e){let t,n,o;return n=new He({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ri(e){let t,n,o,r,i;return n=new He({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[11]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Pi(e){let t,n,o,r,i,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=[Ri,Wi],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),256&o&&(l.pattern=e[8]),512&o&&(l.placeholder=e[9]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Hi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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,r=e.inputClass),"disabled"in e&&n(1,i=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)},[r,i,l,s,a,d,u,m,f,p,o,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){Q(e,t)}]}class Qi extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Hi,Pi,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}function Yi(e){let t,n;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+(e[20]?" hidden ":""),name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[ml,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1048578&n[0]&&(o.class=e[1].name+(e[20]?" hidden ":"")),2&n[0]&&(o.name=e[1].designation),2&n[0]&&(o.help=e[1].properties?.hint),57671679&n[0]|33554432&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Gi(e){let t,n,o,r,i,l;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+" hidden",name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[fl]},$$scope:{ctx:e}}}),o=new e[30]({props:{text:e[25]}}),i=new Do({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[1],value:e[24]()}}),i.$on("setRefValue",e[40]),i.$on("safeReference",e[44]),{c(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment),r=L(),ge(i.$$.fragment)},m(e,s){ve(t,e,s),_(e,n,s),ve(o,e,s),_(e,r,s),ve(i,e,s),l=!0},p(e,n){const r={};2&n[0]&&(r.class=e[1].name+" hidden"),2&n[0]&&(r.name=e[1].designation),2&n[0]&&(r.help=e[1].properties?.hint),25166210&n[0]|33554432&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};33554432&n[0]&&(l.text=e[25]),o.$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]),2&n[0]&&(s.item=e[1]),16777216&n[0]&&(s.value=e[24]()),i.$set(s)},i(e){l||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),ue(i.$$.fragment,e),l=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!1},d(e){ye(t,e),e&&q(n),ye(o,e),e&&q(r),ye(i,e)}}}function Ji(e){let t,n;return t=new e[27]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[21],required:!0===e[4],placeholder:e[22],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2097152&n[0]&&(o.pattern=e[21]),16&n[0]&&(o.required=!0===e[4]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Ui(e){let t,n;return t=new Mi({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[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Zi(e){let t,n;return t=new Ti({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[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Ki(e){let t,n;return t=new Qi({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[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Xi(e){let t,n;return t=new $i({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[1],value:e[24](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[49]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function el(e){let t,n;return t=new qi({props:{id:e[32],item:e[1],praefix:e[5],record:e[0]}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[1]),32&n[0]&&(o.praefix=e[5]),1&n[0]&&(o.record=e[0]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function tl(e){let t,n;return t=new Li({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[24](),record:e[0],item:e[1]}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),1&n[0]&&(o.record=e[0]),2&n[0]&&(o.item=e[1]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function nl(e){let t,n;return t=new si({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ol(e){let t,n;return t=new di({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function rl(e){let t,n;return t=new e[28]({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function il(e){let t,n;return t=new e[29]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),524296&n[0]&&(o.disabled=e[3]||e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.checked=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ll(e){let t,n;return t=new Hr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],view:e[1].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[48]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.view=e[1].properties.view),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function sl(e){let t,n;return t=new yr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],multi:e[1].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[47]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.multi=e[1].properties.multi),4096&n[0]&&(o.numberInput=e[12]),32&n[0]&&(o.praefix=e[5]),32768&n[0]&&(o.toDelete=e[15]),65536&n[0]&&(o.reqQuantity=e[16]),262144&n[0]&&(o.notifyList=e[18]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function al(e){let t,n;return t=new Ao({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[1],currency:e[17],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),16&n[0]&&(o.required=e[4]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),131072&n[0]&&(o.currency=e[17]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function cl(e){let t,n;return t=new Kr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function dl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[1].name,value:e[24](),noForm:e[6],placeholder:e[1].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.name=e[1].name),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.placeholder=e[1].properties?.placeholder),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ul(e){let t,n;return t=new wn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[1],desc:e[25],value:e[24](),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[45]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[46]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),33554432&n[0]&&(o.desc=e[25]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),32&n[0]&&(o.praefix=e[5]),512&n[0]&&(o.selectionFields=e[9]),2048&n[0]&&(o.selection=e[11]),8192&n[0]&&(o.deList=e[13]),4&n[0]&&(o.recordId=e[2]),16384&n[0]&&(o.isTemplate=e[14]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ml(e){let t,n,o,r;const i=[ul,dl,cl,al,sl,ll,il,rl,ol,nl,tl,el,Xi,Ki,Zi,Ui,Ji],l=[];function s(e,t){return"object"===e[1].type?0:"textarea"===e[1].type||e[1].properties&&"textarea"===e[1].properties.format?1:e[1].properties&&(e[1].properties.enum||e[1].properties.regulation)?2:"number"===e[1].type?3:e[1].properties&&e[1].properties.multi?4:e[1].properties&&e[1].properties.view&&"lookup"===!e[1].properties.format?5:"boolean"===e[1].type?6:"date"===e[1].type?7:"dateRange"===e[1].type?8:"datetime"===e[1].type?9:"map"===e[1].properties?.format?10:"lookup"===e[1].properties?.format?11:"time"===e[1].properties?.format?12:"email"===e[1].type||"email"===e[1].properties?.format?13:"url"===e[1].properties?.format?14:"tel"===e[1].properties?.format?15:16}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function fl(e){let t,n;return t=new wn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[1],value:e[24](),withRefValue:!0,refValue:e[23]}}),t.$on("setRefDesc",e[41]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),8388608&n[0]&&(o.refValue=e[23]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function pl(e){let t,n,o,r;const i=[Gi,Yi],l=[];function s(e,t){return e[5]||"reference"!==e[1].saveAs||"object"!==e[1].type?1:0}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function $l(e,t,n){let o,r,i;const l=H(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:f,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:b=!1}=t,{classId:w}=t,{eventId:k}=t,{disabled:x}=t,{selectionFields:I}=t,{formnovalidate:_}=t,{selection:q=!1}=t,{notifyList:S}=t,{numberInput:N}=t,{deList:j}=t,{required:C}=t,{isTemplate:L}=t,{toDelete:F}=t,{reqQuantity:E}=t,{currency:D}=t,{changeValue:z}=t;y||=v._id;let{required:T,readonly:V,hidden:A,pattern:B,placeholder:O}=h.properties||{};if("tel"===h.properties?.format&&(B||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",O||="+41 58 234 56 78"),A=!0===A,void 0!==V&&(V=!0===V),void 0===C&&(C=T),x=x||!!V,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const M=(g?g+".":"")+h.name,W=M+(""!==$?"-"+$:""),R=(e,t=M)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let P=R(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(1,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(0,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,b=e.noForm),"classId"in e&&n(7,w=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,_=e.formnovalidate),"selection"in e&&n(11,q=e.selection),"notifyList"in e&&n(18,S=e.notifyList),"numberInput"in e&&n(12,N=e.numberInput),"deList"in e&&n(13,j=e.deList),"required"in e&&n(4,C=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,F=e.toDelete),"reqQuantity"in e&&n(16,E=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue)},e.$$.update=()=>{if(4096&e.$$.dirty[1])for(const e in z)e===M&&n(0,v[M]=z[e],v);1&e.$$.dirty[0]&&n(24,o=(e=M)=>{let t=R(v);return void 0===t?"":t}),1&e.$$.dirty[0]&&(i=R(v))},n(25,r=((e=M)=>{let t=v["_"+e];return t=m(t),void 0===t?"":t})()),[v,h,y,x,C,$,b,w,k,I,_,q,N,j,L,F,E,D,S,V,A,B,O,P,o,r,s,a,d,f,p,M,W,(e=M)=>{let t=R(v);return t?new Date(t):new Date},(e=M)=>{const t=R(v,e+"_from"),n=R(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:o,checked:r,range:s}=t;void 0!==r&&(o=r);const a=M+(s||"");n(0,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("%%","%")}(o,"%d.%m.%Y"):o,v);const c=Object.values(v).every((e=>!e))&&o;l("notify",{oldValue:i,value:o,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,A=!0),()=>"object"===h.type?"comment_"+W:W,({detail:e})=>{n(23,P=e)},({detail:e})=>{const{designation:t}=h;n(25,r=t+": "+(e||"(Neu)"))},g,z,function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)}]}class hl extends we{constructor(e){var t;super(),document.getElementById("svelte-mea5fj-style")||((t=N("style")).id="svelte-mea5fj-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.form-field div.field > label.checkbox{padding-top:0.5em}",I(document.head,t)),be(this,e,$l,pl,w,{praefix:5,item:1,listName:42,record:0,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},[-1,-1])}}const{document:gl}=$e;function vl(e,t,n){const o=e.slice();return o[83]=t[n],o[85]=n,o}function yl(e,t,n){const o=e.slice();return o[92]=t[n],o}function bl(e,t,n){const o=e.slice();return o[87]=t[n].title,o[88]=t[n].toDelete,o[89]=t[n].icon,o}function wl(e){let t,n;return t=new e[18]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[kl]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2048&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function kl(e){let t,n,o;function r(t){e[46](t)}let i={item:e[28],disabled:!0};return void 0!==e[11]&&(i.value=e[11]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&2048&o[0]&&(n=!0,r.value=e[11],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function xl(e){let t,n;return t=new e[18]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[Il]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Il(e){let t,n,o;function r(t){e[47](t)}let i={item:e[26],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function _l(e){let t,n;return t=new e[18]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[ql]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1152&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ql(e){let t,n,o;function r(t){e[48](t)}let i={item:e[24],disabled:!0,currency:e[7]};return void 0!==e[10]&&(i.value=e[10]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&1024&o[0]&&(n=!0,r.value=e[10],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Sl(e){let t,n;return t=new e[21]({props:{class:e[15][e[85]],open:e[9]&&!e[1]&&0===e[85],$$slots:{handle:[zl,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]],default:[Ll,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){b(e[42](e[85],e[82]))&&e[42](e[85],e[82]).apply(this,arguments)})),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};32768&o[0]&&(r.class=e[15][e[85]]),514&o[0]&&(r.open=e[9]&&!e[1]&&0===e[85]),209917&o[0]|16777216&o[2]|4&o[3]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Nl(e){let t,n;return t=new hl({props:{praefix:e[85],item:e[92],eventId:e[6],record:e[83],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:Ol,classId:e[5],disabled:e[0],required:e[22],selectionFields:e[29],numberInput:e[17],currency:e[7],formnovalidate:e[85]===e[12].length-1||e[12][e[85]]._delete}}),t.$on("notify",(function(){b(e[31](e[92],e[85]))&&e[31](e[92],e[85]).apply(this,arguments)})),t.$on("task",e[49]),t.$on("invalid",e[32]),t.$on("defPrep",e[33]),t.$on("checkRange",e[34]),t.$on("record",e[50]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};8&o[0]&&(r.item=e[92]),64&o[0]&&(r.eventId=e[6]),4096&o[0]&&(r.record=e[83]),16&o[0]&&(r.recordId=e[4]._id),4&o[0]&&(r.reqQuantity=e[2]),256&o[0]&&(r.notifyList=e[8]),32&o[0]&&(r.classId=e[5]),1&o[0]&&(r.disabled=e[0]),131072&o[0]&&(r.numberInput=e[17]),128&o[0]&&(r.currency=e[7]),4096&o[0]&&(r.formnovalidate=e[85]===e[12].length-1||e[12][e[85]]._delete),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function jl(e){let t,n,o=e[3].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Nl(yl(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(541200893&n[0]|15&n[1]){let l;for(o=e[3].item,l=0;l<o.length;l+=1){const i=yl(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Nl(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Cl(e){let t,n,o=e[12][e[85]]._delete,r=jl(e);return{c(){r.c(),t=F()},m(e,o){r.m(e,o),_(e,t,o),n=!0},p(e,n){4096&n[0]&&w(o,o=e[12][e[85]]._delete)?(ce(),me(r,1,1,h),de(),r=jl(e),r.c(),ue(r),r.m(t.parentNode,t)):r.p(e,n)},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){e&&q(t),r.d(e)}}}function Ll(e){let t,n,o,r,i=e[12].length,l=Cl(e);return{c(){t=N("div"),l.c(),o=L(),T(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`)},m(e,n){_(e,t,n),l.m(t,null),_(e,o,n),r=!0},p(e,o){4096&o[0]&&w(i,i=e[12].length)?(ce(),me(l,1,1,h),de(),l=Cl(e),l.c(),ue(l),l.m(t,null)):l.p(e,o),(!r||40&o[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`))&&T(t,"id",n)},i(e){r||(ue(l),r=!0)},o(e){me(l),r=!1},d(e){e&&q(t),l.d(e),e&&q(o)}}}function Fl(e){let t,n,o,r,i,l=e[30](e[13],e[85])+"";return{c(){t=N("div"),n=C(l),T(t,"class",o=x("draggableListItem "+e[3].name)+" svelte-1es1ap1"),T(t,"draggable",!0),O(t,"delete",e[83]._delete),O(t,"is-active-top",e[16]?.top===e[85]),O(t,"is-active-bottom",e[16]?.bottom===e[85])},m(o,l){_(o,t,l),I(t,n),r||(i=[E(t,"dragover",e[40]),E(t,"dragleave",e[41](e[85])),E(t,"dragstart",e[38](e[85])),E(t,"drop",D(e[37](e[85]))),E(t,"dragenter",e[39](e[85]))],r=!0)},p(r,i){e=r,8192&i[0]&&l!==(l=e[30](e[13],e[85])+"")&&V(n,l),8&i[0]&&o!==(o=x("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&T(t,"class",o),4104&i[0]&&O(t,"delete",e[83]._delete),65544&i[0]&&O(t,"is-active-top",e[16]?.top===e[85]),65544&i[0]&&O(t,"is-active-bottom",e[16]?.bottom===e[85])},d(e){e&&q(t),r=!1,y(i)}}}function El(e){let t,n,o;var r=e[89];return r&&(t=new r({props:{size:"20"}})),{c(){t&&ge(t.$$.fragment),n=F()},m(e,r){t&&ve(t,e,r),_(e,n,r),o=!0},p(e,o){if(r!==(r=e[89])){if(t){ce();const e=t;me(e.$$.fragment,1,0,(()=>{ye(e,1)})),de()}r?(t=new r({props:{size:"20"}}),ge(t.$$.fragment),ue(t.$$.fragment,1),ve(t,n.parentNode,n)):t=null}},i(e){o||(t&&ue(t.$$.fragment,e),o=!0)},o(e){t&&me(t.$$.fragment,e),o=!1},d(e){e&&q(n),t&&ye(t,e)}}}function Dl(e){let t,n,o,r,i,l=!e[0]&&!e[3].readonly&&El(e);return{c(){t=N("span"),l&&l.c(),T(t,"class","pointer icon svelte-1es1ap1"),T(t,"title",e[87]),t.hidden=n=e[85]===e[12].length-1||!(e[83]._delete^e[88])},m(n,s){_(n,t,s),l&&l.m(t,null),o=!0,r||(i=E(t,"click",(function(){b(e[36](e[85],e[9],e[86]))&&e[36](e[85],e[9],e[86]).apply(this,arguments)})),r=!0)},p(r,i){(e=r)[0]||e[3].readonly?l&&(ce(),me(l,1,1,(()=>{l=null})),de()):l?(l.p(e,i),9&i[0]&&ue(l,1)):(l=El(e),l.c(),ue(l,1),l.m(t,null)),(!o||4096&i[0]&&n!==(n=e[85]===e[12].length-1||!(e[83]._delete^e[88])))&&(t.hidden=n)},i(e){o||(ue(l),o=!0)},o(e){me(l),o=!1},d(e){e&&q(t),l&&l.d(),r=!1,i()}}}function zl(e){let t,n,o,r,i,l;n=new e[19]({props:{$$slots:{default:[Fl]},$$scope:{ctx:e}}}),n.$on("click",(function(){b(e[35](e[86],e[85],e[9]))&&e[35](e[86],e[85],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Te},{title:"undo",toDelete:!1,icon:Ee}],a=[];for(let t=0;t<2;t+=1)a[t]=Dl(bl(e,s,t));const c=e=>me(a[e],1,1,(()=>{a[e]=null}));return{c(){t=N("div"),ge(n.$$.fragment),o=L();for(let e=0;e<2;e+=1)a[e].c();r=L(),T(t,"class",i=x("accordion "+e[3].name)+" svelte-1es1ap1"),T(t,"slot","handle")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o);for(let e=0;e<2;e+=1)a[e].m(t,null);I(t,r),l=!0},p(o,d){e=o;const u={};if(77832&d[0]|4&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|32&d[1]|16777216&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Te},{title:"undo",toDelete:!1,icon:Ee}],n=0;n<2;n+=1){const o=bl(e,s,n);a[n]?(a[n].p(o,d),ue(a[n],1)):(a[n]=Dl(o),a[n].c(),ue(a[n],1),a[n].m(t,r))}for(ce(),n=2;n<2;n+=1)c(n);de()}(!l||8&d[0]&&i!==(i=x("accordion "+e[3].name)+" svelte-1es1ap1"))&&T(t,"class",i)},i(e){if(!l){ue(n.$$.fragment,e);for(let e=0;e<2;e+=1)ue(a[e]);l=!0}},o(e){me(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)me(a[e]);l=!1},d(e){e&&q(t),ye(n),S(a,e)}}}function Tl(e){let t,n,o=(!e[1]&&!e[0]||e[85]<e[12].length-1)&&Sl(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){!e[1]&&!e[0]||e[85]<e[12].length-1?o?(o.p(e,n),4099&n[0]&&ue(o,1)):(o=Sl(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Vl(e){let t,n,o=e[12],r=[];for(let t=0;t<o.length;t+=1)r[t]=Tl(vl(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(1615049727&n[0]|4095&n[1]|17825792&n[2]){let l;for(o=e[12],l=0;l<o.length;l+=1){const i=vl(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Tl(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Al(e){let t,n,o,r,i,l,s=e[27]&&e[11]&&0!=e[11]&&wl(e),a=e[25]&&e[14]&&0!=e[14]&&xl(e),c=e[23]&&e[10]&&0!=e[10]&&_l(e);return i=new e[20]({props:{class:e[5]+e[3].name,$$slots:{default:[Vl,({closeOtherPanels:e})=>({82:e}),({closeOtherPanels:e})=>[0,0,e?1048576:0]]},$$scope:{ctx:e}}}),{c(){t=N("div"),s&&s.c(),n=L(),a&&a.c(),o=L(),c&&c.c(),r=L(),ge(i.$$.fragment),T(t,"class","formList")},m(e,d){_(e,t,d),s&&s.m(t,null),I(t,n),a&&a.m(t,null),I(t,o),c&&c.m(t,null),I(t,r),ve(i,t,null),l=!0},p(e,l){e[27]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&ue(s,1)):(s=wl(e),s.c(),ue(s,1),s.m(t,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[25]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&ue(a,1)):(a=xl(e),a.c(),ue(a,1),a.m(t,o)):a&&(ce(),me(a,1,1,(()=>{a=null})),de()),e[23]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&ue(c,1)):(c=_l(e),c.c(),ue(c,1),c.m(t,r)):c&&(ce(),me(c,1,1,(()=>{c=null})),de());const d={};40&l[0]&&(d.class=e[5]+e[3].name),242687&l[0]|1048576&l[2]|4&l[3]&&(d.$$scope={dirty:l,ctx:e}),i.$set(d)},i(e){l||(ue(s),ue(a),ue(c),ue(i.$$.fragment,e),l=!0)},o(e){me(s),me(a),me(c),me(i.$$.fragment,e),l=!1},d(e){e&&q(t),s&&s.d(),a&&a.d(),c&&c.d(),ye(i)}}}let Bl=new Map;const Ol=!0,Ml="pos/target";function Wl(e,n,o){let r,i;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:$}=c,h=H();let{list:g}=n,{schema:v}=n,{record:y}=n,{classId:b}=n,{eventId:w}=n,{disabled:k}=n,{fixed:x}=n,{template:I={}}=n,{reqQuantity:_}=n,{open:q=!1}=n,{currency:S}=n,{notifyList:N}=n;const j=v.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),C=j&&v.find((e=>"quantity"===e.name));let L=0;const F=v.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let E=0;const D=v.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",z=!!D;let T=0;const V={};let A=v.properties?.readonly,B=b.split("form-")[1].slice(0,-4),O=new Map;g.group&&(x=!0);const M={};k||=A;let W,R,P=[],Y=[],G=!1,J={},U=[];v.filter((e=>e.selection)).map((e=>P.push({className:B,parentClass:v,refClass:e.selection,value:""}))),v.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{v.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[o,r]=n.split(".");r||(r=o,o=void 0),U.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));const Z=async(e,t,n)=>{const o=y[n];if(!o?.length)return;const r=o[0][n];if(!r)return;const i=await Fs(n,r);return i?i[g.name]:void 0},K=async(e,t)=>{const n=U.filter((e=>(e.refObj||B)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:r,refName:i,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(r){const t=W[e][r];r===B&&i?d=y:t&&(d=await Fs(r,t))}!r&&i&&(d=W[e]),d&&(u=d[i],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&&o(12,W[e][n]="",W))}},X=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const r=document.querySelectorAll(n);let i=!1;r.forEach((e=>{e.required&&""===e.value&&(i=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),o(15,Y[e]=i||t?"invalid":"",Y)},te=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},ne=(e,t)=>{if(!t)return;const n=v.find((e=>e.name===t)),r=n.properties.value.formula,{operator:i,argument:l}=r,s=l.map((t=>W[e][t.refItem]));let a=0;"$add"===i&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===i&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,o]=e.split(":");e=o?(+n+ +o/60).toFixed(2):+n;const[r,i]=t.split(":");return r?e-=i?(+r+ +i/60).toFixed(2):+r:0})));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;o(12,W[e][t]=(a||0).toFixed(n.properties.decimals||0),W),o(17,J={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};R=v.filter((e=>e.refClass)).reduce(((e,t)=>{const n=v.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,o]=t.selection.split(":"),[r]=o?.split(".")||[];r&&e.push({refClass:r,items:[n],selection:t.selection})}const o={refClass:t.refClass,items:[]};return n.forEach((e=>{o.items.push(e.name)})),e.push(o),e}),[]);const oe=async(e,t,n,r)=>{const i=(await R).find((e=>e.refClass===t.refClass));if(!i)return;const{refClass:l,items:s,selection:a}=i,c=t.name;if(U.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 i=>{const c=v.find((e=>e.name===i));if(c.properties?.readonly&&!t.refInput){const n=W[e][t.refClass];return Promise.resolve(Fs(t.refClass,n,!0)).then((t=>{let n=t[i];Array.isArray(n)&&(n=n.length?n[0][i]:""),o(12,W[e][i]=n,W)}))}let d="";const{refInput:u}=t;if(u&&W[e]){const[t,n]=u.split(".");d=n?W[e][n]:y[t]}if(a&&n!==r)s.map((t=>{o(12,W[e][t]="",W)}));else if(u&&!d||re(e,i)||r!==n){const n=v.find((e=>e.refClass===l)),r=W[e][n.name];if(t.selection){const n=Ls(t.selection+r.toString());if(n)return Promise.resolve(n).then((t=>o(12,W[e][i]=t[i],W)))}return Promise.resolve(Fs(n.refClass,r)).then((t=>o(12,W[e][i]=t[i],W)))}}))):Promise.resolve(s.map((t=>{o(12,W[e][t]="",W)})))},re=(e,t)=>{let n=W[e][t];return"number"===v.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},ie=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let le=!1;const se=e=>!(!x&&e>=W.length-1),ae=(e,t=!1)=>{const[n,o]=e.split(";");return g.name===o&&(!!se(t)&&((!1===t||t!=n)&&parseInt(n)))};v.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=v.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ce=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,o=document.querySelectorAll(n);if(!o?.length)return;const r=o[o.length-1];ee().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(ie)})).then((()=>{t&&r.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&o(3,g=e.list),"schema"in e&&o(43,v=e.schema),"record"in e&&o(4,y=e.record),"classId"in e&&o(5,b=e.classId),"eventId"in e&&o(6,w=e.eventId),"disabled"in e&&o(0,k=e.disabled),"fixed"in e&&o(1,x=e.fixed),"template"in e&&o(44,I=e.template),"reqQuantity"in e&&o(2,_=e.reqQuantity),"open"in e&&o(9,q=e.open),"currency"in e&&o(7,S=e.currency),"notifyList"in e&&o(8,N=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&y&&(o(2,_=y.quantity),o(12,W=(y[g.name]||[]).concat({}))),4096&e.$$.dirty[0]&&o(13,r=W),15368&e.$$.dirty[0]&&r&&((()=>{if(F)o(14,E=W?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(z)o(11,T=W?.reduce(((e,t)=>e+(t._delete?0:+(t[D]||0))),0)||0)})(),(()=>{if(j)o(10,L=W?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}if(t.price){const n=(C?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ee().then((()=>h("save",{listName:g.name,value:W,amountValue:L,weeksValue:T})))),16384&e.$$.dirty[1]&&(i=e=>V[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[k,x,_,g,y,b,w,S,N,q,L,T,W,r,E,Y,G,J,l,a,d,u,undefined,j,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},z,{name:"weeksValue",properties:{decimals:1}},P,(e,t)=>{let n=e[t];return M["pos"+t]&&(n=M["pos"+t]),n&&v.filter((e=>!0!==e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?i(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?p(n[e.name]):"date"===e.type?m(n[e.name]):"datetime"===e.type?f(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:i,value:l,add:s,desc:a}=n;if(g.refItem){const n=await Z(t,e,g.refItem);n&&o(12,W=n)}ne(t,e._formulaActor);const c=P?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&W.length===t+1&&o(12,W=W.concat({})),a&&o(45,V[l]=a,V),await oe(t,e,l,i),await K(t,e.name),o(13,r=W),"number"===e.type&&o(17,J={item:e,value:l,idx:t}),X(t)},({detail:e})=>{const{idx:t,value:n}=e;X(t,n)},async({detail:{className:e,itemName:n,value:o}})=>{if(O.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===B+"."+g.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&O.set(e,i[0])},({detail:e})=>{const{idx:t,fieldId:n,value:o}=e;if(!o)return;const r=te(o);let i=!1;W.forEach(((e,n)=>{if(t===n)return;const{start:o,end:l}=W[n];o&&l&&r>te(o)&&r<te(l)&&(i=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",i)},(e,t,n)=>n=>{W[t]._delete||(e(n),ce(t,!0))},(e,t,n)=>r=>{if(o(12,W[e]._delete=!W[e]._delete,W),W[e]._delete){M["pos"+e]={...W[e]};for(const t of v)o(12,W[e][t.name]="",W);t&&n(r)}else{if(M["pos"+e]){const t={};for(const n of v)t[n.name]=M["pos"+e][n.name];o(12,W[e]=t,W)}M["pos"+e]=void 0,t||n(r)}},e=>t=>{t.preventDefault(),o(16,G=!1);const n=ae(t.dataTransfer.getData(Ml),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const r=[...W].map(((e,t)=>(e._index=t,e)));n<e?(r.splice(e+1,0,r[n]),r.splice(n,1)):(r.splice(e,0,r[n]),r.splice(n+1,1)),r.map(((e,t)=>{return n=e._index,o=t,void Bl.set(o,n);var n,o}));let i=[];Y.map(((e,t)=>{i[t]=Y[(e=>{const t=Bl.get(e);return void 0===t?e:t})(t)]})),o(15,Y=i),o(12,W=r.map(((e,t)=>(delete e._index,e)))),le=!1},e=>t=>{if(!se(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(Ml,e+";"+g.name),le=e},e=>t=>{const n=ae(t.dataTransfer.getData(Ml),e)||le;return!1===n||n===e?o(16,G=!1):void o(16,G={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{o(16,G=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(O).forEach((([t,n])=>{W[e][t]||o(12,W[e][t]=n._id,W)}))}),500);const r=new Set;for(const e of U)r.add(e.refObj||B);for(const t of Array.from(r))K(e,t);t(n),ce(e)},v,I,V,function(e){T=e,o(11,T)},function(e){E=e,o(14,E)},function(e){L=e,o(10,L)},function(t){Q(e,t)},function(t){Q(e,t)}]}class Rl extends we{constructor(e){var t;super(),gl.getElementById("svelte-1es1ap1-style")||((t=N("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}",I(gl.head,t)),be(this,e,Wl,Al,w,{list:3,schema:43,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:44,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:Pl,document:Hl}=$e;function Ql(e,t,n){const o=e.slice();return o[121]=t[n],o}function Yl(e,t,n){const o=e.slice();return o[124]=t[n],o}function Gl(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Jl(e){let t,n,o=e[120]&&function(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=Zl(Yl(e,g,t));const b=e=>me(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&Kl(e),k=!e[2]&&e[38]&&e[3]&&!e[21]&&as(e);d=new e[24]({props:{outline:!0,$$slots:{default:[ds]},$$scope:{ctx:e}}}),d.$on("click",e[41]);const j=[ms,us],C=[];function F(e,t){return e[5]?0:e[38]?1:-1}~(m=F(e))&&(f=C[m]=j[m](e));return{c(){t=N("section"),n=N("form"),o=N("input"),i=L();for(let e=0;e<v.length;e+=1)v[e].c();l=L(),w&&w.c(),s=L(),k&&k.c(),a=L(),c=N("div"),ge(d.$$.fragment),u=L(),f&&f.c(),T(o,"class",x(e[29])+" svelte-9xiaib"),T(o,"name","_id"),T(o,"type","hidden"),o.value=r=e[4]._id||"",T(n,"class",x(e[30])+" svelte-9xiaib"),T(n,"id",e[29]),T(c,"class","form--buttons svelte-9xiaib"),T(t,"class",x(e[31])+" svelte-9xiaib")},m(r,f){_(r,t,f),I(t,n),I(n,o),I(n,i);for(let e=0;e<v.length;e+=1)v[e].m(n,null);I(n,l),w&&w.m(n,null),I(t,s),k&&k.m(t,null),I(t,a),I(t,c),ve(d,c,null),I(c,u),~m&&C[m].m(c,null),p=!0,$||(h=[E(n,"keydown",e[46]),E(n,"submit",D(e[40]))],$=!0)},p(e,i){if((!p||16&i[0]&&r!==(r=e[4]._id||""))&&(o.value=r),539003026&i[0]|7354432&i[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const o=Yl(e,g,t);v[t]?(v[t].p(o,i),ue(v[t],1)):(v[t]=Zl(o),v[t].c(),ue(v[t],1),v[t].m(n,l))}for(ce(),t=g.length;t<v.length;t+=1)b(t);de()}e[1].list?w?(w.p(e,i),2&i[0]&&ue(w,1)):(w=Kl(e),w.c(),ue(w,1),w.m(n,null)):w&&(ce(),me(w,1,1,(()=>{w=null})),de()),!e[2]&&e[38]&&e[3]&&!e[21]?k?(k.p(e,i),2097164&i[0]&&ue(k,1)):(k=as(e),k.c(),ue(k,1),k.m(t,a)):k&&(ce(),me(k,1,1,(()=>{k=null})),de());const s={};8&i[4]&&(s.$$scope={dirty:i,ctx:e}),d.$set(s);let u=m;m=F(e),m===u?~m&&C[m].p(e,i):(f&&(ce(),me(C[u],1,1,(()=>{C[u]=null})),de()),~m?(f=C[m],f?f.p(e,i):(f=C[m]=j[m](e),f.c()),ue(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)ue(v[e]);ue(w),ue(k),ue(d.$$.fragment,e),ue(f),p=!0}},o(e){v=v.filter(Pl);for(let e=0;e<v.length;e+=1)me(v[e]);me(w),me(k),me(d.$$.fragment,e),me(f),p=!1},d(e){e&&q(t),S(v,e),w&&w.d(),k&&k.d(),ye(d),~m&&C[m].d(),$=!1,y(h)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,t){e[120]&&o.p(e,t)},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Ul(e){let t,n;return t=new hl({props:{classId:e[29],item:e[124],selection:e[124].selection,record:e[4],disabled:e[21],eventId:e[37],toDelete:e[11],currency:e[7],changeValue:e[15]}}),t.$on("task",e[42]),t.$on("notify",e[43]),t.$on("safeReference",e[52]),t.$on("multi",e[44]),t.$on("defPrep",e[51]),t.$on("record",e[53]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[124]),2&n[0]&&(o.selection=e[124].selection),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2048&n[0]&&(o.toDelete=e[11]),128&n[0]&&(o.currency=e[7]),32768&n[0]&&(o.changeValue=e[15]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Zl(e){let t,n,o="list"!==e[124].type&&Ul(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"list"!==e[124].type?o?(o.p(e,n),2&n[0]&&ue(o,1)):(o=Ul(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Kl(e){let t,n,o,r,i,l=e[34]&&e[8]&&0!=e[8]&&Xl(e),s=e[9]&&ts(e),a=e[35]&&e[14]&&0!=e[14]&&os(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=ss(Ql(e,c,t));const u=e=>me(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=L(),s&&s.c(),n=L(),a&&a.c(),o=L();for(let e=0;e<d.length;e+=1)d[e].c();r=F()},m(e,c){l&&l.m(e,c),_(e,t,c),s&&s.m(e,c),_(e,n,c),a&&a.m(e,c),_(e,o,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);_(e,r,c),i=!0},p(e,i){if(e[34]&&e[8]&&0!=e[8]?l?(l.p(e,i),256&i[0]&&ue(l,1)):(l=Xl(e),l.c(),ue(l,1),l.m(t.parentNode,t)):l&&(ce(),me(l,1,1,(()=>{l=null})),de()),e[9]?s?(s.p(e,i),512&i[0]&&ue(s,1)):(s=ts(e),s.c(),ue(s,1),s.m(n.parentNode,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[35]&&e[14]&&0!=e[14]?a?(a.p(e,i),16384&i[0]&&ue(a,1)):(a=os(e),a.c(),ue(a,1),a.m(o.parentNode,o)):a&&(ce(),me(a,1,1,(()=>{a=null})),de()),539177174&i[0]|4210752&i[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=Ql(e,c,t);d[t]?(d[t].p(n,i),ue(d[t],1)):(d[t]=ss(n),d[t].c(),ue(d[t],1),d[t].m(r.parentNode,r))}for(ce(),t=c.length;t<d.length;t+=1)u(t);de()}},i(e){if(!i){ue(l),ue(s),ue(a);for(let e=0;e<c.length;e+=1)ue(d[e]);i=!0}},o(e){me(l),me(s),me(a),d=d.filter(Pl);for(let e=0;e<d.length;e+=1)me(d[e]);i=!1},d(e){l&&l.d(e),e&&q(t),s&&s.d(e),e&&q(n),a&&a.d(e),e&&q(o),S(d,e),e&&q(r)}}}function Xl(e){let t,n;return t=new e[25]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[es]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};384&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function es(e){let t,n,o;function r(t){e[61](t)}let i={item:e[32],disabled:!0,currency:e[7]};return void 0!==e[8]&&(i.value=e[8]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&256&o[0]&&(n=!0,r.value=e[8],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function ts(e){let t,n;return t=new e[25]({props:{name:"Total MWSt "+(e[10]?"("+e[10]+"%)":""),nameClass:"formField_italic",$$slots:{default:[ns]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1024&n[0]&&(o.name="Total MWSt "+(e[10]?"("+e[10]+"%)":"")),640&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ns(e){let t,n,o;function r(t){e[62](t)}let i={item:e[33],disabled:!0,currency:e[7]};return void 0!==e[9]&&(i.value=e[9]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&512&o[0]&&(n=!0,r.value=e[9],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function os(e){let t,n;return t=new e[25]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[rs]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function rs(e){let t,n,o;function r(t){e[63](t)}let i={item:e[36],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function is(e){let t,n;return t=new Zn({props:{classId:e[29],open:!e[2]&&1===e[1].list.length,list:e[121],template:e[16],eventId:e[37],schema:e[121].item,record:e[4],disabled:e[21],currency:e[7]}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};6&n[0]&&(o.open=!e[2]&&1===e[1].list.length),2&n[0]&&(o.list=e[121]),65536&n[0]&&(o.template=e[16]),2&n[0]&&(o.schema=e[121].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),128&n[0]&&(o.currency=e[7]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ls(e){let t,n;return t=new Rl({props:{classId:e[29],open:e[13],list:e[121],template:e[17],eventId:e[37],schema:e[121].item,record:e[4],disabled:e[21],fixed:e[121].fixed,reqQuantity:e[12],currency:e[7],notifyList:e[6]}}),t.$on("save",e[45]),t.$on("record",e[53]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8192&n[0]&&(o.open=e[13]),2&n[0]&&(o.list=e[121]),131072&n[0]&&(o.template=e[17]),2&n[0]&&(o.schema=e[121].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2&n[0]&&(o.fixed=e[121].fixed),4096&n[0]&&(o.reqQuantity=e[12]),128&n[0]&&(o.currency=e[7]),64&n[0]&&(o.notifyList=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ss(e){let t,n,o,r,i,l;t=new e[23]({props:{text:e[121].designation}});const s=[ls,is],a=[];function c(e,t){return"array"===e[121].type?0:1}return o=c(e),r=a[o]=s[o](e),{c(){ge(t.$$.fragment),n=L(),r.c(),i=F()},m(e,r){ve(t,e,r),_(e,n,r),a[o].m(e,r),_(e,i,r),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[121].designation),t.$set(l);let d=o;o=c(e),o===d?a[o].p(e,n):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),r=a[o],r?r.p(e,n):(r=a[o]=s[o](e),r.c()),ue(r,1),r.m(i.parentNode,i))},i(e){l||(ue(t.$$.fragment,e),ue(r),l=!0)},o(e){me(t.$$.fragment,e),me(r),l=!1},d(e){ye(t,e),e&&q(n),a[o].d(e),e&&q(i)}}}function as(e){let t,n,o,r;function i(t){e[64](t)}let l={title:"",round:!0,$$slots:{default:[cs]},$$scope:{ctx:e}};return void 0!==e[20]&&(l.checked=e[20]),n=new e[26]({props:l}),G.push((()=>he(n,"checked",i))),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","askNext"),B(t,"margin-top","1em"),B(t,"margin-left","23em")},m(e,o){_(e,t,o),ve(n,t,null),r=!0},p(e,t){const r={};8&t[4]&&(r.$$scope={dirty:t,ctx:e}),!o&&1048576&t[0]&&(o=!0,r.checked=e[20],ne((()=>o=!1))),n.$set(r)},i(e){r||(ue(n.$$.fragment,e),r=!0)},o(e){me(n.$$.fragment,e),r=!1},d(e){e&&q(t),ye(n)}}}function cs(e){let t;return{c(){t=N("span"),t.textContent="Weiter erfassen",B(t,"margin-left","1em")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ds(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function us(e){let t,n,o,r,i;t=new e[24]({props:{class:"close",disabled:e[21],form:e[29],filled:!0,type:"submit",$$slots:{default:[fs]},$$scope:{ctx:e}}});let l=e[3]&&!e[21]&&ps(e),s=e[18]&&hs(e);return{c(){ge(t.$$.fragment),n=L(),l&&l.c(),o=L(),s&&s.c(),r=F()},m(e,a){ve(t,e,a),_(e,n,a),l&&l.m(e,a),_(e,o,a),s&&s.m(e,a),_(e,r,a),i=!0},p(e,n){const i={};2097152&n[0]&&(i.disabled=e[21]),8&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i),e[3]&&!e[21]?l?(l.p(e,n),2097160&n[0]&&ue(l,1)):(l=ps(e),l.c(),ue(l,1),l.m(o.parentNode,o)):l&&(ce(),me(l,1,1,(()=>{l=null})),de()),e[18]?s?(s.p(e,n),262144&n[0]&&ue(s,1)):(s=hs(e),s.c(),ue(s,1),s.m(r.parentNode,r)):s&&(ce(),me(s,1,1,(()=>{s=null})),de())},i(e){i||(ue(t.$$.fragment,e),ue(l),ue(s),i=!0)},o(e){me(t.$$.fragment,e),me(l),me(s),i=!1},d(e){ye(t,e),e&&q(n),l&&l.d(e),e&&q(o),s&&s.d(e),e&&q(r)}}}function ms(e){let t,n,o,r;t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[bs]},$$scope:{ctx:e}}}),t.$on("click",e[49]);let i=e[19]&&ws(e);return{c(){ge(t.$$.fragment),n=L(),i&&i.c(),o=F()},m(e,l){ve(t,e,l),_(e,n,l),i&&i.m(e,l),_(e,o,l),r=!0},p(e,n){const r={};8&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[19]?i?(i.p(e,n),524288&n[0]&&ue(i,1)):(i=ws(e),i.c(),ue(i,1),i.m(o.parentNode,o)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(t.$$.fragment,e),ue(i),r=!0)},o(e){me(t.$$.fragment,e),me(i),r=!1},d(e){ye(t,e),e&&q(n),i&&i.d(e),e&&q(o)}}}function fs(e){let t;return{c(){t=C("Speichern und schliessen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ps(e){let t,n;return t=new e[24]({props:{form:e[29],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[$s]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function $s(e){let t;return{c(){t=C("Speichern")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function hs(e){let t,n,o,r;t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[gs]},$$scope:{ctx:e}}}),t.$on("click",(function(){b(e[47](e[0]))&&e[47](e[0]).apply(this,arguments)}));let i=e[19]&&vs(e);return{c(){ge(t.$$.fragment),n=L(),i&&i.c(),o=F()},m(e,l){ve(t,e,l),_(e,n,l),i&&i.m(e,l),_(e,o,l),r=!0},p(n,r){e=n;const l={};8&r[4]&&(l.$$scope={dirty:r,ctx:e}),t.$set(l),e[19]?i?(i.p(e,r),524288&r[0]&&ue(i,1)):(i=vs(e),i.c(),ue(i,1),i.m(o.parentNode,o)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(t.$$.fragment,e),ue(i),r=!0)},o(e){me(t.$$.fragment,e),me(i),r=!1},d(e){ye(t,e),e&&q(n),i&&i.d(e),e&&q(o)}}}function gs(e){let t,n,o;return n=new et({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Dokument erstellen",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function vs(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ys]},$$scope:{ctx:e}}}),t.$on("click",(function(){b(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};8&o[4]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ys(e){let t,n,o;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function bs(e){let t,n,o;return n=new et({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Erstellen",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function ws(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ks]},$$scope:{ctx:e}}}),t.$on("click",e[50]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ks(e){let t,n,o;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function xs(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Is(e){let t,n,o,r;Hl.title=t=e[22];let i={ctx:e,current:null,token:null,hasCatch:!1,pending:xs,then:Jl,catch:Gl,value:120,blocks:[,,,]};return fe(e[39](),i),{c(){n=L(),o=F(),i.block.c()},m(e,t){_(e,n,t),_(e,o,t),i.block.m(e,i.anchor=t),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(n,o){e=n,(!r||4194304&o[0])&&t!==(t=e[22])&&(Hl.title=t),pe(i,e,o)},i(e){r||(ue(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}let _s=new Map,qs=new Map,Ss=new Map;const Ns=(e,n)=>{const o=n;return _s.has(o)||_s.set(o,t.getTasksList(n).then((({data:e})=>e))),_s.get(o)},js=(e,n,o)=>qs.get(o)||Ns(e,n).then((n=>n.find((({_id:e})=>e===o))||t.getTaskList(e,o))).then((e=>(qs.set(o,e),e))),Cs=(e,t)=>{Ss.set(e,t)},Ls=e=>Ss.get(e),Fs=(e,n,o=!1)=>!o&&Ss.get(n)||t.getTask(e,n).then((e=>(Ss.set(n,e),e))),Es=(e,n)=>{if(!_s.get(n))return;const o=n;_s.set(o,t.getTasksList(n).then((({data:e})=>e)))};function Ds(e,r,a){let m,f,p,h,g,v,y;k(e,u,(e=>a(74,h=e))),k(e,s,(e=>a(75,g=e))),k(e,o,(e=>a(76,v=e)));const{Divider:b,Button:w,FormField:x,Checkbox:I}=c,{loggedIn:_,currentTasks:q}=d;k(e,_,(e=>a(77,y=e))),k(e,q,(e=>a(73,p=e)));const S=JSON.parse(i.getItem("Locale")),N=H();let j,C,L,F,E,{schema:D}=r,{recID:z}=r,{prevEventID:T=!1}=r,{prev:V=!1}=r,{taskId:A=!1}=r,{description:B=""}=r,{root:O=!1}=r,{readonly:M}=r,{isStandalone:W}=r,Q={},Y={},G="form-"+D.class+Math.floor(9e3*Math.random()+1e3).toString();const J=O?"fEmbedded":"fTask",U=O?"sEmbedded":"sTask";let Z="CHF";let K,X,te=0,ne=0,oe=0,re=0,ie=1,le=!z&&D.list&&1===D.list.length;const se={},ae=D.items.find((e=>"price"===e.name&&!e.properties?.hidden)),ce=D.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),de=D.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),ue=!!ae||!!de,me=D.list?.filter((e=>"array"===e.type))?.length>1||ue,fe=D.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,pe=!!fe,$e=D.list?.filter((e=>"array"===e.type))?.length>1||pe,he={};let ge,ve,ye,be,we=0,ke=0,xe=[],Ie=[],_e=[],qe={},Se=new Map,Ne=D.class,je=D.id,Ce=!1,Le=-1!==window.location.search.indexOf("next=");const Fe=!p?.length||p.find((e=>e===je));["readonly","hidden","required"].map((e=>{D.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");xe.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));D.items.filter((e=>e.selection&&e.constraint)).map((e=>{Ie.push({name:e.name,selection:e.selection,constraint:e.constraint})}));D.items.filter((e=>e.lookup)).forEach((e=>{_e.push({name:e.name,lookup:e.lookup})})),D.items.filter((e=>e.properties?.lookup)).forEach((e=>{_e.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ee=async e=>{if(e?.length)for(const n of e){if(!n.lookup)break;const{name:e}=n;if(Q[e])break;const{domain:o,value:r}=n.lookup;if("user"===o&&r){const n={[r]:y.user},o=await t.getSectionView(e,n);if(o?.length){const[{_id:t}]=o;t&&a(4,Q[e]=t,Q)}}}},De=async e=>{if(!D.input)return;if(!D.input.length)return;if(D.input.length<2)return;const n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const o=e.input.class[1].name,r=e.input.class[1].destination?.split(".")[0];if(!o||!r)return;const i=D.list?.find((e=>e.name===o));if(!i)return;const l=await t.getSchemaByClass(n),s=(await t.getTasks(l.id)).data;if(!s?.length)return;const c=[];for(const e of s){const t={};for(const n of i.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(4,Q[o]=c,Q)},ze=()=>{for(const e of D.items)e.properties?.value?.concatenation&&Te(e)},Te=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 Ae(e.refItemNext));a(4,Q[e.name]=n,Q)},Ve=async e=>{const t=xe.filter((t=>t.refObj===e));if(t?.length){a(15,qe={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:i}=e;if(!n)break;let l,s,c=!o&&Q[n];const d=Q[n];d&&o&&(c=(await Fs(n,d))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==i&&"readonly"!==i||(i="required"===i?i:"disabled",setTimeout((()=>{l=`#${G} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(i,""),s&&!c&&s.removeAttribute(i)}),0)),"hidden"===i&&(l=`#${G} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(15,qe[t]="",qe))}}},Ae=async e=>{const[n,o]=e.offset?.split(",")||[0,0],r=+e.base||0,i=+e.step||1;e.type;const l=e.refItem,s=await t.getLastId(D.class,l);if(!s?.length)return(r+i).toString().padStart(o,"0");const a=s[0][l];return((+a?.substring(n,n+o)||r)+i).toString().padStart(o,"0")},Be=(e,t,n,o=!1)=>{const r=n||t.name,i=r.startsWith("_")?r:r.split("_")[0],l=e.find((e=>e.name===i));let s=t.value;if(!o&&l&&l.properties?.multi&&(s=Q[r]),s&&l&&"dateRange"===l.type){let e=new Date(s);return"Invalid Date"==e?"":(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&&l.type.startsWith("date"))try{return In(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if(l&&"boolean"===l.type&&(s=!!t.checked),l&&"number"===l.type){const e=Number("1.1").toLocaleString(S.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Oe=()=>W?window.close():O?window.singleSpaNavigate("/"):N("back"),Me=async(e,n)=>{if(D.input&&D.input.length>1){if(D.input[0]!==e)return;const{recursive:o}=ye.input.class[1];if(n){const r=await t.getTaskOptions(`${e}:${n}`,je,o);a(4,Q={...Q,...r})}else{const e=D.input.slice(1);for(const t of e)a(4,Q[t]=[],Q)}}},We=()=>{let e=0;if(ae){let t=1;ce&&(t=ie),e=re*t}de&&(e=re);let t=0;for(const e in se)t+=se[e];a(8,te=t+e)},Re=()=>{let e=0;for(const t in he)e+=he[t];a(14,we=e+ +ke)};n.subscribe((async e=>{if(!e)return;if(!z)return;const n=await t.getSchema(e.eventId);if(!n)return;const o=D.list?.find((e=>e.name===n.class));if(!o)return;const r=await t.getTaskById(e.taskId);((e,t,n)=>{if(!_s.get(e))return;const o=t;qs.set(o,n)})(r.event,r.docId,r.data);const i=await t.getTask(n.class,r.docId),l=Q[n.class].filter((e=>e[n.class]==i._id));l?.length&&l.map((e=>{e[n.class]=r.docId})),a(4,Q),a(60,C),a(59,j),a(1,D)})),P((()=>{_s=new Map,qs=new Map,Ss=new Map,Pe()}));const Pe=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(G))&&++n<20;)await e(50);t&&(()=>{if(z)return;const e=new Set;for(const t of xe)e.add(t.refObj||Ne);Array.from(e).forEach((e=>Ve(e)))})(),He()},He=()=>{setTimeout((()=>{Array.from(Se).forEach((([e,t])=>{Q[e]||a(4,Q[e]=t._id,Q)}))}),350)};var Qe;Qe=()=>{z&&function(e,t,n=t){e.set(n)}(u,h={[z]:{record:Q,lists:Y}},h)},R().$$.on_destroy.push(Qe);const Ye=()=>{const e={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,o]=t.name.split("."),r=D.list.find((e=>e.name===n));e[t.name]=Be(r.item,t)}else e[t.name]=Be(D.items,t,t.name.split("_")[0])}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const o=D.items.find((t=>t.name===e));o?.properties?.required&&!n&&(t=!1)})),t&&e},Ge=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,D=e.schema),"recID"in e&&a(2,z=e.recID),"prevEventID"in e&&a(56,T=e.prevEventID),"prev"in e&&a(57,V=e.prev),"taskId"in e&&a(0,A=e.taskId),"description"in e&&a(54,B=e.description),"root"in e&&a(3,O=e.root),"readonly"in e&&a(55,M=e.readonly),"isStandalone"in e&&a(58,W=e.isStandalone)},e.$$.update=()=>{16777216&e.$$.dirty[1]&&a(21,m=M),2&e.$$.dirty[0]|805306368&e.$$.dirty[1]&&C&&j&&D.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const o=j.items.find((t=>t.name===e));if(!o)return;if(t!==o.type)return;const r="_"+e;C[e]?a(4,Q[e]=C[e],Q):a(4,Q[e]="",Q),C[r]&&a(4,Q[r]=C[r],Q),a(13,le=!1)})),8&e.$$.dirty[0]|8388608&e.$$.dirty[1]&&a(22,f=O?B||"enablerr - Form":document.title)},[A,D,z,O,Q,L,E,Z,te,ne,oe,K,X,le,we,qe,ge,ve,Ce,be,Le,m,f,b,w,x,I,_,q,G,J,U,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},me,$e,{name:"weekValue",properties:{decimals:1}},je,Fe,async()=>{a(17,ve=await t.getTemplate(D.class));const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&a(7,Z=n[0].designation)}if(ye=await t.getEvent(je),z||(a(16,ge=ve),Ee(ye.input?.class),ze(),De(ye)),z){if(h&&h[z]){const e=h[z].record;D.items.map((t=>{e[t.name]=Be(D.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(4,Q=e),D.list&&D.list.map((e=>{"array"===e.type&&h[z].lists[e.name]&&a(4,Q[e.name]=h[z].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Be(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]),Q)}))}else a(4,Q=await t.getTask(D.class,z));a(54,B=$(D,Q)),a(18,Ce=!!D.result?.resultDef),a(9,ne=Q._tax?._amount),a(10,oe=100*Q._tax?._rate||"")}if(T){a(55,M=!1),a(59,j=await t.getSchema(T)),"string"==typeof V&&a(60,C=await t.getTask(j.class,V));const e=D.items.find((e=>e.refClass===j.class));a(4,Q[e.name]=C._id,Q)}if($e&&(ke=Q[fe]||0),ye.trigger?.startOn&&!ye.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(55,M=!0),g.role?.length&&D.authorization?.length){const e=D.authorization.some((e=>v?.find((t=>t===e.role&&"edit"===e.activity))));a(55,M||=!e)}if(a(5,L="report"===ye.output.type),a(19,be=!!(await t.getUserSettings()).isAdmin),!be){const e=y.tenants.find((e=>e._id===y.tenant));e&&a(19,be=e.admin?.find((e=>e===y.user)))}return!0},async e=>{z||a(21,m=!0);const n=e.submitter?.className?.includes("close"),o={};if(Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),r=D.list.find((e=>e.name===t));o[e.name]=Be(r.item,e)}else o[e.name]=Be(D.items,e)})),D.list&&D.list.map((e=>{"array"===e.type&&Y[e.name]&&(o[e.name]=Y[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Be(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]))})),o._event=je,o._prevEventId=T,o._taskId=A,F){const e=F.record;for(const t in e)t.includes(".")&&delete e[t];e._event=F.event,e._taskId=F.taskId;const{id:n}=await t.saveData(F.class,e);o[F.class]||(o[F.class]=n)}const{id:r,task:i,tax:s,error:c}=await t.saveData(D.class,o);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(21,m=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(9,ne=s?._amount||0),a(10,oe=100*(s?._rate||0)||""),o._id=r;const d=await t.getTaskList(D.class,r);if(N("choose",{row:d}),n)return Oe();if(!z){if(Le){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${je}/${je}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${je}/${i}/task`)}},()=>!L&&T?window.history.back():Oe(),async({detail:e})=>{const{row:n}=e;let{eventId:o}=e;if((()=>{if(z)for(const e of xe)e.refName||Ve(e.itemName)})(),z)return;if(await(async()=>{const e={...Q};for(const n of D.items)if(n.refItem&&Q[n.refItem]){const o=await t.getTask(n.refItem,Q[n.refItem]);o&&(e[n.name]=o[n.name])}for(const n of D.list||[])if(n.refItem&&Q[n.refItem]){const o=await t.getTask(n.refItem,Q[n.refItem]),r=[];for(const e of o[n.name]){const t={};for(const o of n.item)e[o.name]&&(t[o.name]=e[o.name]);r.push(t)}e[n.name]=r}a(4,Q=e)})(),o||=n._task?.event,(async(e,t)=>{if(!e)return;const n=ye.output.class[0].name,o=_e.filter((e=>e.lookup===n));if(o?.length)for(const e of o){const{lookup:n,name:o}=e;let r="";if(t){let e=await Fs(n,t);e&&e[o]?.length&&(r=e[o][0][o])}a(4,Q[o]=r,Q)}})(o,n._id),o&&D.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const n=await t.getEvent(o);n.output.class[0]?.name===e.properties.lookup&&a(4,Q[e.name]="",Q)})),!n._task)return;const r=n._task.event,i=await t.getEvent(r);if(!ye.output?.class?.length)return;const l=ye.output.class[0]?.item.find((e=>(e.refClass||e.name)===i.output.class[0]?.name));(ye.input?.class?.length&&ye.input.class[0].name===i.output.class[0]?.name||l?.asInput)&&(a(59,j=await t.getSchema(r)),a(56,T=r),a(0,A=n._task._id),a(60,C=A?await t.getTask(j.class,n._task.docId):{}),Me(j.class,n?._task?.docId))},async({detail:e})=>{if(a(6,E=e),"quantity"===e.itemName&&a(12,X=Q.quantity),(async(e,t)=>{const n=Ie.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(11,K=!1);for(const o of n){const{selection:n,constraint:r,name:i}=o;if(t)break;a(4,Q[i]="",Q),e===n&&a(11,K=r);const l=Q[n];if(l&&e===r){let e=await Fs(n,l);const t=Q[r];if(t?.length){const n=t[0].split(", ");e=e[r];let o="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(o=t[i])}));a(4,Q[i]=o,Q)}}}}})(e.itemName,e.oldValue===e.value),Ve(e.itemName),$e&&fe&&(e.itemName===fe&&(ke=+e.value),Re()),ue&&me){if(e.itemName===ae?.name)re=e.value;else if(e.itemName===ce?.name)ie=e.value;else{if(e.itemName!==de?.name)return;re=e.value}We()}},async({detail:e})=>{if(!(D.input?.length&&D.input.length>1))return;if(j?.class!==D.input[0])return;const{value:n,lookup:o,view:r}=e;if(!o)return;const[i]=o.split(":"),l=(await t.getSectionView(i,{[r]:{$in:n}})).map((e=>e._id));for(const e of D.input.slice(1)){a(4,Q[e]=[],Q);const n=await t.getSchemaByClass(e);n.id;let o=await t.getTasks(n.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[i]))),o?.length){const n=o.map((e=>e._id)),r=await t.getSectionView(e,{_id:{$in:n}});for(const t of r)t[e]=t._id;a(4,Q[e]=r,Q)}}},({detail:e})=>{Y[e.listName]=e.value,me&&(se[e.listName]=e.amountValue,We()),$e&&(he[e.listName]=e.weeksValue||0,Re())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const n=await t.getReportDoc(e)||{},{userReportId:o}=n;if(o){const e=624,t=900,n="/viewer/doc/"+"index.html?file="+("/api/userreport/"+o)+"&type=pdf";window.open(n,"",`popup=yes toolbar=no width=${e} height=${t}`)}},e=>async()=>{const e=await t.getDocData(A),n=window.screen.height,o=window.open("","_blank","width=800,height="+n+",location=no");await ee(),o?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(e,null,4)+"</textarea>")},async()=>{const e=Ye();if(!e)return;const n=ye.result?.resultDef[0]?.addToReports;if(n){const o=e[n];if(o){const n={docId:o},r=(await t.getSectionView("_task",n))[0];e._taskId=r._id}}const{reportId:o,type:r}=await t.createReport(je,e);Ge(o),setTimeout(Oe,2e3)},async()=>{const e=Ye();if(!e)return;const n=await t.getReportData(je,e),o=window.screen.height,r=window.open("","_blank","width=800,height="+o+",location=no");await ee(),r?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),r?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(n,null,4)+"</textarea>")},async({detail:{className:e,itemName:n,value:o}})=>{if(Ne!==o)return;if(Se.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===Ne))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&Se.set(e,i[0])},({detail:e})=>{F=e},({detail:e})=>{setTimeout((()=>{a(4,Q[e.itemName]=e.value,Q)}),200)},B,M,T,V,W,j,C,function(e){te=e,a(8,te)},function(e){ne=e,a(9,ne)},function(e){we=e,a(14,we)},function(e){Le=e,a(20,Le)}]}class zs extends we{constructor(e){var t;super(),Hl.getElementById("svelte-9xiaib-style")||((t=N("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}",I(Hl.head,t)),be(this,e,Ds,Is,w,{schema:1,recID:2,prevEventID:56,prev:57,taskId:0,description:54,root:3,readonly:55,isStandalone:58},[-1,-1,-1,-1,-1])}}function Ts(e){let t,n,o;function r(t){e[4](t)}let i={schema:e[5],recID:e[6]};return void 0!==e[0]&&(i.description=e[0]),t=new zs({props:i}),G.push((()=>he(t,"description",r))),t.$on("back",e[2]),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};32&o&&(r.schema=e[5]),64&o&&(r.recID=e[6]),!n&&1&o&&(n=!0,r.description=e[0],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Vs(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[Ts,({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.description=e[0]),353&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function As(e,n,o){let r,{refresh:i}=n;return e.$$set=e=>{"refresh"in e&&o(3,i=e.refresh)},[r,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},i,function(e){r=e,o(0,r)}]}function Bs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os,Ms,Ws=(Os=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return i="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},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==i(e))throw new Error("single-spa-svelte requires a configuration object");var t=o(o({},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 r=Object.keys(l),i=Object.keys(e).reduce((function(t,n){return r.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var r=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=r();t.instance=new e.component(o(o({},i),{},{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)}))}},Os(Ms={exports:{}},Ms.exports),Ms.exports);const Rs=Bs(Ws)({component:class extends we{constructor(e){super(),be(this,e,As,Vs,w,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:Ps,mount:Hs,unmount:Qs}=Rs;e({bootstrap:Ps,mount:Hs,unmount:Qs});e("Form",zs),e("List",xt),e("Template",class extends we{constructor(e){var t;super(),qn.getElementById("svelte-1phofh5-style")||((t=N("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}",I(qn.head,t)),be(this,e,On,An,w,{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,o,r,i,l,s,a,c,d,u;return{setters:[function(e){t=e.Request,n=e.task_notification,o=e.currentRoles,r=e.TextArea,i=e.Storage,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions},function(e){d=e.user},function(e){u=e.taskClipboard}],execute:function(){e("version","0.2.568");const m=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),f=e=>{try{return new Date(e).toLocaleString()}catch{return e}},p=e=>e?"(ja)":"(nein)",$=(e,t)=>{const n={...t};return(e.display?.reduce(((t,o)=>{let[r,i]=o.split(".");if(e.list?.find((({name:e})=>e===r))&&i&&void 0!==n[r]){const e=`${r}_${i}`;n[e]=n[r][i],r=e}return t.find((e=>e===r))||t.push(r),t}),[]).map((e=>"boolean"==typeof n[e]?p(n[e]):m(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&p(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function h(){}function g(e){return e()}function v(){return Object.create(null)}function y(e){e.forEach(g)}function b(e){return"function"==typeof e}function w(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function k(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return h;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function x(e){return null==e?"":e}function I(e,t){e.appendChild(t)}function _(e,t,n){e.insertBefore(t,n||null)}function q(e){e.parentNode.removeChild(e)}function S(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function N(e){return document.createElement(e)}function j(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function C(e){return document.createTextNode(e)}function L(){return C(" ")}function F(){return C("")}function E(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function D(e){return function(t){return t.preventDefault(),e.call(this,t)}}function z(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function T(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function V(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function A(e,t){e.value=null==t?"":t}function B(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function O(e,t,n){e.classList[n?"add":"remove"](t)}let M;function W(e){M=e}function R(){if(!M)throw new Error("Function called outside component initialization");return M}function P(e){R().$$.on_mount.push(e)}function H(){const e=R();return(t,n)=>{const o=e.$$.callbacks[t];if(o){const r=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);o.slice().forEach((t=>{t.call(e,r)}))}}}function Q(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const Y=[],G=[],J=[],U=[],Z=Promise.resolve();let K=!1;function X(){K||(K=!0,Z.then(ie))}function ee(){return X(),Z}function te(e){J.push(e)}function ne(e){U.push(e)}let oe=!1;const re=new Set;function ie(){if(!oe){oe=!0;do{for(let e=0;e<Y.length;e+=1){const t=Y[e];W(t),le(t.$$)}for(W(null),Y.length=0;G.length;)G.pop()();for(let e=0;e<J.length;e+=1){const t=J[e];re.has(t)||(re.add(t),t())}J.length=0}while(Y.length);for(;U.length;)U.pop()();K=!1,oe=!1,re.clear()}}function le(e){if(null!==e.fragment){e.update(),y(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(te)}}const se=new Set;let ae;function ce(){ae={r:0,c:[],p:ae}}function de(){ae.r||y(ae.c),ae=ae.p}function ue(e,t){e&&e.i&&(se.delete(e),e.i(t))}function me(e,t,n,o){if(e&&e.o){if(se.has(e))return;se.add(e),ae&&ae.c.push((()=>{se.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}function fe(e,t){const n=t.token={};function o(e,o,r,i){if(t.token!==n)return;t.resolved=i;let l=t.ctx;void 0!==r&&(l=l.slice(),l[r]=i);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==o&&e&&(ce(),me(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),de())})):t.block.d(1),s.c(),ue(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[o]=s),a&&ie()}if((r=e)&&"object"==typeof r&&"function"==typeof r.then){const n=R();if(e.then((e=>{W(n),o(t.then,1,t.value,e),W(null)}),(e=>{if(W(n),o(t.catch,2,t.error,e),W(null),!t.hasCatch)throw e})),t.current!==t.pending)return o(t.pending,0),!0}else{if(t.current!==t.then)return o(t.then,1,t.value,e),!0;t.resolved=e}var r}function pe(e,t,n){const o=t.slice(),{resolved:r}=e;e.current===e.then&&(o[e.value]=r),e.current===e.catch&&(o[e.error]=r),e.block.p(o,n)}const $e="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function he(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function ge(e){e&&e.c()}function ve(e,t,n,o){const{fragment:r,on_mount:i,on_destroy:l,after_update:s}=e.$$;r&&r.m(t,n),o||te((()=>{const t=i.map(g).filter(b);l?l.push(...t):y(t),e.$$.on_mount=[]})),s.forEach(te)}function ye(e,t){const n=e.$$;null!==n.fragment&&(y(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function be(e,t,n,o,r,i,l=[-1]){const s=M;W(e);const a=e.$$={fragment:null,ctx:null,props:i,update:h,not_equal:r,bound:v(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:v(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return a.ctx&&r(a.ctx[t],a.ctx[t]=i)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](i),c&&function(e,t){-1===e.$$.dirty[0]&&(Y.push(e),X(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,y(a.before_update),a.fragment=!!o&&o(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(q)}else a.fragment&&a.fragment.c();t.intro&&ue(e.$$.fragment),ve(e,t.target,t.anchor,t.customElement),ie()}W(s)}class we{$destroy(){ye(this,1),this.$destroy=h}$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 ke(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("circle"),o=j("polyline"),r=j("line"),T(n,"cx","12"),T(n,"cy","12"),T(n,"r","10"),T(o,"points","8 12 12 16 16 12"),T(r,"x1","12"),T(r,"y1","8"),T(r,"x2","12"),T(r,"y2","16"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-arrow-down-circle "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-arrow-down-circle "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function xe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ie extends we{constructor(e){super(),be(this,e,xe,ke,w,{size:0,strokeWidth:1,class:2})}}function _e(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),T(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),T(o,"points","22 4 12 14.01 9 11.01"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-check-circle "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-check-circle "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function qe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Se extends we{constructor(e){super(),be(this,e,qe,_e,w,{size:0,strokeWidth:1,class:2})}}function Ne(e){let t,n,o;return{c(){t=j("svg"),n=j("path"),T(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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",o="feather feather-command "+e[2])},m(e,o){_(e,t,o),I(t,n)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-command "+e[2])&&T(t,"class",o)},i:h,o:h,d(e){e&&q(t)}}}function je(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ce extends we{constructor(e){super(),be(this,e,je,Ne,w,{size:0,strokeWidth:1,class:2})}}function Le(e){let t,n,o,r;return{c(){t=j("svg"),n=j("polyline"),o=j("path"),T(n,"points","9 10 4 15 9 20"),T(o,"d","M20 4v7a4 4 0 0 1-4 4H4"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-corner-down-left "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-corner-down-left "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Fe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ee extends we{constructor(e){super(),be(this,e,Fe,Le,w,{size:0,strokeWidth:1,class:2})}}function De(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("path"),o=j("line"),r=j("line"),T(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),T(o,"x1","18"),T(o,"y1","9"),T(o,"x2","12"),T(o,"y2","15"),T(r,"x1","12"),T(r,"y1","9"),T(r,"x2","18"),T(r,"y2","15"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-delete "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-delete "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function ze(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Te extends we{constructor(e){super(),be(this,e,ze,De,w,{size:0,strokeWidth:1,class:2})}}function Ve(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),r=j("line"),T(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),T(o,"points","15 3 21 3 21 9"),T(r,"x1","10"),T(r,"y1","14"),T(r,"x2","21"),T(r,"y2","3"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-external-link "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-external-link "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Ae(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Be extends we{constructor(e){super(),be(this,e,Ae,Ve,w,{size:0,strokeWidth:1,class:2})}}function Oe(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("circle"),o=j("line"),r=j("path"),T(n,"cx","12"),T(n,"cy","12"),T(n,"r","10"),T(o,"x1","2"),T(o,"y1","12"),T(o,"x2","22"),T(o,"y2","12"),T(r,"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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-globe "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-globe "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Me(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class We extends we{constructor(e){super(),be(this,e,Me,Oe,w,{size:0,strokeWidth:1,class:2})}}function Re(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("polyline"),T(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"),T(o,"points","22,6 12,13 2,6"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-mail "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-mail "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Pe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class He extends we{constructor(e){super(),be(this,e,Pe,Re,w,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,o,r;return{c(){t=j("svg"),n=j("path"),o=j("circle"),T(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),T(o,"cx","12"),T(o,"cy","10"),T(o,"r","3"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-map-pin "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-map-pin "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function Ye(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ge extends we{constructor(e){super(),be(this,e,Ye,Qe,w,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("polyline"),o=j("line"),r=j("path"),T(n,"points","23 7 23 1 17 1"),T(o,"x1","16"),T(o,"y1","8"),T(o,"x2","23"),T(o,"y2","1"),T(r,"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"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-phone-outgoing "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-phone-outgoing "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Ue(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ze extends we{constructor(e){super(),be(this,e,Ue,Je,w,{size:0,strokeWidth:1,class:2})}}function Ke(e){let t,n,o,r,i;return{c(){t=j("svg"),n=j("polyline"),o=j("path"),r=j("rect"),T(n,"points","6 9 6 2 18 2 18 9"),T(o,"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"),T(r,"x","6"),T(r,"y","14"),T(r,"width","12"),T(r,"height","8"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",i="feather feather-printer "+e[2])},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-printer "+e[2])&&T(t,"class",i)},i:h,o:h,d(e){e&&q(t)}}}function Xe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class et extends we{constructor(e){super(),be(this,e,Xe,Ke,w,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,o,r;return{c(){t=j("svg"),n=j("circle"),o=j("line"),T(n,"cx","11"),T(n,"cy","11"),T(n,"r","8"),T(o,"x1","21"),T(o,"y1","21"),T(o,"x2","16.65"),T(o,"y2","16.65"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"width",e[0]),T(t,"height",e[0]),T(t,"fill","none"),T(t,"viewBox","0 0 24 24"),T(t,"stroke","currentColor"),T(t,"stroke-width",e[1]),T(t,"stroke-linecap","round"),T(t,"stroke-linejoin","round"),T(t,"class",r="feather feather-search "+e[2])},m(e,r){_(e,t,r),I(t,n),I(t,o)},p(e,[n]){1&n&&T(t,"width",e[0]),1&n&&T(t,"height",e[0]),2&n&&T(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-search "+e[2])&&T(t,"class",r)},i:h,o:h,d(e){e&&q(t)}}}function nt(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class ot extends we{constructor(e){super(),be(this,e,nt,tt,w,{size:0,strokeWidth:1,class:2})}}const{document:rt}=$e;function it(e){e[33]=e[35].list,e[34]=e[35].items}function lt(e,t,n){const o=e.slice();return o[36]=t[n],o}function st(e,t,n){const o=e.slice();return o[39]=t[n],o}function at(e,t,n){const o=e.slice();return o[39]=t[n],o}function ct(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function dt(e){let t,n,o,r,i,l;it(e);let s=e[33]?.length&&ut(e),a=e[34]?.length&&mt(e),c=e[33]?.length&&$t(e);return{c(){s&&s.c(),t=L(),n=N("div"),o=N("table"),a&&a.c(),r=L(),i=N("tbody"),c&&c.c(),T(o,"striped",""),T(o,"class","svelte-btngop"),T(n,"class","eList svelte-btngop")},m(e,d){s&&s.m(e,d),_(e,t,d),_(e,n,d),I(n,o),a&&a.m(o,null),I(o,r),I(o,i),c&&c.m(i,null),l=!0},p(e,n){it(e),e[33]?.length?s?(s.p(e,n),4&n[0]&&ue(s,1)):(s=ut(e),s.c(),ue(s,1),s.m(t.parentNode,t)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[34]?.length?a?a.p(e,n):(a=mt(e),a.c(),a.m(o,r)):a&&(a.d(1),a=null),e[33]?.length?c?(c.p(e,n),4&n[0]&&ue(c,1)):(c=$t(e),c.c(),ue(c,1),c.m(i,null)):c&&(ce(),me(c,1,1,(()=>{c=null})),de())},i(e){l||(ue(s),ue(c),l=!0)},o(e){me(s),me(c),l=!1},d(e){s&&s.d(e),e&&q(t),e&&q(n),a&&a.d(),c&&c.d()}}}function ut(e){let t,n,o,r,i,l,s,a,c,d;function u(t){e[25](t)}let m={id:e[8]};return void 0!==e[3]&&(m.value=e[3]),o=new e[6]({props:m}),G.push((()=>he(o,"value",u))),o.$on("input",e[12]),s=new Te({props:{size:"18"}}),{c(){t=N("div"),n=C("Suchen: "),ge(o.$$.fragment),i=L(),l=N("span"),ge(s.$$.fragment),T(l,"class","feather pointer svelte-btngop"),B(t,"margin-bottom","1em"),B(t,"position","relative")},m(r,u){_(r,t,u),I(t,n),ve(o,t,null),I(t,i),I(t,l),ve(s,l,null),a=!0,c||(d=E(l,"click",e[15]),c=!0)},p(e,t){const n={};!r&&8&t[0]&&(r=!0,n.value=e[3],ne((()=>r=!1))),o.$set(n)},i(e){a||(ue(o.$$.fragment,e),ue(s.$$.fragment,e),a=!0)},o(e){me(o.$$.fragment,e),me(s.$$.fragment,e),a=!1},d(e){e&&q(t),ye(o),ye(s),c=!1,d()}}}function mt(e){let t,n,o,r=e[4]&&e[0]&&ft(),i=e[34],l=[];for(let t=0;t<i.length;t+=1)l[t]=pt(at(e,i,t));return{c(){t=N("thead"),n=N("tr"),r&&r.c(),o=L();for(let e=0;e<l.length;e+=1)l[e].c();T(n,"class","svelte-btngop"),T(t,"class","svelte-btngop")},m(e,i){_(e,t,i),I(t,n),r&&r.m(n,null),I(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?r||(r=ft(),r.c(),r.m(n,o)):r&&(r.d(1),r=null),2052&t[0]){let o;for(i=e[34],o=0;o<i.length;o+=1){const r=at(e,i,o);l[o]?l[o].p(r,t):(l[o]=pt(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&q(t),r&&r.d(),S(l,e)}}}function ft(e){let t;return{c(){t=N("th"),T(t,"class","svelte-btngop")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function pt(e){let t,n,o=e[39]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-btngop")},m(e,o){_(e,t,o),I(t,n)},p(e,t){4&t[0]&&o!==(o=e[39]?.designation+"")&&V(n,o)},d(e){e&&q(t)}}}function $t(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=yt(lt(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(28191&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=lt(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=yt(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function ht(e){let t,n,o,r,i=e[4]&&e[0]&&gt(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=vt(st(e,l,t));return{c(){t=N("tr"),i&&i.c(),n=L();for(let e=0;e<s.length;e+=1)s[e].c();o=L(),T(t,"class","pointer svelte-btngop"),O(t,"active",e[36]._id===e[1])},m(e,l){_(e,t,l),i&&i.m(t,null),I(t,n);for(let e=0;e<s.length;e+=1)s[e].m(t,null);I(t,o),r=!0},p(e,r){if(e[4]&&e[0]?i?(i.p(e,r),17&r[0]&&ue(i,1)):(i=gt(e),i.c(),ue(i,1),i.m(t,n)):i&&(ce(),me(i,1,1,(()=>{i=null})),de()),3588&r[0]){let n;for(l=e[34],n=0;n<l.length;n+=1){const i=st(e,l,n);s[n]?s[n].p(i,r):(s[n]=vt(i),s[n].c(),s[n].m(t,o))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}2054&r[0]&&O(t,"active",e[36]._id===e[1])},i(e){r||(ue(i),r=!0)},o(e){me(i),r=!1},d(e){e&&q(t),i&&i.d(),S(s,e)}}}function gt(e){let t,n,o,r,i;return o=new Be({props:{size:"18"}}),{c(){t=N("td"),n=N("a"),ge(o.$$.fragment),T(n,"href",r=e[14](e[36])),T(n,"target","_blank"),T(t,"class","editRow svelte-btngop")},m(e,r){_(e,t,r),I(t,n),ve(o,n,null),i=!0},p(e,t){(!i||4&t[0]&&r!==(r=e[14](e[36])))&&T(n,"href",r)},i(e){i||(ue(o.$$.fragment,e),i=!0)},o(e){me(o.$$.fragment,e),i=!1},d(e){e&&q(t),ye(o)}}}function vt(e){let t,n,o,r,i=e[9](e[36],e[39])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-btngop")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z((function(){b(e[10](e[36]))&&e[10](e[36]).apply(this,arguments)}))),o=!0)},p(t,o){e=t,4&o[0]&&i!==(i=e[9](e[36],e[39])+"")&&V(n,i)},d(e){e&&q(t),o=!1,r()}}}function yt(e){let t,n,o=e[13](e[36],e[34],e[3]),r=o&&ht(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){12&n[0]&&(o=e[13](e[36],e[34],e[3])),o?r?(r.p(e,n),12&n[0]&&ue(r,1)):(r=ht(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function bt(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function wt(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:bt,then:dt,catch:ct,value:35,blocks:[,,,]};return fe(n=e[2]&&e[11](),r),{c(){t=F(),r.block.c()},m(e,n){_(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,4&o[0]&&n!==(n=e[2]&&e[11]())&&fe(n,r)||pe(r,e,o)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),r.block.d(e),r.token=null,r=null}}}function kt(e,o,r){let i;const l=H(),{Loading:s,TextField:a}=c,{currentTasks:u}=d;k(e,u,(e=>r(26,i=e)));let f,{inputList:$}=o,{eventId:h}=o,{prevEventId:g}=o,{className:v}=o,{rowId:y}=o,{filterForReady:b=!1}=o,{refStatus:w}=o,{showEdit:x=!1}=o,{praefix:I=""}=o,{selectionFields:_=!1}=o,{deList:q}=o,S=!0,N="",j=v+Math.floor(9e3*Math.random()+1e3).toString()+"search";const C=(e,t)=>{if(!t)return;let n=e[t.name];if(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"boolean"==typeof n?p(n):m(e[`_${t.name}`]||n||"")},L=t.getSchemaByClass(v),F=async(e,n)=>{if(w)return r(16,w=[].concat(w)),e.filter((e=>!!w.find((t=>e._task.status===t))));if("Information"===n.state.task)return e;if(g){const n=await t.getEvent(g);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===v)return"Information"===n.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},E=async(e,t,n,o)=>{const{value:r,refClass:i}=o,[l,s]=n.split("."),a=r?.get(I),c=a&&await Fs(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let o=e?.find((e=>e._id===n[t]))||{};o={...o};for(const e in o)n[e]&&(o[e]=n[e]);for(const e in n)n[e]&&(o[e]=n[e]);return Cs(i+o._id.toString(),o),o})):e};P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(j)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await L;e.eventId===t.id&&(Es(t.class,e.eventId),r(2,S=!r(2,S=!1)))}));return e.$$set=e=>{"inputList"in e&&r(17,$=e.inputList),"eventId"in e&&r(18,h=e.eventId),"prevEventId"in e&&r(19,g=e.prevEventId),"className"in e&&r(20,v=e.className),"rowId"in e&&r(1,y=e.rowId),"filterForReady"in e&&r(21,b=e.filterForReady),"refStatus"in e&&r(16,w=e.refStatus),"showEdit"in e&&r(0,x=e.showEdit),"praefix"in e&&r(22,I=e.praefix),"selectionFields"in e&&r(23,_=e.selectionFields),"deList"in e&&r(24,q=e.deList)},[x,y,S,N,f,s,a,u,j,C,e=>()=>l("choose",{row:e}),async()=>{const e=await L;let n;r(4,f=(e=>!i?.length||!!i.find((t=>t===e)))(e.id));let o,s=n=$||await Ns(e.class,e.id),a=!1,c="";const d=_&&_?.find((t=>e.class===t.refClass.split(":")[0])),u=d?.value?.get&&d.value.get(I);if(u){const[n,r]=d.refClass.split(":");e.class===n&&(s=await E(s,n,r,d)),a=d.parentClass?.find((e=>"quantity"===e.name)),c=d.className,o=await t.getCountedSection(c,r.split(".")[0],u,n,"quantity")}r(0,x&&=!d),d||!b&&!w||(s=await F(s,e));let m=[],{display:p}=e;return p&&p.length?p.map((t=>{const[n,o]=t.split(".");let r=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));r&&(r={...r},r.name=`${n}_${o}`,s=s.map((e=>(e[n]&&(e[r.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),r||(r=e.items.find((e=>e.name===n))),m.find((e=>e?.name===n))||m.push(r)})):m=e.items,!x&&a?(m=m.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),s=s.map((e=>{const t=o.find((t=>t._id===e._id));return t&&(e.ist=t.quantity.$numberDecimal),e})),o.map((e=>{if(!s.find((t=>t._id===e._id))){const t=n.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,s.push(t)}})),l("init",s)):q&&(s=s.filter((e=>!q.find((t=>t._id===e._id))))),{list:s,items:m}},({detail:{value:e}})=>{r(3,N=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(C(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},e=>`/task/${e._task.event}/${e._task._id}/task?view=standalone`,()=>{r(3,N="")},w,$,h,g,v,b,I,_,q,function(e){N=e,r(3,N)}]}class xt extends we{constructor(e){var t;super(),rt.getElementById("svelte-btngop-style")||((t=N("style")).id="svelte-btngop-style",t.textContent=".feather.svelte-btngop.svelte-btngop{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-btngop.svelte-btngop{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-btngop .editRow.svelte-btngop{width:1em}.eList.svelte-btngop table.svelte-btngop{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-btngop table thead.svelte-btngop{position:sticky;top:0;background:#326173;color:white}.eList.svelte-btngop table thead tr.svelte-btngop{height:2.3em}.eList.svelte-btngop table tbody tr.svelte-btngop{height:2.75em !important}th.svelte-btngop.svelte-btngop,td.svelte-btngop.svelte-btngop{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-btngop.svelte-btngop:hover{background-color:#DAE1E5}tr.active.svelte-btngop.svelte-btngop{color:#326173;background-color:#fcebd5}",I(rt.head,t)),be(this,e,kt,wt,w,{inputList:17,eventId:18,prevEventId:19,className:20,rowId:1,filterForReady:21,refStatus:16,showEdit:0,praefix:22,selectionFields:23,deList:24},[-1,-1])}}function It(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function _t(e){let t,n,o=e[39]&&qt(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[39]?o?(o.p(e,n),8&n[0]&&ue(o,1)):(o=qt(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function qt(e){let t,n;return t=new e[19]({props:{title:e[15]?"Auswahl":e[0],class:"eList "+(e[13]?"form":""),$$slots:{default:[Tt]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};32769&n[0]&&(o.title=e[15]?"Auswahl":e[0]),8192&n[0]&&(o.class="eList "+(e[13]?"form":"")),524286&n[0]|512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function St(e){let t,n;return t=new zs({props:{schema:e[2],recID:e[1],readonly:e[14]}}),t.$on("choose",(function(){b(e[28](e[39]))&&e[28](e[39]).apply(this,arguments)})),t.$on("back",e[25]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};4&o[0]&&(r.schema=e[2]),2&o[0]&&(r.recID=e[1]),16384&o[0]&&(r.readonly=e[14]),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Nt(e){let t,n,o,r,i,l,s;t=new e[20]({props:{text:e[15]?"Zusätzliche Auswahl":""}});const a=[Ct,jt],c=[];function d(e,t){return e[15]?0:1}return o=d(e),r=c[o]=a[o](e),l=new xt({props:{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],showEdit:e[8]}}),l.$on("edit",e[29]),l.$on("choose",e[32]),l.$on("init",e[30]),{c(){ge(t.$$.fragment),n=L(),r.c(),i=L(),ge(l.$$.fragment)},m(e,r){ve(t,e,r),_(e,n,r),c[o].m(e,r),_(e,i,r),ve(l,e,r),s=!0},p(e,n){const s={};32768&n[0]&&(s.text=e[15]?"Zusätzliche Auswahl":""),t.$set(s);let u=o;o=d(e),o===u?c[o].p(e,n):(ce(),me(c[u],1,1,(()=>{c[u]=null})),de(),r=c[o],r?r.p(e,n):(r=c[o]=a[o](e),r.c()),ue(r,1),r.m(i.parentNode,i));const m={};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]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(ue(t.$$.fragment,e),ue(r),ue(l.$$.fragment,e),s=!0)},o(e){me(t.$$.fragment,e),me(r),me(l.$$.fragment,e),s=!1},d(e){ye(t,e),e&&q(n),c[o].d(e),e&&q(i),ye(l,e)}}}function jt(e){let t,n,o,r;n=new e[21]({props:{outline:!0,$$slots:{default:[Lt]},$$scope:{ctx:e}}}),n.$on("click",e[26]);let i=e[23]&&e[10]&&Ft(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),i&&i.c(),T(t,"class","form--buttons svelte-jb5mrh")},m(e,l){_(e,t,l),ve(n,t,null),I(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};512&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[23]&&e[10]?i?(i.p(e,o),1024&o[0]&&ue(i,1)):(i=Ft(e),i.c(),ue(i,1),i.m(t,null)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(n.$$.fragment,e),ue(i),r=!0)},o(e){me(n.$$.fragment,e),me(i),r=!1},d(e){e&&q(t),ye(n),i&&i.d()}}}function Ct(e){let t,n,o,r,i,l,s=e[18]&&Dt(e);return o=new e[21]({props:{outline:!0,$$slots:{default:[zt]},$$scope:{ctx:e}}}),o.$on("click",e[26]),i=new e[20]({props:{text:"Liste aus "+e[12]}}),{c(){s&&s.c(),t=L(),n=N("div"),ge(o.$$.fragment),r=L(),ge(i.$$.fragment),T(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),_(e,t,a),_(e,n,a),ve(o,n,null),_(e,r,a),ve(i,e,a),l=!0},p(e,n){e[18]?s?(s.p(e,n),262144&n[0]&&ue(s,1)):(s=Dt(e),s.c(),ue(s,1),s.m(t.parentNode,t)):s&&(ce(),me(s,1,1,(()=>{s=null})),de());const r={};512&n[1]&&(r.$$scope={dirty:n,ctx:e}),o.$set(r);const l={};4096&n[0]&&(l.text="Liste aus "+e[12]),i.$set(l)},i(e){l||(ue(s),ue(o.$$.fragment,e),ue(i.$$.fragment,e),l=!0)},o(e){me(s),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&q(t),e&&q(n),ye(o),e&&q(r),ye(i,e)}}}function Lt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Ft(e){let t,n;return t=new e[21]({props:{filled:!0,$$slots:{default:[Et]},$$scope:{ctx:e}}}),t.$on("click",e[27]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Et(e){let t;return{c(){t=C("Neu")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Dt(e){let t,n;return t=new hl({props:{item:e[16],record:{_id:"",[e[16].name]:""},noForm:"true",classId:"sel_"+e[16].name,eventId:e[17],required:!1,hidden:!1,readonly:!1,deList:e[18]}}),t.$on("notify",e[31]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};65536&n[0]&&(o.item=e[16]),65536&n[0]&&(o.record={_id:"",[e[16].name]:""}),65536&n[0]&&(o.classId="sel_"+e[16].name),131072&n[0]&&(o.eventId=e[17]),262144&n[0]&&(o.deList=e[18]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function zt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Tt(e){let t,n,o,r;const i=[Nt,St],l=[];function s(e,t){return e[39].length&&!e[13]?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function Vt(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function At(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Vt,then:_t,catch:It,value:39,blocks:[,,,]};return fe(n=e[24](e[3]),r),{c(){t=F(),r.block.c()},m(e,n){_(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,8&o[0]&&n!==(n=e[24](e[3]))&&fe(n,r)||pe(r,e,o)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),r.block.d(e),r.token=null,r=null}}}function Bt(e,n,o){let r;const{Dialog:i,Divider:l,Button:s}=c,a=H(),{currentTasks:u}=d;k(e,u,(e=>o(35,r=e)));let{title:m}=n,{schema:f}=n,{recID:p}=n,{isOpening:$=!0}=n,{filterForReady:h=!1}=n,{refStatus:g}=n,{praefix:v=""}=n,{selectionFields:y=!1}=n,{showEdit:b=!0}=n,{deList:w}=n,{newAllowed:x=!0}=n,{prevEventId:I}=n,_=f.id;f.class;let q,S,N,j,C,L,F,E="",D=!1;m??=f.identity.designation;const z=!r?.length||r.find((e=>e===_));return e.$$set=e=>{"title"in e&&o(0,m=e.title),"schema"in e&&o(2,f=e.schema),"recID"in e&&o(1,p=e.recID),"isOpening"in e&&o(3,$=e.isOpening),"filterForReady"in e&&o(4,h=e.filterForReady),"refStatus"in e&&o(5,g=e.refStatus),"praefix"in e&&o(6,v=e.praefix),"selectionFields"in e&&o(7,y=e.selectionFields),"showEdit"in e&&o(8,b=e.showEdit),"deList"in e&&o(9,w=e.deList),"newAllowed"in e&&o(10,x=e.newAllowed),"prevEventId"in e&&o(11,I=e.prevEventId)},[m,p,f,$,h,g,v,y,b,w,x,I,E,D,q,N,C,L,F,i,l,s,u,z,async e=>{if(!e)return!1;const n=await Ns(f.class,f.id);if(S=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),o(15,N=S?.value?.get&&S.value.get(v)),N){j=S.refClass;const[e,n]=j.split(":"),[r]=n.split(".");o(16,C=S.parentClass.find((t=>t.name===e)));const i=await t.getSchemaByClass(C.refClass);o(17,L=i.id),o(12,E=S.parentClass.find((e=>e.name===r)).designation)}return n},()=>{o(13,D=!1),p||a("back"),b||a("back")},()=>{o(13,D=!1),a("back")},()=>{o(1,p=!1),o(14,q=!1),o(13,D=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,o]=t.split(".");let r=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));if(r){e[`${n}_${o}`]=e[n][o]}})),a("choose",{row:e})},({detail:e})=>{o(14,q=!!e._task.visum||"Closed"===e._task.status),o(1,p=e._docId),o(13,D=!0)},({detail:e})=>{N&&o(18,F=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){Q(e,t)}]}class Ot extends we{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=N("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}",I(document.head,t)),be(this,e,Bt,At,w,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11},[-1,-1])}}const{document:Mt}=$e;function Wt(e){e[27]=e[29].list,e[28]=e[29].items}function Rt(e,t,n){const o=e.slice();return o[30]=t[n],o}function Pt(e,t,n){const o=e.slice();return o[33]=t[n],o}function Ht(e,t,n){const o=e.slice();return o[33]=t[n],o}function Qt(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Yt(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Wt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Gt]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[28]?.length&&function(e){let t,n,o,r,i=e[28],l=[];for(let t=0;t<i.length;t+=1)l[t]=Jt(Ht(e,i,t));return{c(){t=N("thead"),n=N("tr"),o=N("th"),r=L();for(let e=0;e<l.length;e+=1)l[e].c();T(o,"class","svelte-14hcfjl"),T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,i){_(e,t,i),I(t,n),I(n,o),I(n,r);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(i=e[28],o=0;o<i.length;o+=1){const r=Ht(e,i,o);l[o]?l[o].p(r,t):(l[o]=Jt(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&q(t),S(l,e)}}}(e),k=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Kt(Rt(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(44547&n[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const i=Rt(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Kt(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){Wt(e);const o={};128&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[28]?.length&&w.p(e,t),e[27]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),ue(k),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),me(k),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Gt(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jt(e){let t,n,o=e[33]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function Ut(e){let t,n,o,r,i,l,s,a;o=new Be({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=Zt(Pt(e,c,t));return{c(){t=N("tr"),n=N("td"),ge(o.$$.fragment),r=L();for(let e=0;e<d.length;e+=1)d[e].c();i=L(),T(n,"class","editRow svelte-14hcfjl"),T(t,"class","pointer svelte-14hcfjl"),O(t,"active",e[30]._id===e[0])},m(c,u){_(c,t,u),I(t,n),ve(o,n,null),I(t,r);for(let e=0;e<d.length;e+=1)d[e].m(t,null);I(t,i),l=!0,s||(a=E(n,"click",e[15](e[30])),s=!0)},p(n,o){if(e=n,3584&o[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const r=Pt(e,c,n);d[n]?d[n].p(r,o):(d[n]=Zt(r),d[n].c(),d[n].m(t,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&o[0]&&O(t,"active",e[30]._id===e[0])},i(e){l||(ue(o.$$.fragment,e),l=!0)},o(e){me(o.$$.fragment,e),l=!1},d(e){e&&q(t),ye(o),S(d,e),s=!1,a()}}}function Zt(e){let t,n,o,r,i=e[9](e[30],e[33])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[30]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function Kt(e){let t,n,o=e[13](e[30],e[28],e[1]),r=o&&Ut(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){2&n[0]&&(o=e[13](e[30],e[28],e[1])),o?r?(r.p(e,n),2&n[0]&&ue(r,1)):(r=Ut(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function Xt(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function en(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:Xt,then:Yt,catch:Qt,value:29,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function tn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[en]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};3&n[0]|128&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function nn(e,o,r){const i=H(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:f}=o,{classId:$}=o,{className:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,k="",x=$+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?p(n):m(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(h);P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Es(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(16,f=e.item),"classId"in e&&r(17,$=e.classId),"className"in e&&r(18,h=e.className),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(19,v=e.viewName),"viewValue"in e&&r(20,y=e.viewValue),"recordId"in e&&r(21,b=e.recordId),"filter"in e&&r(22,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _;let n=[];if(f.lookup){const e="."+$+"#"+f.lookup,o=document.querySelector(e),r=o?.value||b;if(r){const e=await t.getTask(f.lookup,r);if(e){const o=e[f.name]?.map((e=>e[f.name]));o&&(n=await t.getSectionView(f.name,{_id:{$in:o}},!0))}}}else{const o="."+$+"#"+v.split(":")[0],r=document.querySelector(o);let i={[v]:r?.value||b};if(f.refItem){const e="."+$+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};i={...i,...e}}}catch{}}i[v]&&(n=await t.getSectionView(e.class,i,!0)),w&&(n=n.filter((e=>e._id!=w)))}let o=[],r=e.display;return r&&r.length?r.map((t=>{const[r,i]=t.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,n=n.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e)))),l||(l=e.items.find((e=>e.name===r))),o.find((e=>e?.name===r))||o.push(l)})):o=e.items,{list:n,items:o}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},e=>async()=>{const n=await t.getTaskByDocId(e._id),o=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(o)},f,$,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class on extends we{constructor(e){var t;super(),Mt.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(Mt.head,t)),be(this,e,nn,tn,w,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:rn}=$e;function ln(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function sn(e){let t,n,o=e[51]&&function(e){let t,n,o,i,l,s,a,c,d,u,m,f,p,$,h;n=new r({props:{class:"full-width",id:e[24],value:e[2],rows:"1",required:e[1],disabled:e[3],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}}),n.$on("click",e[28]()),n.$on("onFocus",e[28](e[24]));const g=[cn,an],v=[];function y(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(i=y(e))&&(l=v[i]=g[i](e));let b=(!e[3]||e[14])&&dn(e);function w(t){e[39](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[pn]},$$scope:{ctx:e}};void 0!==e[16]&&(k.open=e[16]);m=new e[23]({props:k}),G.push((()=>he(m,"open",w)));let S=e[17]&&$n(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),l&&l.c(),s=L(),a=N("input"),d=L(),b&&b.c(),u=L(),ge(m.$$.fragment),p=L(),S&&S.c(),$=F(),T(a,"class",c=x(e[7]||e[8])+" svelte-jox15l"),T(a,"id",e[5]),T(a,"name",e[5]),a.value=e[0],a.hidden=!0,B(t,"position","relative")},m(e,r){_(e,t,r),ve(n,t,null),I(t,o),~i&&v[i].m(t,null),I(t,s),I(t,a),I(t,d),b&&b.m(t,null),_(e,u,r),ve(m,e,r),_(e,p,r),S&&S.m(e,r),_(e,$,r),h=!0},p(e,o){const r={};4&o[0]&&(r.value=e[2]),2&o[0]&&(r.required=e[1]),8&o[0]&&(r.disabled=e[3]),n.$set(r);let d=i;i=y(e),i===d?~i&&v[i].p(e,o):(l&&(ce(),me(v[d],1,1,(()=>{v[d]=null})),de()),~i?(l=v[i],l?l.p(e,o):(l=v[i]=g[i](e),l.c()),ue(l,1),l.m(t,s)):l=null),(!h||384&o[0]&&c!==(c=x(e[7]||e[8])+" svelte-jox15l"))&&T(a,"class",c),(!h||32&o[0])&&T(a,"id",e[5]),(!h||32&o[0])&&T(a,"name",e[5]),(!h||1&o[0]&&a.value!==e[0])&&(a.value=e[0]),!e[3]||e[14]?b?(b.p(e,o),16392&o[0]&&ue(b,1)):(b=dn(e),b.c(),ue(b,1),b.m(t,null)):b&&(ce(),me(b,1,1,(()=>{b=null})),de());const u={};3260241&o[0]|2097152&o[1]&&(u.$$scope={dirty:o,ctx:e}),!f&&65536&o[0]&&(f=!0,u.open=e[16],ne((()=>f=!1))),m.$set(u),e[17]?S?(S.p(e,o),131072&o[0]&&ue(S,1)):(S=$n(e),S.c(),ue(S,1),S.m($.parentNode,$)):S&&(ce(),me(S,1,1,(()=>{S=null})),de())},i(e){h||(ue(n.$$.fragment,e),ue(l),ue(b),ue(m.$$.fragment,e),ue(S),h=!0)},o(e){me(n.$$.fragment,e),me(l),me(b),me(m.$$.fragment,e),me(S),h=!1},d(e){e&&q(t),ye(n),~i&&v[i].d(),b&&b.d(),e&&q(u),ye(m,e),e&&q(p),S&&S.d(e),e&&q($)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,t){e[51]&&o.p(e,t)},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function an(e){let t,n,o,r,i;return n=new Be({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[32]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function cn(e){let t,n,o,r,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=[E(t,"click",e[28]()),E(t,"choose",e[29])],r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,y(i)}}}function dn(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 pointer svelte-jox15l")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[31]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function un(e){let t,n,o,r;const i=[fn,mn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function mn(e){let t,n;return t=new Ot({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]}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.title=e[6].designation),1048576&n[0]&&(o.newAllowed=e[20]),512&n[0]&&(o.prevEventId=e[9]),32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),65536&n[0]&&(o.isOpening=e[16]),2097152&n[0]&&(o.filterForReady=e[21]),64&n[0]&&(o.refStatus=e[6].refStatus),4096&n[0]&&(o.selectionFields=e[12]),8192&n[0]&&(o.deList=e[13]),2048&n[0]&&(o.praefix=e[11]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function fn(e){let t,n;return t=new on({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[29]),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.item=e[6]),32768&n[0]&&(o.className=e[15].class),256&n[0]&&(o.classId=e[8]),1&n[0]&&(o.rowId=e[0]),1024&n[0]&&(o.recordId=e[10]),16&n[0]&&(o.viewName=e[4]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function pn(e){let t,n,o=e[16]&&un(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[16]?o?(o.p(e,n),65536&n[0]&&ue(o,1)):(o=un(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function $n(e){let t,n,o;function r(t){e[40](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[gn]},$$scope:{ctx:e}};return void 0!==e[17]&&(i.open=e[17]),t=new e[23]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};294913&o[0]|2097152&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&131072&o[0]&&(n=!0,r.open=e[17],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function hn(e){let t,n;return t=new zs({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[30]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function gn(e){let t,n;return t=new e[22]({props:{title:e[18],$$slots:{default:[hn]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};262144&n[0]&&(o.title=e[18]),32769&n[0]|2097152&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function vn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function yn(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:vn,then:sn,catch:ln,value:51,blocks:[,,,]};return fe(e[27](),o),{c(){t=F(),o.block.c()},m(e,r){_(e,t,r),o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,n=!0},p(t,n){pe(o,e=t,n)},i(e){n||(ue(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){me(o.blocks[e])}n=!1},d(e){e&&q(t),o.block.d(e),o.token=null,o=null}}}function bn(e,n,r){let i,l,s;k(e,o,(e=>r(38,i=e)));const a=H(),{Dialog:u,Modal:m}=c;let{id:f}=n,{item:p}=n,{value:h=""}=n,{desc:g=""}=n,{noForm:v=!1}=n,{classId:y}=n,{eventId:b}=n,{recordId:w}=n,{withRefValue:x=!1}=n,{refValue:I=""}=n,{required:_}=n,{disabled:q}=n,{readonly:S}=n,{praefix:N}=n,{selectionFields:j}=n,{formnovalidate:C}=n,{selection:L}=n,{deList:F}=n,{isTemplate:E}=n;const D="comment_"+f;let z,T,V,A,B,O,M=!1,W=!0,R=!0;S||=w&&p.asInput,q||=S,!L&&p.selection&&1===p.selection.split(":").length&&(L=p.selection);const{currentTasks:P,loggedIn:Q}=d;k(e,P,(e=>r(42,l=e))),k(e,Q,(e=>r(43,s=e)));const Y=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},G=e=>{e&&(r(2,g=$(V,e)),a("setRefDesc",g.split(" •")[0]),a("change",{value:h,description:g}),a("task",{row:e,eventId:V.id}))},J=()=>{r(16,M=!1),r(17,z=!1)};return e.$$set=e=>{"id"in e&&r(5,f=e.id),"item"in e&&r(6,p=e.item),"value"in e&&r(0,h=e.value),"desc"in e&&r(2,g=e.desc),"noForm"in e&&r(7,v=e.noForm),"classId"in e&&r(8,y=e.classId),"eventId"in e&&r(9,b=e.eventId),"recordId"in e&&r(10,w=e.recordId),"withRefValue"in e&&r(33,x=e.withRefValue),"refValue"in e&&r(34,I=e.refValue),"required"in e&&r(1,_=e.required),"disabled"in e&&r(3,q=e.disabled),"readonly"in e&&r(35,S=e.readonly),"praefix"in e&&r(11,N=e.praefix),"selectionFields"in e&&r(12,j=e.selectionFields),"formnovalidate"in e&&r(36,C=e.formnovalidate),"selection"in e&&r(4,L=e.selection),"deList"in e&&r(13,F=e.deList),"isTemplate"in e&&r(14,E=e.isTemplate)},e.$$.update=()=>{if(2&e.$$.dirty[0]|32&e.$$.dirty[1]&&r(1,_=_&&!C),12&e.$$.dirty[1]&&x&&r(0,h=I),32833&e.$$.dirty[0]&&h&&V&&Promise.resolve(js(p.refClass,V.id,h)).then((e=>G(e))),65&e.$$.dirty[0]|192&e.$$.dirty[1]&&h&&A&&p.name===A.input?.at(0)&&A.inputLookup?.length){const{domain:e}=A.inputLookup[0]||{};"user"===e&&(i.some((e=>A.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0))}32769&e.$$.dirty[0]&&!h&&V&&G({})},[h,_,g,q,L,f,p,v,y,b,w,N,j,F,E,V,M,z,T,B,W,R,u,m,D,P,Q,async()=>{try{const e=await t.getEvent(b);if(O="report"===e.output.type,r(21,R=!p.asInput),r(20,W=e.output?.class[0].name!==p.refClass),r(15,V=await t.getSchemaByClass(p.refClass)),Y(V),r(19,B=(e=>!l?.length||!!l.find((t=>t===e)))(V.id)),r(37,A=await t.getSchema(b)),b&&w&&h&&!q&&A.input?.find((e=>e===p.refClass))&&r(3,q=!0),p.properties?.query?.lookup){const{domain:e,value:n}=p.properties.query.lookup;if("user"===e){const e={[n]:s.user},o=await t.getSectionView(p.refClass,e);if(o?.length){const[{_id:e}]=o;e&&(r(34,I=e),r(33,x=!0))}i.some((e=>V.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0)}}return r(18,T=V.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if("BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}r(16,M=!0)},({detail:e})=>{r(0,h=e.row._id),J()},J,()=>{(O||B)&&(r(0,h=r(2,g="")),a("change",{value:h,description:g}),a("task",{row:{_task:{event:V.id,_id:!1}}}))},async()=>{if(!h)return;const e=await js(p.refClass,V.id,h);if(!e._task)return;const t=e._task._id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},x,I,S,C,A,i,function(e){M=e,r(16,M)},function(e){z=e,r(17,z)}]}class wn extends we{constructor(e){var t;super(),rn.getElementById("svelte-jox15l-style")||((t=N("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}",I(rn.head,t)),be(this,e,bn,yn,w,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:33,refValue:34,required:1,disabled:3,readonly:35,praefix:11,selectionFields:12,formnovalidate:36,selection:4,deList:13,isTemplate:14},[-1,-1])}}const kn=/\d+/g,xn=/%[HMSpPdmyY%]/g;function In(e,t,n){const o=Math.floor((new Date).getFullYear()/100);let r=!1;if(""===e)return null;const i=t.split(xn);let l=0,s=0;const a=new Date(0);for(const c of i){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)r=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;r=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{kn.lastIndex=l;const i=kn.exec(e);if(null==i)return n;switch(t[s]){case"H":a.setHours(parseInt(i[0])+12*r);break;case"M":a.setMinutes(i[0]);break;case"S":a.setSeconds(i[0]);break;case"d":a.setDate(i[0]);break;case"m":a.setMonth(i[0]-1);break;case"y":a.setFullYear(100*o+parseInt(i[0]));break;case"Y":a.setFullYear(i[0])}l+=i[0].length}s++}return isNaN(a.valueOf())?n:a}function _n(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:qn}=$e;function Sn(e,t,n){const o=e.slice();return o[17]=t[n],o}function Nn(e,t,n){const o=e.slice();return o[20]=t[n],o}function jn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Cn(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Fn(Nn(e,p,t));const h=e=>me($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&En(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[zn]},$$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:[Tn]},$$scope:{ctx:e}}}),{c(){t=N("form"),n=N("input"),r=L();for(let e=0;e<$.length;e+=1)$[e].c();i=L(),g&&g.c(),l=L(),s=N("div"),ge(a.$$.fragment),c=L(),ge(d.$$.fragment),T(n,"class",x(e[6])+" svelte-1phofh5"),T(n,"name","_id"),T(n,"type","hidden"),n.value=o=e[1]._id||"",T(t,"class","fTask svelte-1phofh5"),T(t,"id",e[6]),T(s,"class","form--buttons svelte-1phofh5")},m(o,p){_(o,t,p),I(t,n),I(t,r);for(let e=0;e<$.length;e+=1)$[e].m(t,null);I(t,i),g&&g.m(t,null),_(o,l,p),_(o,s,p),ve(a,s,null),I(s,c),ve(d,s,null),u=!0,m||(f=[E(t,"keydown",e[8]),E(t,"submit",D(e[10]))],m=!0)},p(e,r){if((!u||2&r&&o!==(o=e[1]._id||""))&&(n.value=o),75&r){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const o=Nn(e,p,n);$[n]?($[n].p(o,r),ue($[n],1)):($[n]=Fn(o),$[n].c(),ue($[n],1),$[n].m(t,i))}for(ce(),n=p.length;n<$.length;n+=1)h(n);de()}e[0].list?g?(g.p(e,r),1&r&&ue(g,1)):(g=En(e),g.c(),ue(g,1),g.m(t,null)):g&&(ce(),me(g,1,1,(()=>{g=null})),de());const l={};8388608&r&&(l.$$scope={dirty:r,ctx:e}),a.$set(l);const s={};4&r&&(s.disabled=e[2]),8388608&r&&(s.$$scope={dirty:r,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)ue($[e]);ue(g),ue(a.$$.fragment,e),ue(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)me($[e]);me(g),me(a.$$.fragment,e),me(d.$$.fragment,e),u=!1},d(e){e&&q(t),S($,e),g&&g.d(),e&&q(l),e&&q(s),ye(a),ye(d),m=!1,y(f)}}}function Ln(e){let t,n;return t=new hl({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.item=e[20]),1&n&&(o.selection=e[20].selection),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),1&n&&(o.eventId=e[0].id),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Fn(e){let t,n,o=Bn(!0,e[20]),r=o&&Ln(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){1&n&&(o=Bn(!0,e[20])),o?r?(r.p(e,n),1&n&&ue(r,1)):(r=Ln(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function En(e){let t,n,o=e[0].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=Dn(Sn(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(75&n){let l;for(o=e[0].list,l=0;l<o.length;l+=1){const i=Sn(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Dn(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Dn(e){let t,n,o,r;return t=new e[4]({props:{text:e[17].designation}}),o=new Zn({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(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment)},m(e,i){ve(t,e,i),_(e,n,i),ve(o,e,i),r=!0},p(e,n){const r={};1&n&&(r.text=e[17].designation),t.$set(r);const i={};1&n&&(i.list=e[17]),1&n&&(i.eventId=e[0].id),1&n&&(i.schema=e[17].item),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),o.$set(i)},i(e){r||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),r=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),r=!1},d(e){ye(t,e),e&&q(n),ye(o,e)}}}function zn(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Tn(e){let t;return{c(){t=C("Speichern")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Vn(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function An(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Vn,then:Cn,catch:jn,value:16,blocks:[,,,]};return fe(e[7](),r),{c(){t=L(),n=N("section"),r.block.c(),qn.title="Vorgaben",T(n,"class","sTask svelte-1phofh5")},m(e,i){_(e,t,i),_(e,n,i),r.block.m(n,r.anchor=null),r.mount=()=>n,r.anchor=null,o=!0},p(t,[n]){pe(r,e=t,n)},i(e){o||(ue(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}o=!1},d(e){e&&q(t),e&&q(n),r.block.d(),r.token=null,r=null}}}const Bn=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function On(e,n,r){let a,d,u;k(e,s,(e=>r(11,d=e))),k(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(i.getItem("Locale"));let{schema:h}=n,{record:g}=n,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const b=()=>window.history.back(),w=(e,t,n=!1)=>{const o=t.id,r=e.find((e=>e.name===o));let i=t.value;if(!n&&r&&r.properties?.multi&&(i=g[o]),i&&r&&r.type.startsWith("date"))try{return In(i,"%d.%m.%Y").toISOString()}catch{return new Date(i).toISOString()}if(r&&"boolean"===r.type&&(i=!!t.checked),r&&"number"===r.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{i=Number(i.replace(e,".")).toString()}catch{}}return i};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 t.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()},b,async e=>{const n={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[o,r]=t.split("."),i=h.list.find((e=>e.name===o));n[t]=w(i.item,e)}else n[t]=w(h.items,e)})),await t.saveTemplate(h.class,n),l.success("Die Vorgaben wurden gespeichert.",2e3),b()}]}const{document:Mn}=$e;function Wn(e,t,n){const o=e.slice();return o[28]=t[n],o}function Rn(e){let t,n;return t=new hl({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),2&n[0]&&(o.item=e[28]),2&n[0]&&(o.listName=e[1].name),8&n[0]&&(o.eventId=e[3]),1&n[0]&&(o.record=e[0]),16&n[0]&&(o.disabled=e[4]),32&n[0]&&(o.required=e[5]),256&n[0]&&(o.currency=e[8]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Pn(e){let t,n,o=Bn(e[7],e[28]),r=o&&Rn(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){130&n[0]&&(o=Bn(e[7],e[28])),o?r?(r.p(e,n),130&n[0]&&ue(r,1)):(r=Rn(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function Hn(e){let t,n,o,r=e[1].item,i=[];for(let t=0;t<r.length;t+=1)i[t]=Pn(Wn(e,r,t));const l=e=>me(i[e],1,1,(()=>{i[e]=null}));return{c(){t=N("div");for(let e=0;e<i.length;e+=1)i[e].c();T(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){_(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,s){if(82367&s[0]){let n;for(r=e[1].item,n=0;n<r.length;n+=1){const o=Wn(e,r,n);i[n]?(i[n].p(o,s),ue(i[n],1)):(i[n]=Pn(o),i[n].c(),ue(i[n],1),i[n].m(t,null))}for(ce(),n=r.length;n<i.length;n+=1)l(n);de()}(!o||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&T(t,"id",n)},i(e){if(!o){for(let e=0;e<r.length;e+=1)ue(i[e]);o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)me(i[e]);o=!1},d(e){e&&q(t),S(i,e)}}}function Qn(e){let t,n,o=e[13](e[9])+"";return{c(){t=N("span"),n=C(o)},m(e,o){_(e,t,o),I(t,n)},p(e,t){512&t[0]&&o!==(o=e[13](e[9])+"")&&V(n,o)},d(e){e&&q(t)}}}function Yn(e){let t,n,o;return n=new e[10]({props:{$$slots:{default:[Qn]},$$scope:{ctx:e}}}),n.$on("click",(function(){b(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","accordion svelte-148ktt9"),T(t,"slot","handle")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(t,o){e=t;const r={};512&o[0]|1&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Gn(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Yn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Hn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.open=e[6]),134218687&n[0]|1&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Jn(e){let t,n,o;return n=new e[11]({props:{$$slots:{default:[Gn]},$$scope:{ctx:e}}}),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","formList")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,t){const o={};1023&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Un(e,n,o){const{Button:r,Accordion:i,AccordionSection:l}=c;let{list:s}=n,{schema:a}=n,{record:d}=n,{classId:u}=n,{eventId:$}=n,{disabled:h}=n,{required:g}=n,{open:v=!1}=n,{template:y={}}=n,{isTemplate:b=!1}=n,{currency:w}=n,{update:k=!1}=n,x=new Map;const I={};let _=d[s.name]||{};d[s.name]=_;const q=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&o(1,s=e.list),"schema"in e&&o(18,a=e.schema),"record"in e&&o(0,d=e.record),"classId"in e&&o(2,u=e.classId),"eventId"in e&&o(3,$=e.eventId),"disabled"in e&&o(4,h=e.disabled),"required"in e&&o(5,g=e.required),"open"in e&&o(6,v=e.open),"template"in e&&o(19,y=e.template),"isTemplate"in e&&o(7,b=e.isTemplate),"currency"in e&&o(8,w=e.currency),"update"in e&&o(20,k=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&k&&d&&o(9,_=d[s.name]||{})},[d,s,u,$,h,g,v,b,w,_,r,i,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?q(t.name):"boolean"===t.type?p(e[t.name]):"date"===t.type?m(e[t.name]):"datetime"===t.type?f(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 r=d[t];o(0,d[t]={...r,[n]:e.value},d),o(9,_=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&o(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,r=document.querySelector(n);ee().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)})).then((()=>r.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:n,value:o}})=>{if(x.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===className+"."+s.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&x.set(e,i[0])},()=>{setTimeout((()=>{Array.from(x).forEach((([e,t])=>{d[s.name][e]||o(0,d[s.name][e]=t._id,d)}))}),500)},a,y,k,function(t){Q(e,t)}]}class Zn extends we{constructor(e){var t;super(),Mn.getElementById("svelte-148ktt9-style")||((t=N("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}}",I(Mn.head,t)),be(this,e,Un,Jn,w,{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:Kn}=$e;function Xn(e){e[0]=e[23].list,e[22]=e[23].items}function eo(e,t,n){const o=e.slice();return o[24]=t[n],o}function to(e,t,n){const o=e.slice();return o[27]=t[n],o}function no(e,t,n){const o=e.slice();return o[27]=t[n],o}function oo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function ro(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}Xn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[io]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[22]?.length&&function(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=lo(no(e,o,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[22],i=0;i<o.length;i+=1){const l=no(e,o,i);r[i]?r[i].p(l,t):(r[i]=lo(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}(e),k=e[0]?.length&&function(e){let t,n=e[0],o=[];for(let t=0;t<n.length;t+=1)o[t]=co(eo(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);_(e,t,n)},p(e,r){if(11778&r[0]){let i;for(n=e[0],i=0;i<n.length;i+=1){const l=eo(e,n,i);o[i]?o[i].p(l,r):(o[i]=co(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){S(o,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){Xn(e);const o={};2&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[22]?.length&&w.p(e,t),e[0]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function io(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function lo(e){let t,n,o=e[27]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function so(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=ao(to(e,o,t));return{c(){t=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=L(),T(t,"class","pointer svelte-14hcfjl")},m(e,o){_(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);I(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[22],l=0;l<o.length;l+=1){const s=to(e,o,l);r[l]?r[l].p(s,i):(r[l]=ao(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}function ao(e){let t,n,o,r,i=e[9](e[24],e[27])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[24]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function co(e){let t,n=e[13](e[24],e[22],e[1]),o=n&&so(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),_(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[24],e[22],e[1])),n?o?o.p(e,r):(o=so(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&q(t)}}}function uo(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function mo(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:uo,then:ro,catch:oo,value:23,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function fo(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[mo]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]|2&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function po(e,n,o){const r=H(),{Dialog:i,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:$}=n,{list:h}=n,g="",v=$+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?p(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(f);P((()=>{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&&o(15,u=e.item),"className"in e&&o(16,f=e.className),"classId"in e&&o(17,$=e.classId),"list"in e&&o(0,h=e.list)},[h,g,r,i,l,s,a,d,v,y,e=>()=>r("choose",{row:e}),async()=>{const e=await b;let t=[],n=e.display;return n&&n.length?n.map((n=>{const[r,i]=n.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,o(0,h=h.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e))))),l||(l=e.items.find((e=>e.name===r))),t.find((e=>e?.name===r))||t.push(l)})):t=e.items,{list:h,items:t}},({detail:{value:e}})=>{o(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(y(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,g="")},u,f,$,()=>r("back"),function(e){g=e,o(1,g)}]}class $o extends we{constructor(e){var t;super(),Kn.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(Kn.head,t)),be(this,e,po,fo,w,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ho}=$e;function go(e,t,n){const o=e.slice();return o[11]=t[n],o}function vo(e,t,n){const o=e.slice();return o[2]=t[n],o}function yo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function bo(e){let t,n,o,r=e[6].items,i=[];for(let t=0;t<r.length;t+=1)i[t]=_o(vo(e,r,t));const l=e=>me(i[e],1,1,(()=>{i[e]=null}));let s=e[6].list&&qo(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=L(),s&&s.c(),n=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);_(e,t,r),s&&s.m(e,r),_(e,n,r),o=!0},p(e,o){if(5161971&o[0]){let n;for(r=e[6].items,n=0;n<r.length;n+=1){const l=vo(e,r,n);i[n]?(i[n].p(l,o),ue(i[n],1)):(i[n]=_o(l),i[n].c(),ue(i[n],1),i[n].m(t.parentNode,t))}for(ce(),n=r.length;n<i.length;n+=1)l(n);de()}e[6].list?s?(s.p(e,o),64&o[0]&&ue(s,1)):(s=qo(e),s.c(),ue(s,1),s.m(n.parentNode,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de())},i(e){if(!o){for(let e=0;e<r.length;e+=1)ue(i[e]);ue(s),o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)me(i[e]);me(s),o=!1},d(e){S(i,e),e&&q(t),s&&s.d(e),e&&q(n)}}}function wo(e){let t,n,o,r;const i=[xo,ko],l=[];function s(e,t){return e[2].name!==e[14]||e[15]?"lookup"!==e[2].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(ce(),me(l[a],1,1,(()=>{l[a]=null})),de()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){~t&&l[t].d(e),e&&q(o)}}}function ko(e){let t,n;return t=new hl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[2].name===e[14]&&e[15]||e[0],eventId:e[4],currency:e[8],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),64&n[0]&&(o.item=e[2]),32&n[0]&&(o.record=e[5]),65&n[0]&&(o.disabled=e[2].name===e[14]&&e[15]||e[0]),16&n[0]&&(o.eventId=e[4]),256&n[0]&&(o.currency=e[8]),512&n[0]&&(o.changeValue=e[9]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function xo(e){let t,n,o,r;n=new hl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[0]||!!e[1],required:!0,eventId:e[4],currency:e[8],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let i=e[1]&&Io(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),i&&i.c(),B(t,"padding-top",".25em"),B(t,"background-color","lightyellow"),B(t,"position","relative")},m(e,l){_(e,t,l),ve(n,t,null),I(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};128&o[0]&&(r.classId=e[7]),64&o[0]&&(r.item=e[2]),32&o[0]&&(r.record=e[5]),3&o[0]&&(r.disabled=e[0]||!!e[1]),16&o[0]&&(r.eventId=e[4]),256&o[0]&&(r.currency=e[8]),512&o[0]&&(r.changeValue=e[9]),n.$set(r),e[1]?i?(i.p(e,o),2&o[0]&&ue(i,1)):(i=Io(e),i.c(),ue(i,1),i.m(t,null)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(n.$$.fragment,e),ue(i),r=!0)},o(e){me(n.$$.fragment,e),me(i),r=!1},d(e){e&&q(t),ye(n),i&&i.d()}}}function Io(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[22]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function _o(e){let t,n,o="list"!==e[2].type&&wo(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"list"!==e[2].type?o?(o.p(e,n),64&n[0]&&ue(o,1)):(o=wo(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function qo(e){let t,n,o=e[6].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=No(go(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(497&n[0]){let l;for(o=e[6].list,l=0;l<o.length;l+=1){const i=go(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=No(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function So(e){let t,n,o,r;return t=new e[12]({props:{text:e[11].designation}}),o=new Zn({props:{classId:e[7],list:e[11],eventId:e[4],schema:e[11].item,record:e[5],disabled:e[0],currency:e[8],update:!0}}),{c(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment)},m(e,i){ve(t,e,i),_(e,n,i),ve(o,e,i),r=!0},p(e,n){const r={};64&n[0]&&(r.text=e[11].designation),t.$set(r);const i={};128&n[0]&&(i.classId=e[7]),64&n[0]&&(i.list=e[11]),16&n[0]&&(i.eventId=e[4]),64&n[0]&&(i.schema=e[11].item),32&n[0]&&(i.record=e[5]),1&n[0]&&(i.disabled=e[0]),256&n[0]&&(i.currency=e[8]),o.$set(i)},i(e){r||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),r=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),r=!1},d(e){ye(t,e),e&&q(n),ye(o,e)}}}function No(e){let t,n,o="array"!==e[11].type&&So(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"array"!==e[11].type?o?(o.p(e,n),64&n[0]&&ue(o,1)):(o=So(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function jo(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Co(e){let t,n;return t=new $o({props:{item:e[2],className:e[3],classId:e[7],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.item=e[2]),8&n[0]&&(o.className=e[3]),128&n[0]&&(o.classId=e[7]),2048&n[0]&&(o.list=e[11]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Lo(e){let t,n,o=e[10]&&Co(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[10]?o?(o.p(e,n),1024&n[0]&&ue(o,1)):(o=Co(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Fo(e){let t,n,o,r,i,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:jo,then:bo,catch:yo,value:52,blocks:[,,,]};function a(t){e[28](t)}fe(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Lo]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),r=new e[13]({props:c}),G.push((()=>he(r,"open",a))),{c(){s.block.c(),t=L(),ge(n.$$.fragment),o=L(),ge(r.$$.fragment)},m(e,i){s.block.m(e,s.anchor=i),s.mount=()=>t.parentNode,s.anchor=t,_(e,t,i),ve(n,e,i),_(e,o,i),ve(r,e,i),l=!0},p(t,n){pe(s,e=t,n);const o={};3212&n[0]|67108864&n[1]&&(o.$$scope={dirty:n,ctx:e}),!i&&1024&n[0]&&(i=!0,o.open=e[10],ne((()=>i=!1))),r.$set(o)},i(e){l||(ue(s.block),ue(n.$$.fragment,e),ue(r.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){me(s.blocks[e])}me(n.$$.fragment,e),me(r.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&q(t),ye(n,e),e&&q(o),ye(r,e)}}}function Eo(e,n,o){const{Divider:r,FormField:i,Modal:l}=c,s=H();let a,d,u,m,f,{required:p}=n,{disabled:$}=n,{readonly:h}=n,{id:g}=n,{item:v}=n,{value:y}=n,{refValue:b}=n,w={},k="CHF",x=[],I=[],_={},q=new Map,S=!1,N="";const j=v.checkOn,C=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");x.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))},F=()=>{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)})}))},E=async e=>{const t=x.filter((t=>t.refObj===e));if(t?.length){o(9,_={});for(const e of t){const{itemName:t,refObj:n,refName:r,op:i}=e;let{action:l}=e;if(!n)break;let s,a,c=!r&&w[n];const u=w[n];u&&r&&(c=(await getTaskFull(n,u))[r]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===i&&(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&&o(9,_[t]="",_))}}};P((()=>{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=>E(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(q).forEach((([e,t])=>{w[e]||o(5,w[e]=t._id,w)}))}),250)},T=async e=>{if(!e.value)return void A();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},r=await t.getSectionView(u,n);r?.length?(o(11,N=r),o(10,S=!0)):(o(1,y=""),o(23,b=""),s("setRefValue",b))},V=()=>{o(10,S=!1)},A=()=>{o(1,y=""),o(23,b=y),o(5,w={}),s("setRefValue",b)};return e.$$set=e=>{"required"in e&&o(24,p=e.required),"disabled"in e&&o(0,$=e.disabled),"readonly"in e&&o(25,h=e.readonly),"id"in e&&o(26,g=e.id),"item"in e&&o(2,v=e.item),"value"in e&&o(1,y=e.value),"refValue"in e&&o(23,b=e.refValue)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&o(0,$=$||h),134217784&e.$$.dirty[0]&&w&&s("safeReference",{record:w,class:u,event:m,taskId:f})},[$,y,v,u,m,w,a,d,k,_,S,N,r,l,j,C,async()=>{try{if(y){const e=await t.getTask(v.refClass,y);delete e._task,o(5,w=e),o(27,f=(await t.getTaskByDocId(e._id))._id)}else o(5,w={})}catch{}const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&o(8,k=n[0].designation)}return o(6,a=await t.getSchemaByClass(v.refClass)),o(7,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),o(3,u=a.class),a.identity.designation,o(4,m=a.id),["readonly","hidden","required"].map(L),F(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(o(5,w[t]=n,w),t===j)return T(e);E(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:n,lookup:r,view:i}=e,[l]=r.split(":"),s=(await t.getSectionView(l,{[i]:{$in:n}})).map((e=>e._id));for(const e of a.input.slice(1)){o(5,w[e]=[],w);const n=await t.getSchemaByClass(e);n.id;let r=await t.getTasks(n.id);if(r=r.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),r?.length){const n=r.map((e=>e._id)),i=await t.getSectionView(e,{_id:{$in:n}});for(const t of i)t[e]=t._id;o(5,w[e]=i,w)}}},async({detail:{className:e,itemName:n,value:o}})=>{if(q.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===u))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&q.set(e,i[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(o(1,y=n[0]._id),o(23,b=y),s("setRefValue",b),o(5,w=n[0])),V()},V,A,b,p,h,g,f,function(e){S=e,o(10,S)}]}class Do extends we{constructor(e){var t;super(),ho.getElementById("svelte-16mo2c-style")||((t=N("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",I(ho.head,t)),be(this,e,Eo,Fo,w,{required:24,disabled:0,readonly:25,id:26,item:2,value:1,refValue:23},[-1,-1])}}function zo(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=N("span"),n=C(e[4]),T(t,"class","item")},m(e,o){_(e,t,o),I(t,n)},p(e,t){16&t&&V(n,e[4])},d(e){e&&q(t)}}}(e);return{c(){n&&n.c(),t=F()},m(e,o){n&&n.m(e,o),_(e,t,o)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&q(t)}}}function To(e){let t,n,o;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:[zo]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=N("div"),ge(n.$$.fragment),B(t,"position","relative"),B(t,"max-width","10em")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,[t]){const o={};6&t&&(o.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),256&t&&(o.value=e[8]),64&t&&(o.pattern=e[6]),128&t&&(o.readonly=e[7]),8&t&&(o.disabled=e[3]),32&t&&(o.required=e[5]),536870928&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Vo(e,t,n){let o;const r=H(),{TextField:l}=c;let{id:s}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t,{formnovalidate:p}=t,{currency:$}=t;const h=JSON.parse(i.getItem("Locale")),g=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),v=Number("1.1").toLocaleString(h.id).substring(1,2),{properties:y={}}=a;let{min:b,max:w,step:k,pattern:x,decimals:I=0,unit:_="",placeholder:q,hint:S,readonly:N,negative:j,required:C=!1}=y;N=!0===N||void 0,x||(x=I?`[0-9]+([${v}][0-9]{1,${I}})?`:"[0-9]*"),j&&(x="-?"+x);return e.$$set=e=>{"id"in e&&n(0,s=e.id),"item"in e&&n(16,a=e.item),"value"in e&&n(17,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled),"formnovalidate"in e&&n(18,p=e.formnovalidate),"currency"in e&&n(4,$=e.currency)},e.$$.update=()=>{262176&e.$$.dirty&&n(5,C=C&&!p),131072&e.$$.dirty&&n(8,o=Number(d.toString().replace(v,".")).toFixed(I).toString().replace(".",v))},[s,u,m,f,$,C,x,N,o,l,h,g,k,q,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{N||Number(d.toString().replace(v,"."))||n(8,o="")},a,d,p]}class Ao extends we{constructor(e){super(),be(this,e,Vo,To,w,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4})}}const{document:Bo}=$e;function Oo(e){e[33]=e[35].list,e[34]=e[35].items}function Mo(e,t,n){const o=e.slice();return o[36]=t[n],o[38]=n,o}function Wo(e,t,n){const o=e.slice();return o[39]=t[n],o[41]=n,o}function Ro(e,t,n){const o=e.slice();return o[39]=t[n],o}function Po(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ho(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Oo(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Qo]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let b=!e[1]&&Yo(e);function w(t){e[31](t)}let k={id:e[11]};void 0!==e[2]&&(k.value=e[2]),s=new e[6]({props:k}),G.push((()=>he(s,"value",w))),s.$on("input",e[14]),u=new Te({props:{size:"18"}});let x=e[34]?.length&&function(e){let t,n,o,r,i=!e[1]&&Jo(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=Uo(Ro(e,l,t));return{c(){t=N("thead"),n=N("tr"),i&&i.c(),o=L();for(let e=0;e<s.length;e+=1)s[e].c();T(n,"class","svelte-1m010ne"),T(t,"class","svelte-1m010ne")},m(e,l){_(e,t,l),I(t,n),i&&i.m(n,null),I(n,o);for(let e=0;e<s.length;e+=1)s[e].m(n,null);r=!0},p(e,t){if(e[1]?i&&(ce(),me(i,1,1,(()=>{i=null})),de()):i?(i.p(e,t),2&t[0]&&ue(i,1)):(i=Jo(e),i.c(),ue(i,1),i.m(n,o)),8192&t[0]){let o;for(l=e[34],o=0;o<l.length;o+=1){const r=Ro(e,l,o);s[o]?s[o].p(r,t):(s[o]=Uo(r),s[o].c(),s[o].m(n,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=l.length}},i(e){r||(ue(i),r=!0)},o(e){me(i),r=!1},d(e){e&&q(t),i&&i.d(),S(s,e)}}}(e),j=e[33]?.length&&function(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=tr(Mo(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(569359&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=Mo(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=tr(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),b&&b.c(),r=L(),i=N("div"),l=C("Suchen: "),ge(s.$$.fragment),c=L(),d=N("span"),ge(u.$$.fragment),m=L(),f=N("div"),p=N("table"),x&&x.c(),$=L(),h=N("tbody"),j&&j.c(),T(t,"class","form--buttons svelte-1m010ne"),T(d,"class","feather pointer svelte-1m010ne"),B(i,"margin-bottom","1em"),B(i,"position","relative"),T(p,"striped",""),T(p,"class","svelte-1m010ne"),T(f,"class","eList svelte-1m010ne")},m(a,w){_(a,t,w),ve(n,t,null),I(t,o),b&&b.m(t,null),_(a,r,w),_(a,i,w),I(i,l),ve(s,i,null),I(i,c),I(i,d),ve(u,d,null),_(a,m,w),_(a,f,w),I(f,p),x&&x.m(p,null),I(p,$),I(p,h),j&&j.m(h,null),g=!0,v||(y=E(d,"click",e[16]),v=!0)},p(e,o){Oo(e);const r={};8192&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[1]?b&&(ce(),me(b,1,1,(()=>{b=null})),de()):b?(b.p(e,o),2&o[0]&&ue(b,1)):(b=Yo(e),b.c(),ue(b,1),b.m(t,null));const i={};!a&&4&o[0]&&(a=!0,i.value=e[2],ne((()=>a=!1))),s.$set(i),e[34]?.length&&x.p(e,o),e[33]?.length&&j.p(e,o)},i(e){g||(ue(n.$$.fragment,e),ue(b),ue(s.$$.fragment,e),ue(u.$$.fragment,e),ue(x),ue(j),g=!0)},o(e){me(n.$$.fragment,e),me(b),me(s.$$.fragment,e),me(u.$$.fragment,e),me(x),me(j),g=!1},d(e){e&&q(t),ye(n),b&&b.d(),e&&q(r),e&&q(i),ye(s),ye(u),e&&q(m),e&&q(f),x&&x.d(),j&&j.d(),v=!1,y()}}}function Qo(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Yo(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Go]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Go(e){let t;return{c(){t=C("Bestätigen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jo(e){let t,n,o,r,i;return n=new Se({props:{size:"20"}}),{c(){t=N("th"),ge(n.$$.fragment),T(t,"class","svelte-1m010ne")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[18](e[33])),r=!0)},p(t,n){e=t},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Uo(e){let t,n,o=e[39]+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-1m010ne")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function Zo(e){let t,n,o,r,i,l,s,a=e[0],c=Xo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=er(Wo(e,d,t));return{c(){t=N("tr"),c.c(),n=L();for(let e=0;e<u.length;e+=1)u[e].c();o=L(),T(t,"style",r=e[1]?"cursor: default;":"cursor: zoom-in;"),T(t,"title","übernimmt den Wert direkt"),T(t,"class","svelte-1m010ne"),O(t,"active",e[0].includes(e[36]))},m(r,a){_(r,t,a),c.m(t,null),I(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);I(t,o),i=!0,l||(s=E(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&w(a,a=e[0])?(ce(),me(c,1,1,h),de(),c=Xo(e),c.c(),ue(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 r=Wo(e,d,n);u[n]?u[n].p(r,s):(u[n]=er(r),u[n].c(),u[n].m(t,o))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!i||2&s[0]&&r!==(r=e[1]?"cursor: default;":"cursor: zoom-in;"))&&T(t,"style",r),8193&s[0]&&O(t,"active",e[0].includes(e[36]))},i(e){i||(ue(c),i=!0)},o(e){me(c),i=!1},d(e){e&&q(t),c.d(e),S(u,e),l=!1,s()}}}function Ko(e){let t,n,o;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=N("td"),ge(n.$$.fragment),T(t,"title","Wählt den Wert aus"),T(t,"class","svelte-1m010ne")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,t){const o={};1&t[0]&&(o.checked=e[0].includes(e[36])),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Xo(e){let t,n,o=!e[1]&&Ko(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){e[1]?o&&(ce(),me(o,1,1,(()=>{o=null})),de()):o?(o.p(e,n),2&n[0]&&ue(o,1)):(o=Ko(e),o.c(),ue(o,1),o.m(t.parentNode,t))},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function er(e){let t,n,o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=N("td"),n=C(o),T(t,"class","svelte-1m010ne")},m(e,o){_(e,t,o),I(t,n)},p(e,t){8&t[0]&&o!==(o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&V(n,o)},d(e){e&&q(t)}}}function tr(e){let t,n,o=e[15](e[36],e[2]),r=o&&Zo(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),_(e,t,o),n=!0},p(e,n){4&n[0]&&(o=e[15](e[36],e[2])),o?r?(r.p(e,n),4&n[0]&&ue(r,1)):(r=Zo(e),r.c(),ue(r,1),r.m(t.parentNode,t)):r&&(ce(),me(r,1,1,(()=>{r=null})),de())},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){r&&r.d(e),e&&q(t)}}}function nr(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function or(e){let t,n,o,r;t=new e[9]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:nr,then:Ho,catch:Po,value:35,blocks:[,,,]};return fe(e[13](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function rr(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[or]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};15&n[0]|8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ir(e,n,o){const r=H(),{Loading:i,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=n,{id:f}=n,{selection:p}=n,{refDoc:$}=n,{tableName:h}=n,{idName:g}=n,{target:v}=n,{view:y}=n,{unique:b}=n,{uniqueView:w}=n,{status:k}=n,{single:x}=n;p||=[];let I="",_=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=[];const S=h+g+v+"checkbox",N=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&o(21,m=e.classId),"id"in e&&o(22,f=e.id),"selection"in e&&o(0,p=e.selection),"refDoc"in e&&o(23,$=e.refDoc),"tableName"in e&&o(24,h=e.tableName),"idName"in e&&o(25,g=e.idName),"target"in e&&o(20,v=e.target),"view"in e&&o(26,y=e.view),"unique"in e&&o(27,b=e.unique),"uniqueView"in e&&o(28,w=e.uniqueView),"status"in e&&o(29,k=e.status),"single"in e&&o(1,x=e.single)},[p,x,I,q,r,i,l,s,a,d,u,_,S,async()=>{let e=[],n=[],r={};if(o(3,q=[]),g)if(y){const n=m.split("-")[1].slice(0,-4),o="input."+m+"[name='_id']",i=document.querySelector(o).value;r={[g]:f},k&&(r.$or=[{status:!0},{[n]:i}]),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const o=e=>(e[n]||"z").toString()+e[v];return N(o(e),o(t))}))}else w?(r={[g]:f,status:!0},Object.entries(w).map((([e,t])=>{t?.length&&(r[e]={$in:t}),n.push(e)})),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})),o(3,q=e.map((e=>{const t=[e[v]];return n.map((n=>t.push(e[n]))),t})))):b?(e=await t.getSection(h,g,f,b),e=e.sort(((e,t)=>N(e,t)))):(e=await t.getSection(h,g,f),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})));else r={},Array.isArray(f)||(r._id=f),e=await t.getSectionView(h,r);const i=await t.getSchemaByClass(h),l=[];if($){const t=e.find((e=>e.type===$));e=t.values,o(20,v="designation")}e.map((e=>{let t=e[v];if(t||h!==v||(o(20,v=i.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=i.items.find((e=>e.name===v))?.designation;return n=n.map((e=>i.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...n]}},({detail:{value:e}})=>{o(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{o(2,I="")},e=>()=>{const t=document.getElementsByName(S),n=[];t.forEach(((t,o)=>{t.checked&&n.push(e[+t.attributes.data.value])})),r("choose",{list:n})},e=>()=>{document.getElementsByName(S).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(x?r("choose",{list:[].concat(e)}):(o(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),r("choose",{list:p})))},v,m,f,$,h,g,y,b,w,k,()=>r("back"),function(e){I=e,o(2,I)}]}class lr extends we{constructor(e){var t;super(),Bo.getElementById("svelte-1m010ne-style")||((t=N("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}",I(Bo.head,t)),be(this,e,ir,rr,w,{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:sr}=$e;function ar(e){let t,n,o,r,i,l=e[7].length+"";return{c(){t=N("span"),n=C("("),o=C(l),r=C(")"),T(t,"class",i=x(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,i){_(e,t,i),I(t,n),I(t,o),I(t,r)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&V(o,l),2&n[0]&&i!==(i=x(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&T(t,"class",i)},d(e){e&&q(t)}}}function cr(e){let t;return{c(){t=N("div"),T(t,"class","load-more-options"),T(t,"slot","load-more-options-message slot")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function dr(e){let t,n,o,r;const i=[fr,mr,ur],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]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(ce(),me(l[a],1,1,(()=>{l[a]=null})),de()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){~t&&l[t].d(e),e&&q(o)}}}function ur(e){let t,n,o,r,i;return n=new Ie({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title","Übernehmen"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[26]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function mr(e){let t,n,o,r,i;return n=new Ce({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title",e[17].title||"Generieren"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[25]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function fr(e){let t,n,o,r,i;return n=new Te({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"title","Löschen"),T(t,"class","feather pointer svelte-1rbaejz")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[27]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function pr(e){let t,n,o;function r(t){e[37](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[$r]},$$scope:{ctx:e}};return void 0!==e[10]&&(i.open=e[10]),t=new e[11]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};53&o[0]|32768&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&1024&o[0]&&(n=!0,r.open=e[10],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function $r(e){let t,n;return t=new lr({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),1&n[0]&&(o.selection=e[0]),16&n[0]&&(o.unique=e[16].unique&&e[4].name),32&n[0]&&(o.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(o.id=e[5][e[21]||e[20]]),16&n[0]&&(o.target=e[4].name),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function hr(e){let t,n,o,r,i,l,s,a,c,d=!e[16].single&&e[7].length&&ar(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:gr,minSearchLength:"3",$$slots:{"load-more-options-message slot":[cr]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),o=new e[12]({props:f}),G.push((()=>he(o,"selection",u))),G.push((()=>he(o,"maxOptions",m))),o.$on("change",e[22]);let p=!e[1]&&dr(e),$=e[10]&&pr(e);return{c(){t=N("div"),d&&d.c(),n=L(),ge(o.$$.fragment),l=L(),p&&p.c(),s=L(),$&&$.c(),a=F(),B(t,"position","relative")},m(e,r){_(e,t,r),d&&d.m(t,null),I(t,n),ve(o,t,null),I(t,l),p&&p.m(t,null),_(e,s,r),$&&$.m(e,r),_(e,a,r),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=ar(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}),!r&&128&l[0]&&(r=!0,s.selection=e[7],ne((()=>r=!1))),!i&&512&l[0]&&(i=!0,s.maxOptions=e[9],ne((()=>i=!1))),o.$set(s),e[1]?p&&(ce(),me(p,1,1,(()=>{p=null})),de()):p?(p.p(e,l),2&l[0]&&ue(p,1)):(p=dr(e),p.c(),ue(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&ue($,1)):($=pr(e),$.c(),ue($,1),$.m(a.parentNode,a)):$&&(ce(),me($,1,1,(()=>{$=null})),de())},i(e){c||(ue(o.$$.fragment,e),ue(p),ue($),c=!0)},o(e){me(o.$$.fragment,e),me(p),me($),c=!1},d(e){e&&q(t),d&&d.d(),ye(o),p&&p.d(),e&&q(s),$&&$.d(e),e&&q(a)}}}async function*gr(e){yield[{name:e}]}function vr(e,n,o){const r=H(),{Modal:i,Autocomplete:l}=c;let{classId:s}=n,{id:a}=n,{item:d}=n,{record:u}=n,{value:m}=n,{noForm:f=!1}=n,{disabled:p}=n,{formnovalidate:$}=n,{numberInput:h}=n,{praefix:g}=n,{toDelete:v}=n,{reqQuantity:y}=n,{notifyList:b}=n;const{properties:w={}}=d;let{placeholder:k,hint:x,readonly:I,required:_=!1,lookup:q="",view:S=!1,multi:N,max:j=1e3,generate:C=!1,status:L=!0,refDoc:F}=w;const[E,D]=q.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(k="");P((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&q&&e.addEventListener("focus",V)}));const V=()=>{if(q){document.getElementById(a).blur();const e=y||j;(N.unique||T.length<e)&&o(10,z=!0)}},A=()=>{o(10,z&&=!1)},B=({detail:e})=>{o(7,T=e.list.map((e=>({name:e})))),r("blur",{value:e.list}),r("multi",{view:N.view,lookup:q,name:d.name,value:e.list}),A()},O=async()=>{const e={[D]:u[D]},n=await t.getSectionView(E,e),o=Array.from({length:n.length},((e,t)=>n[t][d.name]));B({detail:{list:o}})},M=(e=!1)=>{if(p||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;o(9,j=!1!==e?e:y||u[t]||0);const n=T.length!=j,i=document.getElementById(a);i?.classList?.toggle("invalid",n),r("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&o(2,s=e.classId),"id"in e&&o(3,a=e.id),"item"in e&&o(4,d=e.item),"record"in e&&o(5,u=e.record),"value"in e&&o(0,m=e.value),"noForm"in e&&o(28,f=e.noForm),"disabled"in e&&o(1,p=e.disabled),"formnovalidate"in e&&o(29,$=e.formnovalidate),"numberInput"in e&&o(30,h=e.numberInput),"praefix"in e&&o(31,g=e.praefix),"toDelete"in e&&o(32,v=e.toDelete),"reqQuantity"in e&&o(33,y=e.reqQuantity),"notifyList"in e&&o(34,b=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&o(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&o(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&o(7,T=[]),128&e.$$.dirty[0]&&T&&(o(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:o}=e;void 0!==g&&g!==o||t&&t.name===N.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&o(6,_=_&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:n,value:i}=e||{};if(!i)return;if(d.refItem?.split(".")[0]!==n)return;const[l,s]=d.refItem.split("."),a=await t.getTask(l,i);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];r("record",{itemName:"quantity",value:u?.length||0}),o(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(b)},[m,p,s,a,d,u,_,T,k,j,z,i,l,I,q,S,N,C,L,F,E,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),o(7,T=t.map((e=>({name:e.trim()})))),r("blur",{value:T.map((e=>e.name))}),r("multi",{view:N.view,lookup:q,value:T.map((e=>e.name))})},A,B,()=>{const e=u[C.itemQuantity]||y;if(!e)return;const t=C.prefix||"",n=u[C.variable]||"",o=C.len||5,r=Array.from({length:e},((e,r)=>t+n+"-"+r.toString().padStart(o,"0")));B({detail:{list:r}})},async()=>{if(!0===S)return O();const e=y||u[N.maxItem];if(!e)return;const n={[D]:u[D],status:!0},o=[].concat(u[N.view]||[]);o.length&&(n[N.view]={$in:o});const r=await t.getSectionView(E,n),i=Array.from({length:e<r.length?e:r.length},((e,t)=>r[t][d.name]));B({detail:{list:i}})},()=>{B({detail:{list:[]}})},f,$,h,g,v,y,b,function(e){T=e,o(7,T),o(5,u),o(4,d),o(32,v)},function(e){j=e,o(9,j)},function(e){z=e,o(10,z)}]}class yr extends we{constructor(e){var t;super(),sr.getElementById("svelte-1rbaejz-style")||((t=N("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}",I(sr.head,t)),be(this,e,vr,hr,w,{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:br}=$e;function wr(e){e[26]=e[28].list,e[27]=e[28].items}function kr(e,t,n){const o=e.slice();return o[29]=t[n],o}function xr(e,t,n){const o=e.slice();return o[32]=t[n],o}function Ir(e,t,n){const o=e.slice();return o[32]=t[n],o}function _r(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function qr(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}wr(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Sr]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),G.push((()=>he(l,"value",y))),l.$on("input",e[12]),d=new Te({props:{size:"18"}});let w=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Nr(Ir(e,o,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();T(n,"class","svelte-14hcfjl"),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[27],i=0;i<o.length;i+=1){const l=Ir(e,o,i);r[i]?r[i].p(l,t):(r[i]=Nr(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&q(t),S(r,e)}}}(e),k=e[26]?.length&&function(e){let t,n=e[26],o=[];for(let t=0;t<n.length;t+=1)o[t]=Lr(kr(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);_(e,t,n)},p(e,r){if(11779&r[0]){let i;for(n=e[26],i=0;i<n.length;i+=1){const l=kr(e,n,i);o[i]?o[i].p(l,r):(o[i]=Lr(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){S(o,e),e&&q(t)}}}(e);return{c(){t=N("div"),ge(n.$$.fragment),o=L(),r=N("div"),i=C("Suchen: "),ge(l.$$.fragment),a=L(),c=N("span"),ge(d.$$.fragment),u=L(),m=N("div"),f=N("table"),w&&w.c(),p=L(),$=N("tbody"),k&&k.c(),T(t,"class","form--buttons svelte-14hcfjl"),T(c,"class","feather pointer svelte-14hcfjl"),B(r,"margin-bottom","1em"),B(r,"position","relative"),T(f,"striped",""),T(f,"class","svelte-14hcfjl"),T(m,"class","eList svelte-14hcfjl")},m(s,y){_(s,t,y),ve(n,t,null),_(s,o,y),_(s,r,y),I(r,i),ve(l,r,null),I(r,a),I(r,c),ve(d,c,null),_(s,u,y),_(s,m,y),I(m,f),w&&w.m(f,null),I(f,p),I(f,$),k&&k.m($,null),h=!0,g||(v=E(c,"click",e[14]),g=!0)},p(e,t){wr(e);const o={};64&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],ne((()=>s=!1))),l.$set(r),e[27]?.length&&w.p(e,t),e[26]?.length&&k.p(e,t)},i(e){h||(ue(n.$$.fragment,e),ue(l.$$.fragment,e),ue(d.$$.fragment,e),h=!0)},o(e){me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!1},d(e){e&&q(t),ye(n),e&&q(o),e&&q(r),ye(l),ye(d),e&&q(u),e&&q(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Sr(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Nr(e){let t,n,o=e[32]?.designation+"";return{c(){t=N("th"),n=C(o),T(t,"class","svelte-14hcfjl")},m(e,o){_(e,t,o),I(t,n)},p:h,d(e){e&&q(t)}}}function jr(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Cr(xr(e,o,t));return{c(){t=N("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=L(),T(t,"class","pointer svelte-14hcfjl"),O(t,"active",e[29]._id===e[0])},m(e,o){_(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);I(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const s=xr(e,o,l);r[l]?r[l].p(s,i):(r[l]=Cr(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}2049&i[0]&&O(t,"active",e[29]._id===e[0])},d(e){e&&q(t),S(r,e)}}}function Cr(e){let t,n,o,r,i=e[9](e[29],e[32])+"";return{c(){t=N("td"),n=C(i),T(t,"class","svelte-14hcfjl")},m(i,l){_(i,t,l),I(t,n),o||(r=E(t,"click",z(e[10](e[29]))),o=!0)},p(t,n){e=t},d(e){e&&q(t),o=!1,r()}}}function Lr(e){let t,n=e[13](e[29],e[27],e[1]),o=n&&jr(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),_(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[29],e[27],e[1])),n?o?o.p(e,r):(o=jr(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&q(t)}}}function Fr(e){let t,n;return t=new e[5]({}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p:h,i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Er(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:Fr,then:qr,catch:_r,value:28,blocks:[,,,]};return fe(e[11](),i),{c(){ge(t.$$.fragment),n=L(),o=F(),i.block.c()},m(e,l){ve(t,e,l),_(e,n,l),_(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){pe(i,e=t,n)},i(e){r||(ue(t.$$.fragment,e),ue(i.block),r=!0)},o(e){me(t.$$.fragment,e);for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){ye(t,e),e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}function Dr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Er]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};3&n[0]|64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function zr(e,o,r){const i=H(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:f}=o,{className:$}=o,{classId:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,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?p(n):m(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass($);P((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Es(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(15,f=e.item),"className"in e&&r(16,$=e.className),"classId"in e&&r(17,h=e.classId),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(18,v=e.viewName),"viewValue"in e&&r(19,y=e.viewValue),"recordId"in e&&r(20,b=e.recordId),"filter"in e&&r(21,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _,n="."+h+"#"+v;document.querySelector(n);let o={[v]:y},r=[];o[v]&&(r=await t.getSectionView(e.class,o,!0)),w&&(r=r.filter((e=>e._id!=w)));let i=[],l=e.display;return l&&l.length?l.map((t=>{const[n,o]=t.split(".");let l=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));l&&(l={...l},l.name=`${n}_${o}`,r=r.map((e=>(e[n]&&(e[l.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),l||(l=e.items.find((e=>e.name===n))),i.find((e=>e?.name===n))||i.push(l)})):i=e.items,{list:r,items:i}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},f,$,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class Tr extends we{constructor(e){var t;super(),br.getElementById("svelte-14hcfjl-style")||((t=N("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}",I(br.head,t)),be(this,e,zr,Dr,w,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Vr(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ar(e){let t,n,o,r,i;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}),G.push((()=>he(n,"value",l)));let a=!e[6]&&Br(e);return{c(){t=N("div"),ge(n.$$.fragment),r=L(),a&&a.c(),B(t,"position","relative")},m(e,o){_(e,t,o),ve(n,t,null),I(t,r),a&&a.m(t,null),i=!0},p(e,r){const i={};4&r&&(i.id=e[2]),8&r&&(i.name=e[3].name),34&r&&(i.inputClass=e[5]||e[1]),64&r&&(i.disabled=e[6]),128&r&&(i.formnovalidate=e[7]),!o&&1&r&&(o=!0,i.value=e[0],ne((()=>o=!1))),n.$set(i),e[6]?a&&(ce(),me(a,1,1,(()=>{a=null})),de()):a?(a.p(e,r),64&r&&ue(a,1)):(a=Br(e),a.c(),ue(a,1),a.m(t,null))},i(e){i||(ue(n.$$.fragment,e),ue(a),i=!0)},o(e){me(n.$$.fragment,e),me(a),i=!1},d(e){e&&q(t),ye(n),a&&a.d()}}}function Br(e){let t,n,o,r,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-wbrqzu")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[17]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Or(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Mr(e){let t,n,o;function r(t){e[22](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[Wr]},$$scope:{ctx:e}};return void 0!==e[8]&&(i.open=e[8]),t=new e[11]({props:i}),G.push((()=>he(t,"open",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};268435994&o&&(r.$$scope={dirty:o,ctx:e}),!n&&256&o&&(n=!0,r.open=e[8],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Wr(e){let t,n;return t=new Tr({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.item=e[3]),8&n&&(o.className=e[3].refClass),2&n&&(o.classId=e[1]),16&n&&(o.recordId=e[4]._id),512&n&&(o.viewValue=e[9]),16&n&&(o.filter=e[4]._id),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Rr(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Or,then:Ar,catch:Vr,value:27,blocks:[,,,]};fe(e[16](),r);let i=e[8]&&Mr(e);return{c(){r.block.c(),t=L(),i&&i.c(),n=F()},m(e,l){r.block.m(e,r.anchor=l),r.mount=()=>t.parentNode,r.anchor=t,_(e,t,l),i&&i.m(e,l),_(e,n,l),o=!0},p(t,[o]){pe(r,e=t,o),e[8]?i?(i.p(e,o),256&o&&ue(i,1)):(i=Mr(e),i.c(),ue(i,1),i.m(n.parentNode,n)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){o||(ue(r.block),ue(i),o=!0)},o(e){for(let e=0;e<3;e+=1){me(r.blocks[e])}me(i),o=!1},d(e){r.block.d(e),r.token=null,r=null,e&&q(t),i&&i.d(e),e&&q(n)}}}function Pr(e,t,n){const{TextField:o,Modal:r}=c;let{classId:i}=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:b=!1,view:w}=$,k=!1;const x=()=>{n(8,k=!1)};return e.$$set=e=>{"classId"in e&&n(1,i=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,i,l,s,a,u,m,f,k,h,o,r,g,y,b,w,async()=>(n(9,h=a[w.selection]),!0),()=>{n(8,k=!0)},({detail:e})=>{n(0,d=e.row[w.value?w.value:"_id"]),x()},x,p,function(e){d=e,n(0,d)},function(e){k=e,n(8,k)}]}class Hr extends we{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=N("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",I(document.head,t)),be(this,e,Pr,Rr,w,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Qr(e,t,n){const o=e.slice();return o[12]=t[n][0],o[13]=t[n][1],o}function Yr(e){let t;return{c(){t=N("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Gr(e){let t;return{c(){t=N("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function Jr(e){let t,n,o,r,i=e[12]+"";return{c(){t=N("option"),n=C(i),t.__value=o=e[13],t.value=t.__value,t.selected=r=e[0]==e[13]},m(e,o){_(e,t,o),I(t,n)},p(e,l){64&l&&i!==(i=e[12]+"")&&V(n,i),64&l&&o!==(o=e[13])&&(t.__value=o,t.value=t.__value),65&l&&r!==(r=e[0]==e[13])&&(t.selected=r)},d(e){e&&q(t)}}}function Ur(e){let t,n,o,r,i,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Gr:Yr}let o=n(e),r=o(e);return{c(){r.c(),t=F()},m(e,n){r.m(e,n),_(e,t,n)},p(e,i){o!==(o=n(e))&&(r.d(1),r=o(e),r&&(r.c(),r.m(t.parentNode,t)))},d(e){r.d(e),e&&q(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=Jr(Qr(e,s,t));return{c(){t=N("select"),l&&l.c(),n=F();for(let e=0;e<a.length;e+=1)a[e].c();T(t,"class",o=x(e[3]||e[4])+" svelte-5xpzvo"),T(t,"id",e[2]),T(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(o,s){_(o,t,s),l&&l.m(t,null),I(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);r||(i=E(t,"change",e[9]),r=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let o;for(s=e[6],o=0;o<s.length;o+=1){const r=Qr(e,s,o);a[o]?a[o].p(r,n):(a[o]=Jr(r),a[o].c(),a[o].m(t,null))}for(;o<a.length;o+=1)a[o].d(1);a.length=s.length}24&n&&o!==(o=x(e[3]||e[4])+" svelte-5xpzvo")&&T(t,"class",o),4&n&&T(t,"id",e[2]),4&n&&T(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:h,o:h,d(e){e&&q(t),l&&l.d(),S(a,e),r=!1,i()}}}function Zr(e,t,n){const o=H();let{id:r}=t,{item:i}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=i.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,r=e.id),"item"in e&&n(10,i=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,r,s,a,d,u,m,f,e=>o("blur",{value:e.srcElement.value}),i]}class Kr extends we{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=N("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}",I(document.head,t)),be(this,e,Zr,Ur,w,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Xr(e){let t;return{c(){t=C("Stunden")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ei(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Xr]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ti(e){let t;return{c(){t=C("Minuten")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ni(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ti]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function oi(e){let t;return{c(){t=C("Jetzt")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ri(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[oi]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ii(e){let t,n,o,r,i,l,s,a,c;return r=new e[5]({props:{value:e[0],closeOnSelection:!0}}),r.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[ri],"minutes-label":[ni],"hours-label":[ei]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=N("input"),o=L(),ge(r.$$.fragment),i=L(),ge(l.$$.fragment),T(t,"type","string"),T(t,"class",n=e[2]||e[3]),T(t,"id",e[1]),T(t,"name",e[1]),t.hidden=!0},m(n,d){_(n,t,d),A(t,e[0]),_(n,o,d),ve(r,n,d),_(n,i,d),ve(l,n,d),s=!0,a||(c=E(t,"input",e[9]),a=!0)},p(e,[o]){(!s||12&o&&n!==(n=e[2]||e[3]))&&T(t,"class",n),(!s||2&o)&&T(t,"id",e[1]),(!s||2&o)&&T(t,"name",e[1]),1&o&&A(t,e[0]);const i={};1&o&&(i.value=e[0]),r.$set(i);const a={};1&o&&(a.value=e[0]),4096&o&&(a.$$scope={dirty:o,ctx:e}),l.$set(a)},i(e){s||(ue(r.$$.fragment,e),ue(l.$$.fragment,e),s=!0)},o(e){me(r.$$.fragment,e),me(l.$$.fragment,e),s=!1},d(e){e&&q(t),e&&q(o),ye(r,e),e&&q(i),ye(l,e),a=!1,c()}}}function li(e,t,n){const o=H(),{Label:r,DatePicker:i,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>o("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,r,i,l,({detail:e})=>{var t,o;n(0,(t=e.value,o=s,s=null==t||null==o?t:(o.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),o))),m(s)},({detail:e})=>{n(0,s=_n(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class si extends we{constructor(e){super(),be(this,e,li,ii,w,{value:0,id:1,noForm:2,classId:3})}}function ai(e){let t,n,o,r,i,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=N("input"),i=L(),l=N("input"),d=L(),ge(u.$$.fragment),m=C(" /\n"),ge(f.$$.fragment),T(t,"type","string"),T(t,"class",n=e[1]||e[2]),T(t,"id",o=e[0]+"_from"),T(t,"name",r=e[0]+"_from"),t.hidden=!0,T(l,"type","string"),T(l,"class",s=e[1]||e[2]),T(l,"id",a=e[0]+"_to"),T(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,o){_(n,t,o),A(t,e[7]),_(n,i,o),_(n,l,o),A(l,e[8]),_(n,d,o),ve(u,n,o),_(n,m,o),ve(f,n,o),p=!0,$||(h=[E(t,"input",e[13]),E(l,"input",e[14])],$=!0)},p(e,[i]){(!p||6&i&&n!==(n=e[1]||e[2]))&&T(t,"class",n),(!p||1&i&&o!==(o=e[0]+"_from"))&&T(t,"id",o),(!p||1&i&&r!==(r=e[0]+"_from"))&&T(t,"name",r),128&i&&A(t,e[7]),(!p||6&i&&s!==(s=e[1]||e[2]))&&T(l,"class",s),(!p||1&i&&a!==(a=e[0]+"_to"))&&T(l,"id",a),(!p||1&i&&c!==(c=e[0]+"_to"))&&T(l,"name",c),256&i&&A(l,e[8]);const d={};32&i&&(d.format=e[5]),8&i&&(d.required=e[3]),16&i&&(d.disabled=e[4]),128&i&&(d.value=e[7]),u.$set(d);const m={};64&i&&(m.format=e[6]),8&i&&(m.required=e[3]),16&i&&(m.disabled=e[4]),256&i&&(m.value=e[8]),f.$set(m)},i(e){p||(ue(u.$$.fragment,e),ue(f.$$.fragment,e),p=!0)},o(e){me(u.$$.fragment,e),me(f.$$.fragment,e),p=!1},d(e){e&&q(t),e&&q(i),e&&q(l),e&&q(d),ye(u,e),e&&q(m),ye(f,e),$=!1,y(h)}}}function ci(e,t,n){const o=H(),{DatePicker:r}=c;let{value:i}=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=i?.from,$=i?.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,i=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,$,r,({detail:e})=>{n(7,p=_n(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),o("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=_n(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),o("change",{value:$,range:"_to"})},i,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class di extends we{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=N("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",I(document.head,t)),be(this,e,ci,ai,w,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function ui(e){let t,n,o;return n=new e[6]({props:{type:"string",inputClass:e[2]?"":" "+e[3],id:e[0],name:e[0],value:e[1],pattern:mi,placeholder:fi,readonly:e[4],disabled:e[5]}}),n.$on("change",e[7]),{c(){t=N("div"),ge(n.$$.fragment),B(t,"max-width","4em")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p(e,[t]){const o={};12&t&&(o.inputClass=e[2]?"":" "+e[3]),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),2&t&&(o.value=e[1]),16&t&&(o.readonly=e[4]),32&t&&(o.disabled=e[5]),n.$set(o)},i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}const mi="([01][0-9]|2[0-3]):([0-5][0-9])",fi="";function pi(e,t,n){const o=H(),{TextField:r}=c;let{id:i}=t,{item:l}=t,{value:s}=t,{noForm:a=!1}=t,{classId:d}=t,{readonly:u}=t,{disabled:m}=t,{praefix:f}=t;const p=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,i=e.id),"item"in e&&n(8,l=e.item),"value"in e&&n(1,s=e.value),"noForm"in e&&n(2,a=e.noForm),"classId"in e&&n(3,d=e.classId),"readonly"in e&&n(4,u=e.readonly),"disabled"in e&&n(5,m=e.disabled),"praefix"in e&&n(9,f=e.praefix)},[i,s,a,d,u,m,r,({detail:e})=>{o("blur",{value:p(e.value)}),o("checkRange",{idx:f,fieldId:i,value:e.value})},l,f]}class $i extends we{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=N("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",I(document.head,t)),be(this,e,pi,ui,w,{id:0,item:8,value:1,noForm:2,classId:3,readonly:4,disabled:5,praefix:9})}}const{document:hi}=$e;function gi(e,t,n){const o=e.slice();return o[0]=t[n],o}function vi(e,t,n){const o=e.slice();return o[17]=t[n],o[19]=n,o}function yi(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function bi(e){let t,n,o=e[14],r=[];for(let t=0;t<o.length;t+=1)r[t]=ki(gi(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(14&n){let l;for(o=e[14],l=0;l<o.length;l+=1){const i=gi(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=ki(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function wi(e){let t,n,o=(e[0]["_"+e[17]]||e[0][e[17]])+"",r=e[19]&&function(e){let t;return{c(){t=C(", ")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}();return{c(){t=N("span"),r&&r.c(),n=C(o),T(t,"class","lookupValue")},m(e,o){_(e,t,o),r&&r.m(t,null),I(t,n)},p(e,t){2&t&&o!==(o=(e[0]["_"+e[17]]||e[0][e[17]])+"")&&V(n,o)},d(e){e&&q(t),r&&r.d()}}}function ki(e){let t,n,o,r,i,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=wi(vi(e,c,t));return r=new Be({props:{size:"18"}}),{c(){t=N("div");for(let e=0;e<d.length;e+=1)d[e].c();n=L(),o=N("span"),ge(r.$$.fragment),i=L(),T(o,"class","feather pointer svelte-1u646ni"),T(t,"class","lookupItem svelte-1u646ni")},m(c,u){_(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);I(t,n),I(t,o),ve(r,o,null),I(t,i),l=!0,s||(a=E(o,"click",e[3](e[0]._id)),s=!0)},p(o,r){if(e=o,6&r){let o;for(c=e[1],o=0;o<c.length;o+=1){const i=vi(e,c,o);d[o]?d[o].p(i,r):(d[o]=wi(i),d[o].c(),d[o].m(t,n))}for(;o<d.length;o+=1)d[o].d(1);d.length=c.length}},i(e){l||(ue(r.$$.fragment,e),l=!0)},o(e){me(r.$$.fragment,e),l=!1},d(e){e&&q(t),S(d,e),ye(r),s=!1,a()}}}function xi(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Ii(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:xi,then:bi,catch:yi,value:14,blocks:[,,,]};return fe(e[2](),o),{c(){t=N("div"),o.block.c(),T(t,"class","lookup svelte-1u646ni")},m(e,r){_(e,t,r),o.block.m(t,o.anchor=null),o.mount=()=>t,o.anchor=null,n=!0},p(t,[n]){pe(o,e=t,n)},i(e){n||(ue(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){me(o.blocks[e])}n=!1},d(e){e&&q(t),o.block.d(),o.token=null,o=null}}}function _i(e,n,o){let{id:r}=n,{item:i}=n,{praefix:l}=n,{record:s}=n;const{refItem:a,view:c}=i.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ee().then((()=>{const e=document.querySelector("div.form-field."+i.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&o(4,r=e.id),"item"in e&&o(0,i=e.item),"praefix"in e&&o(5,l=e.praefix),"record"in e&&o(6,s=e.record)},[i,d,async()=>{let e=[];if(s._id){const n=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const r={[u]:s[u]||s._id};if(e=await t.getSectionView(f,r,n),!n){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})),o(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const n=await t.getTaskByDocId(e);if(!n)return;const o=n._id,r=`/task/${n.event}/${o}/task?view=standalone`;window.open(r)},r,l,s]}class qi extends we{constructor(e){var t;super(),hi.getElementById("svelte-1u646ni-style")||((t=N("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}",I(hi.head,t)),be(this,e,_i,Ii,w,{id:4,item:0,praefix:5,record:6})}}function Si(e){let t,n,o;return n=new Ge({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ni(e){let t,n,o,r,i;return n=new Ge({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[9]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function ji(e){let t,n,o,r,i,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=[Ni,Si],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Ci(e,n,o){const{TextField:r}=c;let{inputClass:i}=n,{disabled:l}=n,{formnovalidate:s}=n,{readonly:a}=n,{required:d}=n,{id:u}=n,{name:m}=n,{value:f}=n,{record:p}=n,{item:$}=n;return e.$$set=e=>{"inputClass"in e&&o(0,i=e.inputClass),"disabled"in e&&o(1,l=e.disabled),"formnovalidate"in e&&o(2,s=e.formnovalidate),"readonly"in e&&o(3,a=e.readonly),"required"in e&&o(4,d=e.required),"id"in e&&o(5,u=e.id),"name"in e&&o(6,m=e.name),"value"in e&&o(7,f=e.value),"record"in e&&o(10,p=e.record),"item"in e&&o(11,$=e.item)},[i,l,s,a,d,u,m,f,r,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:n,houseNo:o,postcode:r,location:i,country:l}=e,s=[n&&o?n+" "+o:n,r&&i?r+" "+i:r||i||"",l&&(await t.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){Q(e,t)}]}class Li extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Ci,ji,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Fi(e){let t,n,o;return n=new We({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ei(e){let t,n,o,r,i;return n=new We({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[9]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Di(e){let t,n,o,r,i,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=[Ei,Fi],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function zi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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,r=e.inputClass),"disabled"in e&&n(1,i=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)},[r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){Q(e,t)}]}class Ti extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,zi,Di,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Vi(e){let t,n,o;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ai(e){let t,n,o,r,i;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[11]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Bi(e){let t,n,o,r,i,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=[Ai,Vi],a=[];function c(e,t){return e[9]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};4&o&&(l.inputClass=e[2]),1&o&&(l.pattern=e[0]),2&o&&(l.placeholder=e[1]),8&o&&(l.disabled=e[3]),16&o&&(l.formnovalidate=e[4]),32&o&&(l.readonly=e[5]),64&o&&(l.required=e[6]),128&o&&(l.id=e[7]),256&o&&(l.name=e[8]),512&o&&(l.value=e[9]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Oi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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{7,8})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,r=e.inputClass),"disabled"in e&&n(3,i=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,r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){Q(e,t)}]}class Mi extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Oi,Bi,w,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Wi(e){let t,n,o;return n=new He({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather2 svelte-9up2nn")},m(e,r){_(e,t,r),ve(n,t,null),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n)}}}function Ri(e){let t,n,o,r,i;return n=new He({props:{size:"18"}}),{c(){t=N("span"),ge(n.$$.fragment),T(t,"class","feather pointer svelte-9up2nn")},m(l,s){_(l,t,s),ve(n,t,null),o=!0,r||(i=E(t,"click",e[11]),r=!0)},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n),r=!1,i()}}}function Pi(e){let t,n,o,r,i,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=[Ri,Wi],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=N("div"),ge(n.$$.fragment),o=L(),i.c(),B(t,"position","relative")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),256&o&&(l.pattern=e[8]),512&o&&(l.placeholder=e[9]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),ue(i,1),i.m(t,null))},i(e){l||(ue(n.$$.fragment,e),ue(i),l=!0)},o(e){me(n.$$.fragment,e),me(i),l=!1},d(e){e&&q(t),ye(n),a[r].d()}}}function Hi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=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,r=e.inputClass),"disabled"in e&&n(1,i=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)},[r,i,l,s,a,d,u,m,f,p,o,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){Q(e,t)}]}class Qi extends we{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("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}",I(document.head,t)),be(this,e,Hi,Pi,w,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}function Yi(e){let t,n;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+(e[20]?" hidden ":""),name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[ml,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1048578&n[0]&&(o.class=e[1].name+(e[20]?" hidden ":"")),2&n[0]&&(o.name=e[1].designation),2&n[0]&&(o.help=e[1].properties?.hint),57671679&n[0]|33554432&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Gi(e){let t,n,o,r,i,l;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+" hidden",name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[fl]},$$scope:{ctx:e}}}),o=new e[30]({props:{text:e[25]}}),i=new Do({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[1],value:e[24]()}}),i.$on("setRefValue",e[40]),i.$on("safeReference",e[44]),{c(){ge(t.$$.fragment),n=L(),ge(o.$$.fragment),r=L(),ge(i.$$.fragment)},m(e,s){ve(t,e,s),_(e,n,s),ve(o,e,s),_(e,r,s),ve(i,e,s),l=!0},p(e,n){const r={};2&n[0]&&(r.class=e[1].name+" hidden"),2&n[0]&&(r.name=e[1].designation),2&n[0]&&(r.help=e[1].properties?.hint),25166210&n[0]|33554432&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};33554432&n[0]&&(l.text=e[25]),o.$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]),2&n[0]&&(s.item=e[1]),16777216&n[0]&&(s.value=e[24]()),i.$set(s)},i(e){l||(ue(t.$$.fragment,e),ue(o.$$.fragment,e),ue(i.$$.fragment,e),l=!0)},o(e){me(t.$$.fragment,e),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!1},d(e){ye(t,e),e&&q(n),ye(o,e),e&&q(r),ye(i,e)}}}function Ji(e){let t,n;return t=new e[27]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[21],required:!0===e[4],placeholder:e[22],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2097152&n[0]&&(o.pattern=e[21]),16&n[0]&&(o.required=!0===e[4]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Ui(e){let t,n;return t=new Mi({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[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Zi(e){let t,n;return t=new Ti({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[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Ki(e){let t,n;return t=new Qi({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[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Xi(e){let t,n;return t=new $i({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[1],value:e[24](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[49]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function el(e){let t,n;return t=new qi({props:{id:e[32],item:e[1],praefix:e[5],record:e[0]}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[1]),32&n[0]&&(o.praefix=e[5]),1&n[0]&&(o.record=e[0]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function tl(e){let t,n;return t=new Li({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[24](),record:e[0],item:e[1]}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),1&n[0]&&(o.record=e[0]),2&n[0]&&(o.item=e[1]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function nl(e){let t,n;return t=new si({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ol(e){let t,n;return t=new di({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function rl(e){let t,n;return t=new e[28]({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function il(e){let t,n;return t=new e[29]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[24]()}}),t.$on("change",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),524296&n[0]&&(o.disabled=e[3]||e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.checked=e[24]()),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ll(e){let t,n;return t=new Hr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],view:e[1].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[48]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.view=e[1].properties.view),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function sl(e){let t,n;return t=new yr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],multi:e[1].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[47]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.multi=e[1].properties.multi),4096&n[0]&&(o.numberInput=e[12]),32&n[0]&&(o.praefix=e[5]),32768&n[0]&&(o.toDelete=e[15]),65536&n[0]&&(o.reqQuantity=e[16]),262144&n[0]&&(o.notifyList=e[18]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function al(e){let t,n;return t=new Ao({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[1],currency:e[17],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),16&n[0]&&(o.required=e[4]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),131072&n[0]&&(o.currency=e[17]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function cl(e){let t,n;return t=new Kr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function dl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[1].name,value:e[24](),noForm:e[6],placeholder:e[1].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.name=e[1].name),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.placeholder=e[1].properties?.placeholder),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ul(e){let t,n;return t=new wn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[1],desc:e[25],value:e[24](),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[45]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[46]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),33554432&n[0]&&(o.desc=e[25]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),32&n[0]&&(o.praefix=e[5]),512&n[0]&&(o.selectionFields=e[9]),2048&n[0]&&(o.selection=e[11]),8192&n[0]&&(o.deList=e[13]),4&n[0]&&(o.recordId=e[2]),16384&n[0]&&(o.isTemplate=e[14]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ml(e){let t,n,o,r;const i=[ul,dl,cl,al,sl,ll,il,rl,ol,nl,tl,el,Xi,Ki,Zi,Ui,Ji],l=[];function s(e,t){return"object"===e[1].type?0:"textarea"===e[1].type||e[1].properties&&"textarea"===e[1].properties.format?1:e[1].properties&&(e[1].properties.enum||e[1].properties.regulation)?2:"number"===e[1].type?3:e[1].properties&&e[1].properties.multi?4:e[1].properties&&e[1].properties.view&&"lookup"===!e[1].properties.format?5:"boolean"===e[1].type?6:"date"===e[1].type?7:"dateRange"===e[1].type?8:"datetime"===e[1].type?9:"map"===e[1].properties?.format?10:"lookup"===e[1].properties?.format?11:"time"===e[1].properties?.format?12:"email"===e[1].type||"email"===e[1].properties?.format?13:"url"===e[1].properties?.format?14:"tel"===e[1].properties?.format?15:16}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function fl(e){let t,n;return t=new wn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[1],value:e[24](),withRefValue:!0,refValue:e[23]}}),t.$on("setRefDesc",e[41]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),8388608&n[0]&&(o.refValue=e[23]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function pl(e){let t,n,o,r;const i=[Gi,Yi],l=[];function s(e,t){return e[5]||"reference"!==e[1].saveAs||"object"!==e[1].type?1:0}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),_(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(ce(),me(l[a],1,1,(()=>{l[a]=null})),de(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),ue(n,1),n.m(o.parentNode,o))},i(e){r||(ue(n),r=!0)},o(e){me(n),r=!1},d(e){l[t].d(e),e&&q(o)}}}function $l(e,t,n){let o,r,i;const l=H(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:f,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:b=!1}=t,{classId:w}=t,{eventId:k}=t,{disabled:x}=t,{selectionFields:I}=t,{formnovalidate:_}=t,{selection:q=!1}=t,{notifyList:S}=t,{numberInput:N}=t,{deList:j}=t,{required:C}=t,{isTemplate:L}=t,{toDelete:F}=t,{reqQuantity:E}=t,{currency:D}=t,{changeValue:z}=t;y||=v._id;let{required:T,readonly:V,hidden:A,pattern:B,placeholder:O}=h.properties||{};if("tel"===h.properties?.format&&(B||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",O||="+41 58 234 56 78"),A=!0===A,void 0!==V&&(V=!0===V),void 0===C&&(C=T),x=x||!!V,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const M=(g?g+".":"")+h.name,W=M+(""!==$?"-"+$:""),R=(e,t=M)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let P=R(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(1,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(0,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,b=e.noForm),"classId"in e&&n(7,w=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,_=e.formnovalidate),"selection"in e&&n(11,q=e.selection),"notifyList"in e&&n(18,S=e.notifyList),"numberInput"in e&&n(12,N=e.numberInput),"deList"in e&&n(13,j=e.deList),"required"in e&&n(4,C=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,F=e.toDelete),"reqQuantity"in e&&n(16,E=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue)},e.$$.update=()=>{if(4096&e.$$.dirty[1])for(const e in z)e===M&&n(0,v[M]=z[e],v);1&e.$$.dirty[0]&&n(24,o=(e=M)=>{let t=R(v);return void 0===t?"":t}),1&e.$$.dirty[0]&&(i=R(v))},n(25,r=((e=M)=>{let t=v["_"+e];return t=m(t),void 0===t?"":t})()),[v,h,y,x,C,$,b,w,k,I,_,q,N,j,L,F,E,D,S,V,A,B,O,P,o,r,s,a,d,f,p,M,W,(e=M)=>{let t=R(v);return t?new Date(t):new Date},(e=M)=>{const t=R(v,e+"_from"),n=R(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:o,checked:r,range:s}=t;void 0!==r&&(o=r);const a=M+(s||"");n(0,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("%%","%")}(o,"%d.%m.%Y"):o,v);const c=Object.values(v).every((e=>!e))&&o;l("notify",{oldValue:i,value:o,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,A=!0),()=>"object"===h.type?"comment_"+W:W,({detail:e})=>{n(23,P=e)},({detail:e})=>{const{designation:t}=h;n(25,r=t+": "+(e||"(Neu)"))},g,z,function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)},function(t){Q(e,t)}]}class hl extends we{constructor(e){var t;super(),document.getElementById("svelte-mea5fj-style")||((t=N("style")).id="svelte-mea5fj-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.form-field div.field > label.checkbox{padding-top:0.5em}",I(document.head,t)),be(this,e,$l,pl,w,{praefix:5,item:1,listName:42,record:0,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},[-1,-1])}}const{document:gl}=$e;function vl(e,t,n){const o=e.slice();return o[83]=t[n],o[85]=n,o}function yl(e,t,n){const o=e.slice();return o[92]=t[n],o}function bl(e,t,n){const o=e.slice();return o[87]=t[n].title,o[88]=t[n].toDelete,o[89]=t[n].icon,o}function wl(e){let t,n;return t=new e[18]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[kl]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2048&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function kl(e){let t,n,o;function r(t){e[46](t)}let i={item:e[28],disabled:!0};return void 0!==e[11]&&(i.value=e[11]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&2048&o[0]&&(n=!0,r.value=e[11],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function xl(e){let t,n;return t=new e[18]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[Il]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Il(e){let t,n,o;function r(t){e[47](t)}let i={item:e[26],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function _l(e){let t,n;return t=new e[18]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[ql]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1152&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ql(e){let t,n,o;function r(t){e[48](t)}let i={item:e[24],disabled:!0,currency:e[7]};return void 0!==e[10]&&(i.value=e[10]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&1024&o[0]&&(n=!0,r.value=e[10],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Sl(e){let t,n;return t=new e[21]({props:{class:e[15][e[85]],open:e[9]&&!e[1]&&0===e[85],$$slots:{handle:[zl,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]],default:[Ll,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){b(e[42](e[85],e[82]))&&e[42](e[85],e[82]).apply(this,arguments)})),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};32768&o[0]&&(r.class=e[15][e[85]]),514&o[0]&&(r.open=e[9]&&!e[1]&&0===e[85]),209917&o[0]|16777216&o[2]|4&o[3]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Nl(e){let t,n;return t=new hl({props:{praefix:e[85],item:e[92],eventId:e[6],record:e[83],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:Ol,classId:e[5],disabled:e[0],required:e[22],selectionFields:e[29],numberInput:e[17],currency:e[7],formnovalidate:e[85]===e[12].length-1||e[12][e[85]]._delete}}),t.$on("notify",(function(){b(e[31](e[92],e[85]))&&e[31](e[92],e[85]).apply(this,arguments)})),t.$on("task",e[49]),t.$on("invalid",e[32]),t.$on("defPrep",e[33]),t.$on("checkRange",e[34]),t.$on("record",e[50]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};8&o[0]&&(r.item=e[92]),64&o[0]&&(r.eventId=e[6]),4096&o[0]&&(r.record=e[83]),16&o[0]&&(r.recordId=e[4]._id),4&o[0]&&(r.reqQuantity=e[2]),256&o[0]&&(r.notifyList=e[8]),32&o[0]&&(r.classId=e[5]),1&o[0]&&(r.disabled=e[0]),131072&o[0]&&(r.numberInput=e[17]),128&o[0]&&(r.currency=e[7]),4096&o[0]&&(r.formnovalidate=e[85]===e[12].length-1||e[12][e[85]]._delete),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function jl(e){let t,n,o=e[3].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Nl(yl(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(541200893&n[0]|15&n[1]){let l;for(o=e[3].item,l=0;l<o.length;l+=1){const i=yl(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Nl(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Cl(e){let t,n,o=e[12][e[85]]._delete,r=jl(e);return{c(){r.c(),t=F()},m(e,o){r.m(e,o),_(e,t,o),n=!0},p(e,n){4096&n[0]&&w(o,o=e[12][e[85]]._delete)?(ce(),me(r,1,1,h),de(),r=jl(e),r.c(),ue(r),r.m(t.parentNode,t)):r.p(e,n)},i(e){n||(ue(r),n=!0)},o(e){me(r),n=!1},d(e){e&&q(t),r.d(e)}}}function Ll(e){let t,n,o,r,i=e[12].length,l=Cl(e);return{c(){t=N("div"),l.c(),o=L(),T(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`)},m(e,n){_(e,t,n),l.m(t,null),_(e,o,n),r=!0},p(e,o){4096&o[0]&&w(i,i=e[12].length)?(ce(),me(l,1,1,h),de(),l=Cl(e),l.c(),ue(l),l.m(t,null)):l.p(e,o),(!r||40&o[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`))&&T(t,"id",n)},i(e){r||(ue(l),r=!0)},o(e){me(l),r=!1},d(e){e&&q(t),l.d(e),e&&q(o)}}}function Fl(e){let t,n,o,r,i,l=e[30](e[13],e[85])+"";return{c(){t=N("div"),n=C(l),T(t,"class",o=x("draggableListItem "+e[3].name)+" svelte-1es1ap1"),T(t,"draggable",!0),O(t,"delete",e[83]._delete),O(t,"is-active-top",e[16]?.top===e[85]),O(t,"is-active-bottom",e[16]?.bottom===e[85])},m(o,l){_(o,t,l),I(t,n),r||(i=[E(t,"dragover",e[40]),E(t,"dragleave",e[41](e[85])),E(t,"dragstart",e[38](e[85])),E(t,"drop",D(e[37](e[85]))),E(t,"dragenter",e[39](e[85]))],r=!0)},p(r,i){e=r,8192&i[0]&&l!==(l=e[30](e[13],e[85])+"")&&V(n,l),8&i[0]&&o!==(o=x("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&T(t,"class",o),4104&i[0]&&O(t,"delete",e[83]._delete),65544&i[0]&&O(t,"is-active-top",e[16]?.top===e[85]),65544&i[0]&&O(t,"is-active-bottom",e[16]?.bottom===e[85])},d(e){e&&q(t),r=!1,y(i)}}}function El(e){let t,n,o;var r=e[89];return r&&(t=new r({props:{size:"20"}})),{c(){t&&ge(t.$$.fragment),n=F()},m(e,r){t&&ve(t,e,r),_(e,n,r),o=!0},p(e,o){if(r!==(r=e[89])){if(t){ce();const e=t;me(e.$$.fragment,1,0,(()=>{ye(e,1)})),de()}r?(t=new r({props:{size:"20"}}),ge(t.$$.fragment),ue(t.$$.fragment,1),ve(t,n.parentNode,n)):t=null}},i(e){o||(t&&ue(t.$$.fragment,e),o=!0)},o(e){t&&me(t.$$.fragment,e),o=!1},d(e){e&&q(n),t&&ye(t,e)}}}function Dl(e){let t,n,o,r,i,l=!e[0]&&!e[3].readonly&&El(e);return{c(){t=N("span"),l&&l.c(),T(t,"class","pointer icon svelte-1es1ap1"),T(t,"title",e[87]),t.hidden=n=e[85]===e[12].length-1||!(e[83]._delete^e[88])},m(n,s){_(n,t,s),l&&l.m(t,null),o=!0,r||(i=E(t,"click",(function(){b(e[36](e[85],e[9],e[86]))&&e[36](e[85],e[9],e[86]).apply(this,arguments)})),r=!0)},p(r,i){(e=r)[0]||e[3].readonly?l&&(ce(),me(l,1,1,(()=>{l=null})),de()):l?(l.p(e,i),9&i[0]&&ue(l,1)):(l=El(e),l.c(),ue(l,1),l.m(t,null)),(!o||4096&i[0]&&n!==(n=e[85]===e[12].length-1||!(e[83]._delete^e[88])))&&(t.hidden=n)},i(e){o||(ue(l),o=!0)},o(e){me(l),o=!1},d(e){e&&q(t),l&&l.d(),r=!1,i()}}}function zl(e){let t,n,o,r,i,l;n=new e[19]({props:{$$slots:{default:[Fl]},$$scope:{ctx:e}}}),n.$on("click",(function(){b(e[35](e[86],e[85],e[9]))&&e[35](e[86],e[85],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Te},{title:"undo",toDelete:!1,icon:Ee}],a=[];for(let t=0;t<2;t+=1)a[t]=Dl(bl(e,s,t));const c=e=>me(a[e],1,1,(()=>{a[e]=null}));return{c(){t=N("div"),ge(n.$$.fragment),o=L();for(let e=0;e<2;e+=1)a[e].c();r=L(),T(t,"class",i=x("accordion "+e[3].name)+" svelte-1es1ap1"),T(t,"slot","handle")},m(e,i){_(e,t,i),ve(n,t,null),I(t,o);for(let e=0;e<2;e+=1)a[e].m(t,null);I(t,r),l=!0},p(o,d){e=o;const u={};if(77832&d[0]|4&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|32&d[1]|16777216&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Te},{title:"undo",toDelete:!1,icon:Ee}],n=0;n<2;n+=1){const o=bl(e,s,n);a[n]?(a[n].p(o,d),ue(a[n],1)):(a[n]=Dl(o),a[n].c(),ue(a[n],1),a[n].m(t,r))}for(ce(),n=2;n<2;n+=1)c(n);de()}(!l||8&d[0]&&i!==(i=x("accordion "+e[3].name)+" svelte-1es1ap1"))&&T(t,"class",i)},i(e){if(!l){ue(n.$$.fragment,e);for(let e=0;e<2;e+=1)ue(a[e]);l=!0}},o(e){me(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)me(a[e]);l=!1},d(e){e&&q(t),ye(n),S(a,e)}}}function Tl(e){let t,n,o=(!e[1]&&!e[0]||e[85]<e[12].length-1)&&Sl(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){!e[1]&&!e[0]||e[85]<e[12].length-1?o?(o.p(e,n),4099&n[0]&&ue(o,1)):(o=Sl(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Vl(e){let t,n,o=e[12],r=[];for(let t=0;t<o.length;t+=1)r[t]=Tl(vl(e,o,t));const i=e=>me(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);_(e,t,o),n=!0},p(e,n){if(1615049727&n[0]|4095&n[1]|17825792&n[2]){let l;for(o=e[12],l=0;l<o.length;l+=1){const i=vl(e,o,l);r[l]?(r[l].p(i,n),ue(r[l],1)):(r[l]=Tl(i),r[l].c(),ue(r[l],1),r[l].m(t.parentNode,t))}for(ce(),l=o.length;l<r.length;l+=1)i(l);de()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)ue(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)me(r[e]);n=!1},d(e){S(r,e),e&&q(t)}}}function Al(e){let t,n,o,r,i,l,s=e[27]&&e[11]&&0!=e[11]&&wl(e),a=e[25]&&e[14]&&0!=e[14]&&xl(e),c=e[23]&&e[10]&&0!=e[10]&&_l(e);return i=new e[20]({props:{class:e[5]+e[3].name,$$slots:{default:[Vl,({closeOtherPanels:e})=>({82:e}),({closeOtherPanels:e})=>[0,0,e?1048576:0]]},$$scope:{ctx:e}}}),{c(){t=N("div"),s&&s.c(),n=L(),a&&a.c(),o=L(),c&&c.c(),r=L(),ge(i.$$.fragment),T(t,"class","formList")},m(e,d){_(e,t,d),s&&s.m(t,null),I(t,n),a&&a.m(t,null),I(t,o),c&&c.m(t,null),I(t,r),ve(i,t,null),l=!0},p(e,l){e[27]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&ue(s,1)):(s=wl(e),s.c(),ue(s,1),s.m(t,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[25]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&ue(a,1)):(a=xl(e),a.c(),ue(a,1),a.m(t,o)):a&&(ce(),me(a,1,1,(()=>{a=null})),de()),e[23]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&ue(c,1)):(c=_l(e),c.c(),ue(c,1),c.m(t,r)):c&&(ce(),me(c,1,1,(()=>{c=null})),de());const d={};40&l[0]&&(d.class=e[5]+e[3].name),242687&l[0]|1048576&l[2]|4&l[3]&&(d.$$scope={dirty:l,ctx:e}),i.$set(d)},i(e){l||(ue(s),ue(a),ue(c),ue(i.$$.fragment,e),l=!0)},o(e){me(s),me(a),me(c),me(i.$$.fragment,e),l=!1},d(e){e&&q(t),s&&s.d(),a&&a.d(),c&&c.d(),ye(i)}}}let Bl=new Map;const Ol=!0,Ml="pos/target";function Wl(e,n,o){let r,i;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:$}=c,h=H();let{list:g}=n,{schema:v}=n,{record:y}=n,{classId:b}=n,{eventId:w}=n,{disabled:k}=n,{fixed:x}=n,{template:I={}}=n,{reqQuantity:_}=n,{open:q=!1}=n,{currency:S}=n,{notifyList:N}=n;const j=v.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),C=j&&v.find((e=>"quantity"===e.name));let L=0;const F=v.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let E=0;const D=v.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",z=!!D;let T=0;const V={};let A=v.properties?.readonly,B=b.split("form-")[1].slice(0,-4),O=new Map;g.group&&(x=!0);const M={};k||=A;let W,R,P=[],Y=[],G=!1,J={},U=[];v.filter((e=>e.selection)).map((e=>P.push({className:B,parentClass:v,refClass:e.selection,value:""}))),v.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{v.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[o,r]=n.split(".");r||(r=o,o=void 0),U.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));const Z=async(e,t,n)=>{const o=y[n];if(!o?.length)return;const r=o[0][n];if(!r)return;const i=await Fs(n,r);return i?i[g.name]:void 0},K=async(e,t)=>{const n=U.filter((e=>(e.refObj||B)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:r,refName:i,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(r){const t=W[e][r];r===B&&i?d=y:t&&(d=await Fs(r,t))}!r&&i&&(d=W[e]),d&&(u=d[i],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&&o(12,W[e][n]="",W))}},X=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const r=document.querySelectorAll(n);let i=!1;r.forEach((e=>{e.required&&""===e.value&&(i=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),o(15,Y[e]=i||t?"invalid":"",Y)},te=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},ne=(e,t)=>{if(!t)return;const n=v.find((e=>e.name===t)),r=n.properties.value.formula,{operator:i,argument:l}=r,s=l.map((t=>W[e][t.refItem]));let a=0;"$add"===i&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===i&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,o]=e.split(":");e=o?(+n+ +o/60).toFixed(2):+n;const[r,i]=t.split(":");return r?e-=i?(+r+ +i/60).toFixed(2):+r:0})));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;o(12,W[e][t]=(a||0).toFixed(n.properties.decimals||0),W),o(17,J={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};R=v.filter((e=>e.refClass)).reduce(((e,t)=>{const n=v.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,o]=t.selection.split(":"),[r]=o?.split(".")||[];r&&e.push({refClass:r,items:[n],selection:t.selection})}const o={refClass:t.refClass,items:[]};return n.forEach((e=>{o.items.push(e.name)})),e.push(o),e}),[]);const oe=async(e,t,n,r)=>{const i=(await R).find((e=>e.refClass===t.refClass));if(!i)return;const{refClass:l,items:s,selection:a}=i,c=t.name;if(U.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 i=>{const c=v.find((e=>e.name===i));if(c.properties?.readonly&&!t.refInput){const n=W[e][t.refClass];return Promise.resolve(Fs(t.refClass,n,!0)).then((t=>{let n=t[i];Array.isArray(n)&&(n=n.length?n[0][i]:""),o(12,W[e][i]=n,W)}))}let d="";const{refInput:u}=t;if(u&&W[e]){const[t,n]=u.split(".");d=n?W[e][n]:y[t]}if(a&&n!==r)s.map((t=>{o(12,W[e][t]="",W)}));else if(u&&!d||re(e,i)||r!==n){const n=v.find((e=>e.refClass===l)),r=W[e][n.name];if(t.selection){const n=Ls(t.selection+r.toString());if(n)return Promise.resolve(n).then((t=>o(12,W[e][i]=t[i],W)))}return Promise.resolve(Fs(n.refClass,r)).then((t=>o(12,W[e][i]=t[i],W)))}}))):Promise.resolve(s.map((t=>{o(12,W[e][t]="",W)})))},re=(e,t)=>{let n=W[e][t];return"number"===v.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},ie=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let le=!1;const se=e=>!(!x&&e>=W.length-1),ae=(e,t=!1)=>{const[n,o]=e.split(";");return g.name===o&&(!!se(t)&&((!1===t||t!=n)&&parseInt(n)))};v.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=v.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ce=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,o=document.querySelectorAll(n);if(!o?.length)return;const r=o[o.length-1];ee().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(ie)})).then((()=>{t&&r.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&o(3,g=e.list),"schema"in e&&o(43,v=e.schema),"record"in e&&o(4,y=e.record),"classId"in e&&o(5,b=e.classId),"eventId"in e&&o(6,w=e.eventId),"disabled"in e&&o(0,k=e.disabled),"fixed"in e&&o(1,x=e.fixed),"template"in e&&o(44,I=e.template),"reqQuantity"in e&&o(2,_=e.reqQuantity),"open"in e&&o(9,q=e.open),"currency"in e&&o(7,S=e.currency),"notifyList"in e&&o(8,N=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&y&&(o(2,_=y.quantity),o(12,W=(y[g.name]||[]).concat({}))),4096&e.$$.dirty[0]&&o(13,r=W),15368&e.$$.dirty[0]&&r&&((()=>{if(F)o(14,E=W?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(z)o(11,T=W?.reduce(((e,t)=>e+(t._delete?0:+(t[D]||0))),0)||0)})(),(()=>{if(j)o(10,L=W?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}if(t.price){const n=(C?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ee().then((()=>h("save",{listName:g.name,value:W,amountValue:L,weeksValue:T})))),16384&e.$$.dirty[1]&&(i=e=>V[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[k,x,_,g,y,b,w,S,N,q,L,T,W,r,E,Y,G,J,l,a,d,u,undefined,j,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},z,{name:"weeksValue",properties:{decimals:1}},P,(e,t)=>{let n=e[t];return M["pos"+t]&&(n=M["pos"+t]),n&&v.filter((e=>!0!==e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?i(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?p(n[e.name]):"date"===e.type?m(n[e.name]):"datetime"===e.type?f(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:i,value:l,add:s,desc:a}=n;if(g.refItem){const n=await Z(t,e,g.refItem);n&&o(12,W=n)}ne(t,e._formulaActor);const c=P?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&W.length===t+1&&o(12,W=W.concat({})),a&&o(45,V[l]=a,V),await oe(t,e,l,i),await K(t,e.name),o(13,r=W),"number"===e.type&&o(17,J={item:e,value:l,idx:t}),X(t)},({detail:e})=>{const{idx:t,value:n}=e;X(t,n)},async({detail:{className:e,itemName:n,value:o}})=>{if(O.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===B+"."+g.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&O.set(e,i[0])},({detail:e})=>{const{idx:t,fieldId:n,value:o}=e;if(!o)return;const r=te(o);let i=!1;W.forEach(((e,n)=>{if(t===n)return;const{start:o,end:l}=W[n];o&&l&&r>te(o)&&r<te(l)&&(i=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",i)},(e,t,n)=>n=>{W[t]._delete||(e(n),ce(t,!0))},(e,t,n)=>r=>{if(o(12,W[e]._delete=!W[e]._delete,W),W[e]._delete){M["pos"+e]={...W[e]};for(const t of v)o(12,W[e][t.name]="",W);t&&n(r)}else{if(M["pos"+e]){const t={};for(const n of v)t[n.name]=M["pos"+e][n.name];o(12,W[e]=t,W)}M["pos"+e]=void 0,t||n(r)}},e=>t=>{t.preventDefault(),o(16,G=!1);const n=ae(t.dataTransfer.getData(Ml),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const r=[...W].map(((e,t)=>(e._index=t,e)));n<e?(r.splice(e+1,0,r[n]),r.splice(n,1)):(r.splice(e,0,r[n]),r.splice(n+1,1)),r.map(((e,t)=>{return n=e._index,o=t,void Bl.set(o,n);var n,o}));let i=[];Y.map(((e,t)=>{i[t]=Y[(e=>{const t=Bl.get(e);return void 0===t?e:t})(t)]})),o(15,Y=i),o(12,W=r.map(((e,t)=>(delete e._index,e)))),le=!1},e=>t=>{if(!se(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(Ml,e+";"+g.name),le=e},e=>t=>{const n=ae(t.dataTransfer.getData(Ml),e)||le;return!1===n||n===e?o(16,G=!1):void o(16,G={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{o(16,G=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(O).forEach((([t,n])=>{W[e][t]||o(12,W[e][t]=n._id,W)}))}),500);const r=new Set;for(const e of U)r.add(e.refObj||B);for(const t of Array.from(r))K(e,t);t(n),ce(e)},v,I,V,function(e){T=e,o(11,T)},function(e){E=e,o(14,E)},function(e){L=e,o(10,L)},function(t){Q(e,t)},function(t){Q(e,t)}]}class Rl extends we{constructor(e){var t;super(),gl.getElementById("svelte-1es1ap1-style")||((t=N("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}",I(gl.head,t)),be(this,e,Wl,Al,w,{list:3,schema:43,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:44,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:Pl,document:Hl}=$e;function Ql(e,t,n){const o=e.slice();return o[121]=t[n],o}function Yl(e,t,n){const o=e.slice();return o[124]=t[n],o}function Gl(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Jl(e){let t,n,o=e[120]&&function(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=Zl(Yl(e,g,t));const b=e=>me(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&Kl(e),k=!e[2]&&e[38]&&e[3]&&!e[21]&&as(e);d=new e[24]({props:{outline:!0,$$slots:{default:[ds]},$$scope:{ctx:e}}}),d.$on("click",e[41]);const j=[ms,us],C=[];function F(e,t){return e[5]?0:e[38]?1:-1}~(m=F(e))&&(f=C[m]=j[m](e));return{c(){t=N("section"),n=N("form"),o=N("input"),i=L();for(let e=0;e<v.length;e+=1)v[e].c();l=L(),w&&w.c(),s=L(),k&&k.c(),a=L(),c=N("div"),ge(d.$$.fragment),u=L(),f&&f.c(),T(o,"class",x(e[29])+" svelte-9xiaib"),T(o,"name","_id"),T(o,"type","hidden"),o.value=r=e[4]._id||"",T(n,"class",x(e[30])+" svelte-9xiaib"),T(n,"id",e[29]),T(c,"class","form--buttons svelte-9xiaib"),T(t,"class",x(e[31])+" svelte-9xiaib")},m(r,f){_(r,t,f),I(t,n),I(n,o),I(n,i);for(let e=0;e<v.length;e+=1)v[e].m(n,null);I(n,l),w&&w.m(n,null),I(t,s),k&&k.m(t,null),I(t,a),I(t,c),ve(d,c,null),I(c,u),~m&&C[m].m(c,null),p=!0,$||(h=[E(n,"keydown",e[46]),E(n,"submit",D(e[40]))],$=!0)},p(e,i){if((!p||16&i[0]&&r!==(r=e[4]._id||""))&&(o.value=r),539003026&i[0]|7354432&i[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const o=Yl(e,g,t);v[t]?(v[t].p(o,i),ue(v[t],1)):(v[t]=Zl(o),v[t].c(),ue(v[t],1),v[t].m(n,l))}for(ce(),t=g.length;t<v.length;t+=1)b(t);de()}e[1].list?w?(w.p(e,i),2&i[0]&&ue(w,1)):(w=Kl(e),w.c(),ue(w,1),w.m(n,null)):w&&(ce(),me(w,1,1,(()=>{w=null})),de()),!e[2]&&e[38]&&e[3]&&!e[21]?k?(k.p(e,i),2097164&i[0]&&ue(k,1)):(k=as(e),k.c(),ue(k,1),k.m(t,a)):k&&(ce(),me(k,1,1,(()=>{k=null})),de());const s={};8&i[4]&&(s.$$scope={dirty:i,ctx:e}),d.$set(s);let u=m;m=F(e),m===u?~m&&C[m].p(e,i):(f&&(ce(),me(C[u],1,1,(()=>{C[u]=null})),de()),~m?(f=C[m],f?f.p(e,i):(f=C[m]=j[m](e),f.c()),ue(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)ue(v[e]);ue(w),ue(k),ue(d.$$.fragment,e),ue(f),p=!0}},o(e){v=v.filter(Pl);for(let e=0;e<v.length;e+=1)me(v[e]);me(w),me(k),me(d.$$.fragment,e),me(f),p=!1},d(e){e&&q(t),S(v,e),w&&w.d(),k&&k.d(),ye(d),~m&&C[m].d(),$=!1,y(h)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,t){e[120]&&o.p(e,t)},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Ul(e){let t,n;return t=new hl({props:{classId:e[29],item:e[124],selection:e[124].selection,record:e[4],disabled:e[21],eventId:e[37],toDelete:e[11],currency:e[7],changeValue:e[15]}}),t.$on("task",e[42]),t.$on("notify",e[43]),t.$on("safeReference",e[52]),t.$on("multi",e[44]),t.$on("defPrep",e[51]),t.$on("record",e[53]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[124]),2&n[0]&&(o.selection=e[124].selection),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2048&n[0]&&(o.toDelete=e[11]),128&n[0]&&(o.currency=e[7]),32768&n[0]&&(o.changeValue=e[15]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function Zl(e){let t,n,o="list"!==e[124].type&&Ul(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),_(e,t,r),n=!0},p(e,n){"list"!==e[124].type?o?(o.p(e,n),2&n[0]&&ue(o,1)):(o=Ul(e),o.c(),ue(o,1),o.m(t.parentNode,t)):o&&(ce(),me(o,1,1,(()=>{o=null})),de())},i(e){n||(ue(o),n=!0)},o(e){me(o),n=!1},d(e){o&&o.d(e),e&&q(t)}}}function Kl(e){let t,n,o,r,i,l=e[34]&&e[8]&&0!=e[8]&&Xl(e),s=e[9]&&ts(e),a=e[35]&&e[14]&&0!=e[14]&&os(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=ss(Ql(e,c,t));const u=e=>me(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=L(),s&&s.c(),n=L(),a&&a.c(),o=L();for(let e=0;e<d.length;e+=1)d[e].c();r=F()},m(e,c){l&&l.m(e,c),_(e,t,c),s&&s.m(e,c),_(e,n,c),a&&a.m(e,c),_(e,o,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);_(e,r,c),i=!0},p(e,i){if(e[34]&&e[8]&&0!=e[8]?l?(l.p(e,i),256&i[0]&&ue(l,1)):(l=Xl(e),l.c(),ue(l,1),l.m(t.parentNode,t)):l&&(ce(),me(l,1,1,(()=>{l=null})),de()),e[9]?s?(s.p(e,i),512&i[0]&&ue(s,1)):(s=ts(e),s.c(),ue(s,1),s.m(n.parentNode,n)):s&&(ce(),me(s,1,1,(()=>{s=null})),de()),e[35]&&e[14]&&0!=e[14]?a?(a.p(e,i),16384&i[0]&&ue(a,1)):(a=os(e),a.c(),ue(a,1),a.m(o.parentNode,o)):a&&(ce(),me(a,1,1,(()=>{a=null})),de()),539177174&i[0]|4210752&i[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=Ql(e,c,t);d[t]?(d[t].p(n,i),ue(d[t],1)):(d[t]=ss(n),d[t].c(),ue(d[t],1),d[t].m(r.parentNode,r))}for(ce(),t=c.length;t<d.length;t+=1)u(t);de()}},i(e){if(!i){ue(l),ue(s),ue(a);for(let e=0;e<c.length;e+=1)ue(d[e]);i=!0}},o(e){me(l),me(s),me(a),d=d.filter(Pl);for(let e=0;e<d.length;e+=1)me(d[e]);i=!1},d(e){l&&l.d(e),e&&q(t),s&&s.d(e),e&&q(n),a&&a.d(e),e&&q(o),S(d,e),e&&q(r)}}}function Xl(e){let t,n;return t=new e[25]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[es]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};384&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function es(e){let t,n,o;function r(t){e[61](t)}let i={item:e[32],disabled:!0,currency:e[7]};return void 0!==e[8]&&(i.value=e[8]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&256&o[0]&&(n=!0,r.value=e[8],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function ts(e){let t,n;return t=new e[25]({props:{name:"Total MWSt "+(e[10]?"("+e[10]+"%)":""),nameClass:"formField_italic",$$slots:{default:[ns]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};1024&n[0]&&(o.name="Total MWSt "+(e[10]?"("+e[10]+"%)":"")),640&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ns(e){let t,n,o;function r(t){e[62](t)}let i={item:e[33],disabled:!0,currency:e[7]};return void 0!==e[9]&&(i.value=e[9]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&512&o[0]&&(n=!0,r.value=e[9],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function os(e){let t,n;return t=new e[25]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[rs]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function rs(e){let t,n,o;function r(t){e[63](t)}let i={item:e[36],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Ao({props:i}),G.push((()=>he(t,"value",r))),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function is(e){let t,n;return t=new Zn({props:{classId:e[29],open:!e[2]&&1===e[1].list.length,list:e[121],template:e[16],eventId:e[37],schema:e[121].item,record:e[4],disabled:e[21],currency:e[7]}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};6&n[0]&&(o.open=!e[2]&&1===e[1].list.length),2&n[0]&&(o.list=e[121]),65536&n[0]&&(o.template=e[16]),2&n[0]&&(o.schema=e[121].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),128&n[0]&&(o.currency=e[7]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ls(e){let t,n;return t=new Rl({props:{classId:e[29],open:e[13],list:e[121],template:e[17],eventId:e[37],schema:e[121].item,record:e[4],disabled:e[21],fixed:e[121].fixed,reqQuantity:e[12],currency:e[7],notifyList:e[6]}}),t.$on("save",e[45]),t.$on("record",e[53]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8192&n[0]&&(o.open=e[13]),2&n[0]&&(o.list=e[121]),131072&n[0]&&(o.template=e[17]),2&n[0]&&(o.schema=e[121].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2&n[0]&&(o.fixed=e[121].fixed),4096&n[0]&&(o.reqQuantity=e[12]),128&n[0]&&(o.currency=e[7]),64&n[0]&&(o.notifyList=e[6]),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ss(e){let t,n,o,r,i,l;t=new e[23]({props:{text:e[121].designation}});const s=[ls,is],a=[];function c(e,t){return"array"===e[121].type?0:1}return o=c(e),r=a[o]=s[o](e),{c(){ge(t.$$.fragment),n=L(),r.c(),i=F()},m(e,r){ve(t,e,r),_(e,n,r),a[o].m(e,r),_(e,i,r),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[121].designation),t.$set(l);let d=o;o=c(e),o===d?a[o].p(e,n):(ce(),me(a[d],1,1,(()=>{a[d]=null})),de(),r=a[o],r?r.p(e,n):(r=a[o]=s[o](e),r.c()),ue(r,1),r.m(i.parentNode,i))},i(e){l||(ue(t.$$.fragment,e),ue(r),l=!0)},o(e){me(t.$$.fragment,e),me(r),l=!1},d(e){ye(t,e),e&&q(n),a[o].d(e),e&&q(i)}}}function as(e){let t,n,o,r;function i(t){e[64](t)}let l={title:"",round:!0,$$slots:{default:[cs]},$$scope:{ctx:e}};return void 0!==e[20]&&(l.checked=e[20]),n=new e[26]({props:l}),G.push((()=>he(n,"checked",i))),{c(){t=N("div"),ge(n.$$.fragment),T(t,"class","askNext"),B(t,"margin-top","1em"),B(t,"margin-left","23em")},m(e,o){_(e,t,o),ve(n,t,null),r=!0},p(e,t){const r={};8&t[4]&&(r.$$scope={dirty:t,ctx:e}),!o&&1048576&t[0]&&(o=!0,r.checked=e[20],ne((()=>o=!1))),n.$set(r)},i(e){r||(ue(n.$$.fragment,e),r=!0)},o(e){me(n.$$.fragment,e),r=!1},d(e){e&&q(t),ye(n)}}}function cs(e){let t;return{c(){t=N("span"),t.textContent="Weiter erfassen",B(t,"margin-left","1em")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ds(e){let t;return{c(){t=C("Abbrechen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function us(e){let t,n,o,r,i;t=new e[24]({props:{class:"close",disabled:e[21],form:e[29],filled:!0,type:"submit",$$slots:{default:[fs]},$$scope:{ctx:e}}});let l=e[3]&&!e[21]&&ps(e),s=e[18]&&hs(e);return{c(){ge(t.$$.fragment),n=L(),l&&l.c(),o=L(),s&&s.c(),r=F()},m(e,a){ve(t,e,a),_(e,n,a),l&&l.m(e,a),_(e,o,a),s&&s.m(e,a),_(e,r,a),i=!0},p(e,n){const i={};2097152&n[0]&&(i.disabled=e[21]),8&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i),e[3]&&!e[21]?l?(l.p(e,n),2097160&n[0]&&ue(l,1)):(l=ps(e),l.c(),ue(l,1),l.m(o.parentNode,o)):l&&(ce(),me(l,1,1,(()=>{l=null})),de()),e[18]?s?(s.p(e,n),262144&n[0]&&ue(s,1)):(s=hs(e),s.c(),ue(s,1),s.m(r.parentNode,r)):s&&(ce(),me(s,1,1,(()=>{s=null})),de())},i(e){i||(ue(t.$$.fragment,e),ue(l),ue(s),i=!0)},o(e){me(t.$$.fragment,e),me(l),me(s),i=!1},d(e){ye(t,e),e&&q(n),l&&l.d(e),e&&q(o),s&&s.d(e),e&&q(r)}}}function ms(e){let t,n,o,r;t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[bs]},$$scope:{ctx:e}}}),t.$on("click",e[49]);let i=e[19]&&ws(e);return{c(){ge(t.$$.fragment),n=L(),i&&i.c(),o=F()},m(e,l){ve(t,e,l),_(e,n,l),i&&i.m(e,l),_(e,o,l),r=!0},p(e,n){const r={};8&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[19]?i?(i.p(e,n),524288&n[0]&&ue(i,1)):(i=ws(e),i.c(),ue(i,1),i.m(o.parentNode,o)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(t.$$.fragment,e),ue(i),r=!0)},o(e){me(t.$$.fragment,e),me(i),r=!1},d(e){ye(t,e),e&&q(n),i&&i.d(e),e&&q(o)}}}function fs(e){let t;return{c(){t=C("Speichern und schliessen")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function ps(e){let t,n;return t=new e[24]({props:{form:e[29],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[$s]},$$scope:{ctx:e}}}),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function $s(e){let t;return{c(){t=C("Speichern")},m(e,n){_(e,t,n)},d(e){e&&q(t)}}}function hs(e){let t,n,o,r;t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[gs]},$$scope:{ctx:e}}}),t.$on("click",(function(){b(e[47](e[0]))&&e[47](e[0]).apply(this,arguments)}));let i=e[19]&&vs(e);return{c(){ge(t.$$.fragment),n=L(),i&&i.c(),o=F()},m(e,l){ve(t,e,l),_(e,n,l),i&&i.m(e,l),_(e,o,l),r=!0},p(n,r){e=n;const l={};8&r[4]&&(l.$$scope={dirty:r,ctx:e}),t.$set(l),e[19]?i?(i.p(e,r),524288&r[0]&&ue(i,1)):(i=vs(e),i.c(),ue(i,1),i.m(o.parentNode,o)):i&&(ce(),me(i,1,1,(()=>{i=null})),de())},i(e){r||(ue(t.$$.fragment,e),ue(i),r=!0)},o(e){me(t.$$.fragment,e),me(i),r=!1},d(e){ye(t,e),e&&q(n),i&&i.d(e),e&&q(o)}}}function gs(e){let t,n,o;return n=new et({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Dokument erstellen",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function vs(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ys]},$$scope:{ctx:e}}}),t.$on("click",(function(){b(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(n,o){e=n;const r={};8&o[4]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ys(e){let t,n,o;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function bs(e){let t,n,o;return n=new et({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Erstellen",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function ws(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ks]},$$scope:{ctx:e}}}),t.$on("click",e[50]),{c(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,n){const o={};8&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function ks(e){let t,n,o;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",ge(n.$$.fragment),B(t,"margin-right",".75em")},m(e,r){_(e,t,r),ve(n,e,r),o=!0},p:h,i(e){o||(ue(n.$$.fragment,e),o=!0)},o(e){me(n.$$.fragment,e),o=!1},d(e){e&&q(t),ye(n,e)}}}function xs(e){return{c:h,m:h,p:h,i:h,o:h,d:h}}function Is(e){let t,n,o,r;Hl.title=t=e[22];let i={ctx:e,current:null,token:null,hasCatch:!1,pending:xs,then:Jl,catch:Gl,value:120,blocks:[,,,]};return fe(e[39](),i),{c(){n=L(),o=F(),i.block.c()},m(e,t){_(e,n,t),_(e,o,t),i.block.m(e,i.anchor=t),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(n,o){e=n,(!r||4194304&o[0])&&t!==(t=e[22])&&(Hl.title=t),pe(i,e,o)},i(e){r||(ue(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){me(i.blocks[e])}r=!1},d(e){e&&q(n),e&&q(o),i.block.d(e),i.token=null,i=null}}}let _s=new Map,qs=new Map,Ss=new Map;const Ns=(e,n)=>{const o=n;return _s.has(o)||_s.set(o,t.getTasksList(n).then((({data:e})=>e))),_s.get(o)},js=(e,n,o)=>qs.get(o)||Ns(e,n).then((n=>n.find((({_id:e})=>e===o))||t.getTaskList(e,o))).then((e=>(qs.set(o,e),e))),Cs=(e,t)=>{Ss.set(e,t)},Ls=e=>Ss.get(e),Fs=(e,n,o=!1)=>!o&&Ss.get(n)||t.getTask(e,n).then((e=>(Ss.set(n,e),e))),Es=(e,n)=>{if(!_s.get(n))return;const o=n;_s.set(o,t.getTasksList(n).then((({data:e})=>e)))};function Ds(e,r,a){let m,f,p,h,g,v,y;k(e,u,(e=>a(74,h=e))),k(e,s,(e=>a(75,g=e))),k(e,o,(e=>a(76,v=e)));const{Divider:b,Button:w,FormField:x,Checkbox:I}=c,{loggedIn:_,currentTasks:q}=d;k(e,_,(e=>a(77,y=e))),k(e,q,(e=>a(73,p=e)));const S=JSON.parse(i.getItem("Locale")),N=H();let j,C,L,F,E,{schema:D}=r,{recID:z}=r,{prevEventID:T=!1}=r,{prev:V=!1}=r,{taskId:A=!1}=r,{description:B=""}=r,{root:O=!1}=r,{readonly:M}=r,{isStandalone:W}=r,Q={},Y={},G="form-"+D.class+Math.floor(9e3*Math.random()+1e3).toString();const J=O?"fEmbedded":"fTask",U=O?"sEmbedded":"sTask";let Z="CHF";let K,X,te=0,ne=0,oe=0,re=0,ie=1,le=!z&&D.list&&1===D.list.length;const se={},ae=D.items.find((e=>"price"===e.name&&!e.properties?.hidden)),ce=D.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),de=D.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),ue=!!ae||!!de,me=D.list?.filter((e=>"array"===e.type))?.length>1||ue,fe=D.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,pe=!!fe,$e=D.list?.filter((e=>"array"===e.type))?.length>1||pe,he={};let ge,ve,ye,be,we=0,ke=0,xe=[],Ie=[],_e=[],qe={},Se=new Map,Ne=D.class,je=D.id,Ce=!1,Le=-1!==window.location.search.indexOf("next=");const Fe=!p?.length||p.find((e=>e===je));["readonly","hidden","required"].map((e=>{D.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");xe.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));D.items.filter((e=>e.selection&&e.constraint)).map((e=>{Ie.push({name:e.name,selection:e.selection,constraint:e.constraint})}));D.items.filter((e=>e.lookup)).forEach((e=>{_e.push({name:e.name,lookup:e.lookup})})),D.items.filter((e=>e.properties?.lookup)).forEach((e=>{_e.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ee=async e=>{if(e?.length)for(const n of e){if(!n.lookup)break;const{name:e}=n;if(Q[e])break;const{domain:o,value:r}=n.lookup;if("user"===o&&r){const n={[r]:y.user},o=await t.getSectionView(e,n);if(o?.length){const[{_id:t}]=o;t&&a(4,Q[e]=t,Q)}}}},De=async e=>{if(!D.input)return;if(!D.input.length)return;if(D.input.length<2)return;const n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const o=e.input.class[1].name,r=e.input.class[1].destination?.split(".")[0];if(!o||!r)return;const i=D.list?.find((e=>e.name===o));if(!i)return;const l=await t.getSchemaByClass(n),s=(await t.getTasks(l.id)).data;if(!s?.length)return;const c=[];for(const e of s){const t={};for(const n of i.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(4,Q[o]=c,Q)},ze=()=>{for(const e of D.items)e.properties?.value?.concatenation&&Te(e)},Te=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 Ae(e.refItemNext));a(4,Q[e.name]=n,Q)},Ve=async e=>{const t=xe.filter((t=>t.refObj===e));if(t?.length){a(15,qe={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:i}=e;if(!n)break;let l,s,c=!o&&Q[n];const d=Q[n];d&&o&&(c=(await Fs(n,d))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==i&&"readonly"!==i||(i="required"===i?i:"disabled",setTimeout((()=>{l=`#${G} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(i,""),s&&!c&&s.removeAttribute(i)}),0)),"hidden"===i&&(l=`#${G} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(15,qe[t]="",qe))}}},Ae=async e=>{const[n,o]=e.offset?.split(",")||[0,0],r=+e.base||0,i=+e.step||1;e.type;const l=e.refItem,s=await t.getLastId(D.class,l);if(!s?.length)return(r+i).toString().padStart(o,"0");const a=s[0][l];return((+a?.substring(n,n+o)||r)+i).toString().padStart(o,"0")},Be=(e,t,n,o=!1)=>{const r=n||t.name,i=r.startsWith("_")?r:r.split("_")[0],l=e.find((e=>e.name===i));let s=t.value;if(!o&&l&&l.properties?.multi&&(s=Q[r]),s&&l&&"dateRange"===l.type){let e=new Date(s);return"Invalid Date"==e?"":(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&&l.type.startsWith("date"))try{return In(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if(l&&"boolean"===l.type&&(s=!!t.checked),l&&"number"===l.type){const e=Number("1.1").toLocaleString(S.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Oe=()=>W?window.close():O?window.singleSpaNavigate("/"):N("back"),Me=async(e,n)=>{if(D.input&&D.input.length>1){if(D.input[0]!==e)return;const{recursive:o}=ye.input.class[1];if(n){const r=await t.getTaskOptions(`${e}:${n}`,je,o);a(4,Q={...Q,...r})}else{const e=D.input.slice(1);for(const t of e)a(4,Q[t]=[],Q)}}},We=()=>{let e=0;if(ae){let t=1;ce&&(t=ie),e=re*t}de&&(e=re);let t=0;for(const e in se)t+=se[e];a(8,te=t+e)},Re=()=>{let e=0;for(const t in he)e+=he[t];a(14,we=e+ +ke)};n.subscribe((async e=>{if(!e)return;if(!z)return;const n=await t.getSchema(e.eventId);if(!n)return;const o=D.list?.find((e=>e.name===n.class));if(!o)return;const r=await t.getTaskById(e.taskId);((e,t,n)=>{if(!_s.get(e))return;const o=t;qs.set(o,n)})(r.event,r.docId,r.data);const i=await t.getTask(n.class,r.docId),l=Q[n.class].filter((e=>e[n.class]==i._id));l?.length&&l.map((e=>{e[n.class]=r.docId})),a(4,Q),a(60,C),a(59,j),a(1,D)})),P((()=>{_s=new Map,qs=new Map,Ss=new Map,Pe()}));const Pe=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(G))&&++n<20;)await e(50);t&&(()=>{if(z)return;const e=new Set;for(const t of xe)e.add(t.refObj||Ne);Array.from(e).forEach((e=>Ve(e)))})(),He()},He=()=>{setTimeout((()=>{Array.from(Se).forEach((([e,t])=>{Q[e]||a(4,Q[e]=t._id,Q)}))}),350)};var Qe;Qe=()=>{z&&function(e,t,n=t){e.set(n)}(u,h={[z]:{record:Q,lists:Y}},h)},R().$$.on_destroy.push(Qe);const Ye=()=>{const e={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,o]=t.name.split("."),r=D.list.find((e=>e.name===n));e[t.name]=Be(r.item,t)}else e[t.name]=Be(D.items,t,t.name.split("_")[0])}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const o=D.items.find((t=>t.name===e));o?.properties?.required&&!n&&(t=!1)})),t&&e},Ge=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,D=e.schema),"recID"in e&&a(2,z=e.recID),"prevEventID"in e&&a(56,T=e.prevEventID),"prev"in e&&a(57,V=e.prev),"taskId"in e&&a(0,A=e.taskId),"description"in e&&a(54,B=e.description),"root"in e&&a(3,O=e.root),"readonly"in e&&a(55,M=e.readonly),"isStandalone"in e&&a(58,W=e.isStandalone)},e.$$.update=()=>{16777216&e.$$.dirty[1]&&a(21,m=M),2&e.$$.dirty[0]|805306368&e.$$.dirty[1]&&C&&j&&D.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const o=j.items.find((t=>t.name===e));if(!o)return;if(t!==o.type)return;const r="_"+e;C[e]?a(4,Q[e]=C[e],Q):a(4,Q[e]="",Q),C[r]&&a(4,Q[r]=C[r],Q),a(13,le=!1)})),8&e.$$.dirty[0]|8388608&e.$$.dirty[1]&&a(22,f=O?B||"enablerr - Form":document.title)},[A,D,z,O,Q,L,E,Z,te,ne,oe,K,X,le,we,qe,ge,ve,Ce,be,Le,m,f,b,w,x,I,_,q,G,J,U,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},me,$e,{name:"weekValue",properties:{decimals:1}},je,Fe,async()=>{a(17,ve=await t.getTemplate(D.class));const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&a(7,Z=n[0].designation)}if(ye=await t.getEvent(je),z||(a(16,ge=ve),Ee(ye.input?.class),ze(),De(ye)),z){if(h&&h[z]){const e=h[z].record;D.items.map((t=>{e[t.name]=Be(D.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(4,Q=e),D.list&&D.list.map((e=>{"array"===e.type&&h[z].lists[e.name]&&a(4,Q[e.name]=h[z].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Be(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]),Q)}))}else a(4,Q=await t.getTask(D.class,z));a(54,B=$(D,Q)),a(18,Ce=!!D.result?.resultDef),a(9,ne=Q._tax?._amount),a(10,oe=100*Q._tax?._rate||"")}if(T){a(55,M=!1),a(59,j=await t.getSchema(T)),"string"==typeof V&&a(60,C=await t.getTask(j.class,V));const e=D.items.find((e=>e.refClass===j.class));a(4,Q[e.name]=C._id,Q)}if($e&&(ke=Q[fe]||0),ye.trigger?.startOn&&!ye.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(55,M=!0),g.role?.length&&D.authorization?.length){const e=D.authorization.some((e=>v?.find((t=>t===e.role&&"edit"===e.activity))));a(55,M||=!e)}if(a(5,L="report"===ye.output.type),a(19,be=!!(await t.getUserSettings()).isAdmin),!be){const e=y.tenants.find((e=>e._id===y.tenant));e&&a(19,be=e.admin?.find((e=>e===y.user)))}return!0},async e=>{z||a(21,m=!0);const n=e.submitter?.className?.includes("close"),o={};if(Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),r=D.list.find((e=>e.name===t));o[e.name]=Be(r.item,e)}else o[e.name]=Be(D.items,e)})),D.list&&D.list.map((e=>{"array"===e.type&&Y[e.name]&&(o[e.name]=Y[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Be(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]))})),o._event=je,o._prevEventId=T,o._taskId=A,F){const e=F.record;for(const t in e)t.includes(".")&&delete e[t];e._event=F.event,e._taskId=F.taskId;const{id:n}=await t.saveData(F.class,e);o[F.class]||(o[F.class]=n)}const{id:r,task:i,tax:s,error:c}=await t.saveData(D.class,o);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(21,m=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(9,ne=s?._amount||0),a(10,oe=100*(s?._rate||0)||""),o._id=r;const d=await t.getTaskList(D.class,r);if(N("choose",{row:d}),n)return Oe();if(!z){if(Le){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${je}/${je}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${je}/${i}/task`)}},()=>!L&&T?window.history.back():Oe(),async({detail:e})=>{const{row:n}=e;let{eventId:o}=e;if((()=>{if(z)for(const e of xe)e.refName||Ve(e.itemName)})(),z)return;if(await(async()=>{const e={...Q};for(const n of D.items)if(n.refItem&&Q[n.refItem]){const o=await t.getTask(n.refItem,Q[n.refItem]);o&&(e[n.name]=o[n.name])}for(const n of D.list||[])if(n.refItem&&Q[n.refItem]){const o=await t.getTask(n.refItem,Q[n.refItem]),r=[];for(const e of o[n.name]){const t={};for(const o of n.item)e[o.name]&&(t[o.name]=e[o.name]);r.push(t)}e[n.name]=r}a(4,Q=e)})(),o||=n._task?.event,(async(e,t)=>{if(!e)return;const n=ye.output.class[0].name,o=_e.filter((e=>e.lookup===n));if(o?.length)for(const e of o){const{lookup:n,name:o}=e;let r="";if(t){let e=await Fs(n,t);e&&e[o]?.length&&(r=e[o][0][o])}a(4,Q[o]=r,Q)}})(o,n._id),o&&D.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const n=await t.getEvent(o);n.output.class[0]?.name===e.properties.lookup&&a(4,Q[e.name]="",Q)})),!n._task)return;const r=n._task.event,i=await t.getEvent(r);if(!ye.output?.class?.length)return;const l=ye.output.class[0]?.item.find((e=>(e.refClass||e.name)===i.output.class[0]?.name));(ye.input?.class?.length&&ye.input.class[0].name===i.output.class[0]?.name||l?.asInput)&&(a(59,j=await t.getSchema(r)),a(56,T=r),a(0,A=n._task._id),a(60,C=A?await t.getTask(j.class,n._task.docId):{}),Me(j.class,n?._task?.docId))},async({detail:e})=>{if(a(6,E=e),"quantity"===e.itemName&&a(12,X=Q.quantity),(async(e,t)=>{const n=Ie.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(11,K=!1);for(const o of n){const{selection:n,constraint:r,name:i}=o;if(t)break;a(4,Q[i]="",Q),e===n&&a(11,K=r);const l=Q[n];if(l&&e===r){let e=await Fs(n,l);const t=Q[r];if(t?.length){const n=t[0].split(", ");e=e[r];let o="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(o=t[i])}));a(4,Q[i]=o,Q)}}}}})(e.itemName,e.oldValue===e.value),Ve(e.itemName),$e&&fe&&(e.itemName===fe&&(ke=+e.value),Re()),ue&&me){if(e.itemName===ae?.name)re=e.value;else if(e.itemName===ce?.name)ie=e.value;else{if(e.itemName!==de?.name)return;re=e.value}We()}},async({detail:e})=>{if(!(D.input?.length&&D.input.length>1))return;if(j?.class!==D.input[0])return;const{value:n,lookup:o,view:r}=e;if(!o)return;const[i]=o.split(":"),l=(await t.getSectionView(i,{[r]:{$in:n}})).map((e=>e._id));for(const e of D.input.slice(1)){a(4,Q[e]=[],Q);const n=await t.getSchemaByClass(e);n.id;let o=await t.getTasks(n.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[i]))),o?.length){const n=o.map((e=>e._id)),r=await t.getSectionView(e,{_id:{$in:n}});for(const t of r)t[e]=t._id;a(4,Q[e]=r,Q)}}},({detail:e})=>{Y[e.listName]=e.value,me&&(se[e.listName]=e.amountValue,We()),$e&&(he[e.listName]=e.weeksValue||0,Re())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const n=await t.getReportDoc(e)||{},{userReportId:o}=n;if(o){const e=624,t=900,n="/viewer/doc/"+"index.html?file="+("/api/userreport/"+o)+"&type=pdf";window.open(n,"",`popup=yes toolbar=no width=${e} height=${t}`)}},e=>async()=>{const e=await t.getDocData(A),n=window.screen.height,o=window.open("","_blank","width=800,height="+n+",location=no");await ee(),o?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(e,null,4)+"</textarea>")},async()=>{const e=Ye();if(!e)return;const n=ye.result?.resultDef[0]?.addToReports;if(n){const o=e[n];if(o){const n={docId:o},r=(await t.getSectionView("_task",n))[0];e._taskId=r._id}}const{reportId:o,type:r}=await t.createReport(je,e);Ge(o),setTimeout(Oe,2e3)},async()=>{const e=Ye();if(!e)return;const n=await t.getReportData(je,e),o=window.screen.height,r=window.open("","_blank","width=800,height="+o+",location=no");await ee(),r?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),r?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(n,null,4)+"</textarea>")},async({detail:{className:e,itemName:n,value:o}})=>{if(Ne!==o)return;if(Se.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===Ne))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&Se.set(e,i[0])},({detail:e})=>{F=e},({detail:e})=>{setTimeout((()=>{a(4,Q[e.itemName]=e.value,Q)}),200)},B,M,T,V,W,j,C,function(e){te=e,a(8,te)},function(e){ne=e,a(9,ne)},function(e){we=e,a(14,we)},function(e){Le=e,a(20,Le)}]}class zs extends we{constructor(e){var t;super(),Hl.getElementById("svelte-9xiaib-style")||((t=N("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}",I(Hl.head,t)),be(this,e,Ds,Is,w,{schema:1,recID:2,prevEventID:56,prev:57,taskId:0,description:54,root:3,readonly:55,isStandalone:58},[-1,-1,-1,-1,-1])}}function Ts(e){let t,n,o;function r(t){e[4](t)}let i={schema:e[5],recID:e[6]};return void 0!==e[0]&&(i.description=e[0]),t=new zs({props:i}),G.push((()=>he(t,"description",r))),t.$on("back",e[2]),{c(){ge(t.$$.fragment)},m(e,n){ve(t,e,n),o=!0},p(e,o){const r={};32&o&&(r.schema=e[5]),64&o&&(r.recID=e[6]),!n&&1&o&&(n=!0,r.description=e[0],ne((()=>n=!1))),t.$set(r)},i(e){o||(ue(t.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),o=!1},d(e){ye(t,e)}}}function Vs(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[Ts,({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(){ge(t.$$.fragment)},m(e,o){ve(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.description=e[0]),353&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(ue(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){ye(t,e)}}}function As(e,n,o){let r,{refresh:i}=n;return e.$$set=e=>{"refresh"in e&&o(3,i=e.refresh)},[r,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},i,function(e){r=e,o(0,r)}]}function Bs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os,Ms,Ws=(Os=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return i="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},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==i(e))throw new Error("single-spa-svelte requires a configuration object");var t=o(o({},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 r=Object.keys(l),i=Object.keys(e).reduce((function(t,n){return r.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var r=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=r();t.instance=new e.component(o(o({},i),{},{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)}))}},Os(Ms={exports:{}},Ms.exports),Ms.exports);const Rs=Bs(Ws)({component:class extends we{constructor(e){super(),be(this,e,As,Vs,w,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:Ps,mount:Hs,unmount:Qs}=Rs;e({bootstrap:Ps,mount:Hs,unmount:Qs});e("Form",zs),e("List",xt),e("Template",class extends we{constructor(e){var t;super(),qn.getElementById("svelte-1phofh5-style")||((t=N("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}",I(qn.head,t)),be(this,e,On,An,w,{schema:0,record:1})}})}}}));