New:Socket for Asana Is Now Available.Learn more
Get Started

M2 Zaubertool Add-On

Package Overview
Versions
2
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zaubertool@example.local - firefox Package Compare versions

Comparing version
1.0.3
to
1.0.4
+1
-1
content_scripts_case.js

@@ -1,1 +0,1 @@

(()=>{"use strict";var e={311:(e,t,o)=>{function n(e){const t=document.createElement("style");return t.type="text/css",t.innerText=e,document.head.appendChild(t),t}function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}o.d(t,{XY:()=>r,db:()=>n}),"undefined"!=typeof window&&(window.zaubertoolInject={injectCSS:n,injectJS:function(e){const t=document.createElement("script");return t.type="text/javascript",t.src=e,t.async=!1,(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t),t},injectCSSElement:function(e,t){const o=document.createElement("link");o.rel="stylesheet";try{const t=globalThis.browser;t&&t.runtime&&"function"==typeof t.runtime.getURL?o.href=t.runtime.getURL(e):o.href=e}catch(t){o.href=e}return t&&(o.id=t),(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(o),o},removeInjectedElement:r})},621:(e,t,o)=>{function n(e,t,o){if(e&&(e.value=t,!o))for(let o in e)if(o.startsWith("__reactProps")){e[o].onChange({target:{value:t},currentTarget:e});break}}o.d(t,{e:()=>n})},900:(e,t,o)=>{o.d(t,{nx:()=>a,aQ:()=>i});var n=o(621);const r="ztMod_",i="\n.autocomplete {\n position: relative;\n display: inline-block;\n}\n\n.autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n}\n\n.autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n}\n\n/*when hovering an item:*/\n.autocomplete-items div:hover {\n background-color: #e9e9e9;\n}\n\n/*when navigating through the items using the arrow keys:*/\n.autocomplete-active {\n background-color: DodgerBlue !important;\n color: #ffffff;\n}";function a(e,t=[],o=!1,i,a,s,l,c){if(!e)return;e.setAttribute("autocomplete","off");let u=-1;function d(t){if(i)return String(t?.[i]??t??"");if(c){const o="string"==typeof c?new RegExp(c,"g"):c,n=e?e.value:"",r=n.match(o);return r&&r.length&&r[0]?n.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function m(e,t){if(!t)return!1;if(t=t.toLowerCase(),c){const e="string"==typeof c?new RegExp(c,"g"):c,o=t.match(e);if(!o||!o.length||!o[0])return!1;t=o[0]}return String(d(e)).toLowerCase().includes(t.toLowerCase())}function h(t){if(s&&s.length){var o="";for(let e=0;e<s.length;e++){const n=t[s[e]];if("string"==typeof n&&(o=o+" "+n),Array.isArray(n))for(let e=0;e<n.length;e++)o=o+" "+n[e]}return o.trim()}if(c){const o="string"==typeof c?new RegExp(c,"g"):c,n=e?e.value:"",r=n.match(o);return r&&r.length&&r[0]?n.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function g(t){for(var o=document.getElementsByClassName("autocomplete-items"),n=0;n<o.length;n++)t!=o[n]&&t!=e&&o[n].parentNode.removeChild(o[n])}function f(o){if(!o||!o.value)return;let i,a;g(),u=-1,i=document.createElement("DIV");const s=r+(o.id||"")+"autocomplete-list";i.setAttribute("id",s),i.setAttribute("class","autocomplete-items"),o.parentNode.appendChild(i);for(let o=0;o<t.length;o++){a=document.createElement("DIV");const r=h(t[o]);a.appendChild(document.createTextNode(r));const s=document.createElement("input");s.type="hidden",s.title=d(t[o]),s.value=r,a.appendChild(s),a.addEventListener("click",function(r){const i=this.getElementsByTagName("input")[0].title;(0,n.e)(e,i),g(),"function"==typeof l&&l(t[o])}),i.appendChild(a)}}function y(e){if(!e)return!1;!function(e){if(e)for(let t=0;t<e.length;t++)e[t].classList.remove("autocomplete-active")}(e),u>=e.length&&(u=0),u<0&&(u=e.length-1),e[u].classList.add("autocomplete-active")}o&&e.addEventListener("focusin",function(e){f(this)}),e.addEventListener("input",function(o){let i,a,s=this.value;if(!s)return void f(this);g(),u=-1,i=document.createElement("DIV");const c=r+(this.id||"")+"autocomplete-list";i.setAttribute("id",c),i.setAttribute("class","autocomplete-items"),this.parentNode.appendChild(i);for(let o=0;o<t.length;o++)if(m(t[o],s)){a=document.createElement("DIV");const r=h(t[o]),c=r.toLowerCase().indexOf(s.toLowerCase());if(c<0)a.appendChild(document.createTextNode(r));else{c>0&&a.appendChild(document.createTextNode(r.substring(0,c)));const e=document.createElement("strong");e.textContent=r.substring(c,c+s.length),a.appendChild(e),a.appendChild(document.createTextNode(r.substring(c+s.length)))}const u=document.createElement("input");u.type="hidden",u.title=d(t[o]),u.value=h(t[o]),a.appendChild(u),a.addEventListener("click",function(r){const i=this.getElementsByTagName("input")[0].title;(0,n.e)(e,i),g(),"function"==typeof l&&l(t[o])}),i.appendChild(a)}}),e.addEventListener("keydown",function(e){const t=document.getElementById(r+(this.id||"")+"autocomplete-list");let o=t?t.getElementsByTagName("div"):null;40==e.keyCode?(u++,y(o)):38==e.keyCode?(u--,y(o)):13==e.keyCode&&(e.preventDefault(),u>-1&&o&&o[u].click())}),document.addEventListener("click",function(e){g(e.target&&e.target instanceof Element?e.target:null)})}"undefined"!=typeof window&&(window.zaubertoolAutocomplete={autocomplete:a})}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=["team.m2-loesung.de","team-staging.m2-loesung.de"];function r(e){try{if(!e)return"undefined"!=typeof location&&n.includes(location.hostname);let t="";return t="string"==typeof e?e:e instanceof URL?e.hostname:e.hostname||"",n.includes(t)}catch(e){return!1}}function i(){try{const e=new URL(location.href);if(!r(e))return!1;if(!/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname))return!1;const t=e.searchParams.get("tab");return!!(t&&"overview"===t.toLowerCase()||e.hash&&e.hash.toLowerCase().includes("overview")||location.href.includes("tab=overview")||document.getElementById("comments")||document.querySelector("textarea#comments"))}catch(e){return!1}}const a=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});function s(){const e=["#comments","textarea#comments"];for(let t of e){const e=document.querySelector(t);if(e)return e}return null}function l(e){const t="zt-large-comments-style",o=document.getElementById(t);if(i())if(e){if(o)return;const e=document.createElement("style");e.id=t,e.textContent="textarea#comments, #comments { height: 350px !important; max-height: 350px !important; }",(document.head||document.documentElement).appendChild(e);const n=s();n&&n.style.removeProperty("height"),console.log("Zaubertool: applied large comments style")}else{o&&o.remove();const e=s();e&&e.style.removeProperty("height"),console.log("Zaubertool: removed large comments style")}else if(!e){o&&o.remove();const e=s();e&&e.style.removeProperty("height")}}a.largeCase||(a.largeCase=!0);try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&l(!0)}).catch(()=>{})}catch(e){}try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t&&"largeComments"in e){const t=e.largeComments.newValue;l(Boolean(t))}})}catch(e){}const c=()=>{try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&l(!0)}).catch(()=>{})}catch(e){}};window.addEventListener("popstate",c);const u=history.pushState;history.pushState=function(){const e=u.apply(this,arguments);return c(),e};const d=history.replaceState;history.replaceState=function(){const e=d.apply(this,arguments);return c(),e};var m=o(311),h=o(900);const g=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});g.tasksSuggestions||(g.tasksSuggestions=!0);const f=["auf Antwort von VN warten","auf Antwort von KP warten","Klagereife hergestellt","auf Daten von VN warten","spätestens rückmelden bis","VN nicht erreichbar, löschen","KP anrufen","VN anrufen","schließen, wenn keine Rückmeldung","Posteingang prüfen","Posteingang prüfen (beA)","Achtung! Frist bis","Status Abfragen"];let y=null,p=null,b=!1;function v(){try{const e=new URL(location.href);if(!r(e))return!1;const t=/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname);if(!t)return!1;const o=e.searchParams.get("tab");if(o&&"processing"===o.toLowerCase())return!0;if(e.hash&&e.hash.toLowerCase().includes("processing"))return!0;const n=location.href.includes("tab=processing"),i=Boolean(o&&"processing"===o.toLowerCase())||Boolean(e.hash&&e.hash.toLowerCase().includes("processing"))||n;return console.debug("Zaubertool(tasks): isProcessingTabPage",{href:location.href,hostname:e.hostname,pathMatches:t,queryTab:o,result:i}),!(!document.getElementById("tasks-content")&&!document.querySelector("form[id='add-task-form']"))}catch(e){return console.debug("Zaubertool(tasks): isProcessingTabPage - error",e),!1}}function w(){try{p||(p=(0,m.db)(h.aQ)),console.debug("Zaubertool(tasks): suggestionSetterTasks - injected CSS",{cssElId:p?.id||null});const e=document.getElementById("tasks-content")||document.body,t={attributes:!1,childList:!0,subtree:!0},o=(e,t)=>{console.debug("Zaubertool(tasks): mutation callback",{mutationCount:e?.length||0});const o=document.querySelectorAll("form[id='add-task-form']");console.debug("Zaubertool(tasks): found add-task forms",{count:o?.length||0}),o&&o.length&&o.forEach(e=>{!function(e){if(e)try{console.debug("Zaubertool(tasks): attachToAddTaskForm called",{formId:e.id});const t=e.dataset?e.dataset.zaubertoolAutocomplete:void 0,o=e.getAttribute("data-zaubertool-autocomplete");if(t||"1"===o)return;const n=e.querySelector('input[type="text"], input:not([type]), textarea');if(!n)return;console.debug("Zaubertool(tasks): attachToAddTaskForm - attaching autocomplete",{formId:e.id,inputId:n.id||null,tagName:n.tagName});try{e.dataset?e.dataset.zaubertoolAutocomplete="1":e.setAttribute("data-zaubertool-autocomplete","1")}catch(t){e.setAttribute("data-zaubertool-autocomplete","1")}(0,h.nx)(n,f,!0)}catch(e){console.error("Zaubertool(tasks): attachToAddTaskForm error",e)}}(e)})};o(),y=new MutationObserver(o),y.observe(e,t),console.debug("Zaubertool(tasks): suggestionSetterTasks - MutationObserver connected",{target:e?.id||e?.tagName})}catch(e){console.error("Zaubertool(tasks): suggestionSetterTasks - error",e)}}function E(){try{p||(p=(0,m.db)(h.aQ)),console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - injected CSS",{cssElId:p?.id||null});const e=document.getElementById("nextTaskAtTitle");console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - found nextTaskAtTitle",{found:!!e,elId:e?.id||null}),e&&(0,h.nx)(e,f,!0)}catch(e){console.error("Zaubertool(tasks): suggestionSetterFirstContactTask - error",e)}}function L(){b?console.debug("Zaubertool(tasks): init - already initialized"):(b=!0,v()?(console.log("Zaubertool(tasks): init - initializing suggestions"),w(),E()):console.debug("Zaubertool(tasks): init - not a processing page; aborting init"))}const S={init:L,destroy:function(){b=!1,console.log("Zaubertool(tasks): destroy - cleaning up");try{y&&(console.debug("Zaubertool(tasks): destroy - disconnecting observer"),y.disconnect(),y=null)}catch(e){console.error("Zaubertool(tasks): destroy - observer disconnect error",e)}try{p&&(console.debug("Zaubertool(tasks): destroy - removing injected css"),(0,m.XY)(p),p=null)}catch(e){console.error("Zaubertool(tasks): destroy - css removal error",e)}},suggestionSetterTasks:w,suggestionSetterFirstContactTask:E,isProcessingTabPage:v};try{v()&&L()}catch(e){}var x=o(621);const T=["@kabelmail.de","@arcor.de","@netcologne.de","@yahoo.com","@myyahoo.com","@gmail.com","@outlook.de","@outlook.com","@web.de","@live.com","@live.de","@icloud.com","@hotmail.com","@hotmail.de","@protonmail.com","@t-online.de","@freenet.de","@unitybox.de","@gmx.de","@gmx.net","@posteo.de","@aol.com"],A=["policyholderAttributes.email","conflictPartnerAttributes.email","contactPersonAttributes.email","conflictContactAttributes.email"],k=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});k.emailAutocomplete||(k.emailAutocomplete=!0);let O=null,C=null,Z=!1;const _=new Map;function M(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const o=document.getElementById(e);if(o){const e=o.querySelector("input, textarea");if(e)return e}const n=e.split("."),r=n[n.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function D(e){if(!e)return;if(_.has(e))return;console.debug("Zaubertool(email): setup for",{id:e.id,name:e.getAttribute("name")}),O||(O=(0,m.db)(h.aQ));const t=t=>{try{const o=t.clipboardData?.getData("text")||"",n=o.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@");if(n!==o){t.preventDefault();const r=e.selectionStart||0,i=e.selectionEnd||0,a=e.value.substring(0,r)+n+e.value.substring(i||r);(0,x.e)(e,a);try{const t=r+n.length;e.selectionStart=e.selectionEnd=t}catch(e){}console.debug("Zaubertool(email): paste sanitized",{pasteText:o,sanitized:n,newVal:a})}}catch(e){console.error("Zaubertool(email): paste handler error",e)}},o=t=>{try{let t=e.value||"";const o=/\(\s*at\s*\)|\[\s*at\s*\]/gi;if(o.test(t))try{const n=e.selectionStart||0;let r=0;for(const e of Array.from(t.matchAll(o)))"number"==typeof e.index&&e.index<n&&(r+=e[0].length-1);const i=t.replace(o,"@");if(i!==t){(0,x.e)(e,i);const o=Math.max(0,n-r);setTimeout(()=>{try{e.selectionStart=e.selectionEnd=o}catch(e){}},0),t=i,console.debug("Zaubertool(email): live paste replacement performed",{old:e.value,newValue:i})}}catch(e){console.error("Zaubertool(email): live replacement error",e)}const n=t.trim();t!==n&&((0,x.e)(e,n),t=n,console.debug("Zaubertool(email): trimmed value",{newValue:n})),/@\s*$/.test(t)&&console.debug("Zaubertool(email): found trailing @ - suggestions available",{id:e.id,value:t})}catch(e){console.error("Zaubertool(email): input handler error",e)}},n=()=>{try{const o=e.value||"",n=(t=o)?t.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@").trim():t;o!==n&&((0,x.e)(e,n),console.debug("Zaubertool(email): blur sanitized",{old:o,new:n}))}catch(e){console.error("Zaubertool(email): blur error",e)}var t};e.addEventListener("paste",t),e.addEventListener("input",o),e.addEventListener("blur",n);try{(0,h.nx)(e,T,!1,void 0,void 0,void 0,void 0,"@(.*)")}catch(e){}_.set(e,{input:o,paste:t,blur:n})}function P(){Z||(Z=!0,i()?(console.log("Zaubertool(email): initializing"),O||(O=(0,m.db)(h.aQ)),function(){for(let e of A){const t=M(e);t?D(t):console.debug("Zaubertool(email): field not found",{id:e})}}(),C=new MutationObserver(e=>{try{for(let t of e)for(let e of A){const t=M(e);t&&!_.has(t)&&(console.debug("Zaubertool(email): MutationObserver found field; attaching",{id:e}),D(t))}}catch(e){console.error("Zaubertool(email): mutation observer error",e)}}),C.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(email): not on overview processing page, skipping init"))}const B={init:P,destroy:function(){Z=!1,console.log("Zaubertool(email): destroy");try{C&&(C.disconnect(),C=null)}catch(e){console.error("Zaubertool(email): destroy observer error",e)}try{for(const[e,t]of _.entries())try{e.removeEventListener("input",t.input),e.removeEventListener("paste",t.paste),e.removeEventListener("blur",t.blur)}catch(e){}_.clear()}catch(e){console.error("Zaubertool(email): destroy handlers error",e)}try{O&&((0,m.XY)(O),O=null)}catch(e){console.error("Zaubertool(email): destroy css error",e)}}};try{browser.storage.local.get({emailAutocomplete:!1}).then(e=>{Boolean(e.emailAutocomplete)&&i()&&P()}).catch(()=>{})}catch(e){}const z=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});z.relationAutocomplete||(z.relationAutocomplete=!0);const I=["Ehefrau","Ehemann","Tochter","Sohn","Vater","Mutter","Partnerin","Partner","Prokurist/in","Vertreter/in","Übersetzer/in"],U=["contactPersonAttributes.relationToPolicyholder"];let N=null,R=null,q=!1;const $=new Map;function V(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const o=document.getElementById(e);if(o){const e=o.querySelector("input, textarea");if(e)return e}const n=e.split("."),r=n[n.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function j(e){if(!e)return;if($.has(e))return;console.debug("Zaubertool(relation): setup for",{id:e.id,name:e.getAttribute("name")}),N||(N=(0,m.db)(h.aQ));const t=t=>{try{const t=e.value||"";t&&t.trim().length}catch(e){console.error("Zaubertool(relation) input handler error",e)}};e.addEventListener("input",t);try{(0,h.nx)(e,I,!0)}catch(e){}$.set(e,{input:t})}function F(){q||(q=!0,i()?(console.log("Zaubertool(relation): initializing"),N||(N=(0,m.db)(h.aQ)),function(){for(let e of U){const t=V(e);t?j(t):console.debug("Zaubertool(relation): field not found",{id:e})}}(),R=new MutationObserver(e=>{try{for(let t of e)for(let e of U){const t=V(e);t&&!$.has(t)&&(console.debug("Zaubertool(relation): MutationObserver found field; attaching",{id:e}),j(t))}}catch(e){console.error("Zaubertool(relation): mutation observer error",e)}}),R.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(relation): not on overview processing page, skipping init"))}const H={init:F,destroy:function(){q=!1,console.log("Zaubertool(relation): destroy");try{R&&(R.disconnect(),R=null)}catch(e){console.error("Zaubertool(relation): destroy observer error",e)}try{for(const[e,t]of $.entries())try{e.removeEventListener("input",t.input)}catch(e){}$.clear()}catch(e){console.error("Zaubertool(relation): destroy handlers error",e)}try{N&&((0,m.XY)(N),N=null)}catch(e){console.error("Zaubertool(relation): destroy css error",e)}}};try{browser.storage.local.get({relationSuggestions:!1}).then(e=>{Boolean(e.relationSuggestions)&&i()&&F()}).catch(()=>{})}catch(e){}let Q=null;const W=new Map;function X(e){const t=e;if(!t)return{destroy:()=>{}};if(W.has(t))return W.get(t);const o=t.querySelector(".MuiDialogTitle-root")||t.querySelector("h2")||null;if(!o)return{destroy:()=>{}};o.classList.add("zt-draggable-handle");let n=0,r=0,i=0,a=0,s=!1,l="",c="",u="",d="",m="",h="",g="";function f(e){try{e.preventDefault(),s=!0;const o=e.touches?e.touches[0]:e;n=o.clientX,r=o.clientY;const f=t.getBoundingClientRect(),b=window.getComputedStyle(t);i=f.left,a=f.top,l=t.style.position||"",c=t.style.left||"",u=t.style.top||"",d=t.style.width||"",m=t.style.height||"",h=t.style.maxHeight||"",g=t.style.transform||"",t.style.position="fixed",t.style.width=`${Math.round(f.width)}px`,t.style.height=`${Math.round(f.height)}px`,b&&b.maxHeight&&(t.style.maxHeight=b.maxHeight),t.style.transform="none",t.style.left=`${i}px`,t.style.top=`${a}px`,window.addEventListener("mousemove",y,!0),window.addEventListener("mouseup",p,!0),window.addEventListener("touchmove",y,{passive:!1}),window.addEventListener("touchend",p,!0)}catch(e){}}function y(e){if(s)try{const o=e.touches?e.touches[0]:e,s=o.clientX-n,l=o.clientY-r;t.style.left=`${i+s}px`,t.style.top=`${a+l}px`,e.preventDefault()}catch(e){}}function p(){s&&(s=!1,window.removeEventListener("mousemove",y,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("touchmove",y,!0),window.removeEventListener("touchend",p,!0))}o.addEventListener("mousedown",f,!0),o.addEventListener("touchstart",f,{passive:!1});const b={destroy:()=>{try{o.removeEventListener("mousedown",f,!0),o.removeEventListener("touchstart",f,!0),window.removeEventListener("mousemove",y,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("touchmove",y,!0),window.removeEventListener("touchend",p,!0),o.classList.remove("zt-draggable-handle"),""===l?t.style.removeProperty("position"):t.style.position=l,""===c?t.style.removeProperty("left"):t.style.left=c,""===u?t.style.removeProperty("top"):t.style.top=u,""===d?t.style.removeProperty("width"):t.style.width=d,""===m?t.style.removeProperty("height"):t.style.height=m,""===h?t.style.removeProperty("max-height"):t.style.maxHeight=h,""===g?t.style.removeProperty("transform"):t.style.transform=g}catch(e){}}};return W.set(t,b),b}function Y(){try{!function(){const e="zt-draggable-modal-css";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .zt-draggable-handle { cursor: move; user-select: none; }\n ",document.head.appendChild(t)}();const e=Array.from(document.querySelectorAll(".MuiDialog-paper, dialog, .dialog, .modal"));for(const t of e)W.has(t)||X(t)}catch(e){}}const K={init:function(){try{if(Y(),Q)return;Q=new MutationObserver(e=>{for(const t of e)t.target.querySelector&&Y()}),Q.observe(document.body,{childList:!0,subtree:!0})}catch(e){}},destroy:function(){try{Q&&(Q.disconnect(),Q=null);for(const[e,t]of W.entries())try{t.destroy()}catch(e){}W.clear()}catch(e){}}};globalThis.__ZAUBERTOOL_MODULE_LOADED=globalThis.__ZAUBERTOOL_MODULE_LOADED||{},globalThis.__ZAUBERTOOL_MODULE_LOADED.draggableModals=!0;let G=null,J=null,ee=!1;function te(){if(!G)return;const e=window.devicePixelRatio||1;G.width=Math.floor(window.innerWidth*e),G.height=Math.floor(window.innerHeight*e),G.style.width=`${window.innerWidth}px`,G.style.height=`${window.innerHeight}px`;const t=G.getContext("2d");t&&t.scale(e,e)}function oe(){ee&&(J&&cancelAnimationFrame(J),J=null,G&&(G.remove(),G=null),window.removeEventListener("resize",te),ee=!1)}function ne(e){return"zt_case_settings_"+e}async function re(e){try{const t=ne(e),o=await browser.storage.local.get(t);if(console.debug("zt.caseSettings.getCaseSettings",{key:t,obj:o}),o&&Object.prototype.hasOwnProperty.call(o,t)){return o[t]||null}return null}catch(t){return console.warn("zt.caseSettings.getCaseSettings error",{caseId:e,error:t}),null}}async function ie(e){return async function(e,t){try{const o=await re(e);return o&&Object.prototype.hasOwnProperty.call(o,t)?o[t]:null}catch(o){return console.warn("zt.caseSettings.getCaseSetting error",{caseId:e,name:t,error:o}),null}}(e,"progressState")}async function ae(e,t){try{if(null==t)return;const o=await re(e)||{};o.progressState=t,o.updatedAt=new Date,await async function(e,t){try{const o=ne(e);null==t?(await browser.storage.local.remove(o),console.debug("zt.caseSettings.setCaseSettings remove",{key:o})):(await browser.storage.local.set({[o]:t}),console.debug("zt.caseSettings.setCaseSettings set",{key:o,settings:t}))}catch(t){console.warn("zt.caseSettings.setCaseSettings error",{caseId:e,error:t})}}(e,o)}catch(e){}}new Map;const se=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});se.gamefication||(se.gamefication=!0);let le=null,ce=null,ue=null,de=!1,me=null,he=null,ge=null;async function fe(){try{const e=function(){try{const e=location.pathname.match(/\/cases\/([^/]+)/i)||location.pathname.match(/\/case\/([^/]+)/i);if(e&&e[1])return e[1]}catch(e){}return null}();if(!e)return void(ue=null);ue=e;const t=document.querySelector("header.MuiPaper-root.MuiPaper")||document.querySelector("header")||document.querySelector(".MuiPaper-root.MuiPaper"),o=function(e){if(!e)return"none";try{const t=Array.from(e.querySelectorAll('button, a, [role="button"]'));let o=!1,n=!1;for(const e of t){const t=(e.textContent||"").trim(),r=(t.normalize&&t.normalize("NFKD")?t.normalize("NFKD"):t).replace(/[\u0300-\u036f]/g,"").toLowerCase();r&&(r.includes("nachricht")&&r.includes("m2")&&(n=!0),r.includes("bearbeitung")&&r.includes("abschliessen")&&(o=!0))}return n?"completed":o?"in_progress":"none"}catch(e){return"none"}}(t),n=await ie(e);if(await re(e),n!==o&&(n||"none"!==o?await ae(e,"none"===o?null:o):await ae(e,"in_progress"),"in_progress"===n&&"completed"===o))try{!function(e=4e3){if(ee)return;ee=!0,G=function(){const e=document.createElement("canvas");e.id="zt-gamification-canvas",e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.zIndex="999999999",e.style.pointerEvents="none";const t=window.devicePixelRatio||1;e.width=Math.floor(window.innerWidth*t),e.height=Math.floor(window.innerHeight*t),e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`;const o=e.getContext("2d");return o&&o.scale(t,t),e}(),document.body.appendChild(G);const t=G.getContext("2d"),o=[],n=(e,t)=>Math.random()*(t-e)+e,r=Math.max(3,Math.floor(window.innerWidth/300));let i=0;const a=setInterval(()=>{!function(e,t){for(let r=0;r<40;r++){const r=Math.random()*Math.PI*2,i=n(2,8),a={x:e,y:t,vx:Math.cos(r)*i,vy:Math.sin(r)*i,life:n(60,120),age:0,size:n(1,3),color:`hsl(${n(0,360)}, ${n(50,100)}%, ${n(50,70)}%)`};o.push(a)}}(n(100,window.innerWidth-100),n(100,window.innerHeight/2)),i++,i>=r&&clearInterval(a)},300);!function e(){if(G){t.clearRect(0,0,G.width,G.height);for(let e=o.length-1;e>=0;e--){const n=o[e];n.x+=n.vx,n.y+=n.vy,n.vy+=.05,n.vx*=.99,n.vy*=.99,n.age++;const r=Math.max(0,1-n.age/n.life);t.beginPath(),t.fillStyle=n.color,t.globalAlpha=r,t.arc(n.x,n.y,n.size,0,2*Math.PI),t.fill(),t.globalAlpha=1,n.age>n.life&&o.splice(e,1)}J=requestAnimationFrame(e)}}(),window.addEventListener("resize",te),setTimeout(()=>{oe()},e+500)}(3e3)}catch(e){}if(ce){try{ce.disconnect()}catch(e){}ce=null}t&&(ce=new MutationObserver(()=>{setTimeout(()=>fe(),40)}),ce.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-hidden"]}))}catch(e){}}async function ye(){try{await fe()}catch(e){}}function pe(){if(!le)try{fe(),de||(me=history.pushState,history.pushState=function(){const e=me.apply(this,arguments);return setTimeout(()=>{fe()},40),e},he=history.replaceState,history.replaceState=function(){const e=he.apply(this,arguments);return setTimeout(()=>{fe()},40),e},ge=()=>{fe()},window.addEventListener("popstate",ge),de=!0)}catch(e){}}const be={init:pe,destroy:function(){le&&(document.body.removeEventListener("click",le,!0),le=null);try{oe()}catch(e){}try{ce&&(ce.disconnect(),ce=null)}catch(e){}try{de&&(me&&(history.pushState=me),he&&(history.replaceState=he),ge&&window.removeEventListener("popstate",ge),de=!1,me=null,he=null,ge=null)}catch(e){}}};try{browser.storage.local.get({gamification:!1}).then(e=>{Boolean(e.gamification)&&pe()}).catch(()=>{})}catch(e){}let ve=!1,we=!1,Ee=!1,Le=!1,Se=!1,xe=null,Te=null;async function Ae(){if(!ve){ve=!0;try{be&&be.init&&be.init()}catch(e){console.error("Zaubertool(case): enableGamification error",e)}}}async function ke(){if(ve){ve=!1;try{be&&be.destroy&&be.destroy()}catch(e){console.error("Zaubertool(case): disableGamification error",e)}}}browser.runtime.onMessage.addListener(async e=>{if(e&&e.id)switch(e.id){case"large-comments":l("On"===e.value);break;case"gamification":"On"===e.value?await Ae():await ke();break;case"email-autocomplete":we="On"===e.value,we&&i()?B&&B.init&&B.init():B&&B.destroy&&B.destroy();break;case"relation-suggestions":Le="On"===e.value,Le&&i()?H&&H.init&&H.init():H&&H.destroy&&H.destroy();break;case"draggable-modals":Ee="On"===e.value,Ee?K&&K.init&&K.init():K&&K.destroy&&K.destroy()}});try{S&&S.isProcessingTabPage&&S.isProcessingTabPage()&&S.init&&S.init(),Ee&&K&&K.init&&K.init&&K.init()}catch(e){}const Oe=async()=>{try{S&&S.isProcessingTabPage&&S.isProcessingTabPage()?S.init&&S.init():S.destroy&&S.destroy(),we&&i()?B&&B.init&&B.init():B&&B.destroy&&B.destroy(),Le&&i()?H&&H.init&&H.init():H&&H.destroy&&H.destroy(),Ee?K.init&&K.init():K.destroy&&K.destroy(),ve&&ye&&ye&&ye()}catch(e){}};window.addEventListener("popstate",Oe);const Ce=history.pushState;history.pushState=function(){const e=Ce.apply(this,arguments);return Oe(),e};const Ze=history.replaceState;history.replaceState=function(){const e=Ze.apply(this,arguments);return Oe(),e};try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t){if("gamification"in e){const t=e.gamification.newValue;Boolean(t)?Ae():ke()}if("emailAutocomplete"in e){const t=e.emailAutocomplete.newValue;we=Boolean(t),we&&i()?B.init&&B.init():B.destroy&&B.destroy()}if("draggableModals"in e){const t=e.draggableModals.newValue;Ee=Boolean(t),Ee?K.init&&K.init():K&&K.destroy&&K.destroy()}if("relationSuggestions"in e){const t=e.relationSuggestions.newValue;Le=Boolean(t),Le&&i()?H.init&&H.init():H.destroy&&H.destroy()}}})}catch(e){}try{(function(){try{if(Se)return;Se=!0;const e=e=>{try{const t=e.target;if(!t)return;t.closest('[role="tab"], [data-tab], a[href*="tab="]')&&(Te&&window.clearTimeout(Te),Te=window.setTimeout(()=>Oe(),40))}catch(e){}};document.body.addEventListener("click",e,!0),document.addEventListener("visibilitychange",Oe),window.addEventListener("focus",Oe);const t=e=>{try{for(const t of e){if("attributes"===t.type){const e=t.attributeName;if("class"===e||"aria-selected"===e){Te&&window.clearTimeout(Te),Te=window.setTimeout(()=>Oe(),40);break}}if("childList"===t.type&&t.addedNodes&&t.addedNodes.length>0){Te&&window.clearTimeout(Te),Te=window.setTimeout(()=>Oe(),40);break}}}catch(e){}};let o=document;const n=document.querySelector('[role="tablist"]');if(n)o=n;else{const e=document.querySelector("#tabs, .tabs, .tablist, [data-tabs]");e&&(o=e)}xe=new MutationObserver(t),xe.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","aria-selected"]})}catch(e){}})(),async function(){try{const e=await browser.storage.local.get({gamification:!1,emailAutocomplete:!1,relationSuggestions:!1,draggableModals:!1});ve=Boolean(e.gamification),we=Boolean(e.emailAutocomplete),Le=Boolean(e.relationSuggestions),Ee=Boolean(e.draggableModals),ve&&await Ae(),we&&i()&&B&&B.init&&B.init(),Le&&i()&&H&&H.init&&H.init(),Ee&&K&&K.init&&K.init()}catch(e){}}().then(()=>Oe()).catch(()=>{})}catch(e){}})();
(()=>{"use strict";var e={311:(e,t,o)=>{function n(e){const t=document.createElement("style");return t.type="text/css",t.innerText=e,document.head.appendChild(t),t}function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}o.d(t,{XY:()=>r,db:()=>n}),"undefined"!=typeof window&&(window.zaubertoolInject={injectCSS:n,injectJS:function(e){const t=document.createElement("script");return t.type="text/javascript",t.src=e,t.async=!1,(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t),t},injectCSSElement:function(e,t){const o=document.createElement("link");o.rel="stylesheet";try{const t=globalThis.browser;t&&t.runtime&&"function"==typeof t.runtime.getURL?o.href=t.runtime.getURL(e):o.href=e}catch(t){o.href=e}return t&&(o.id=t),(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(o),o},removeInjectedElement:r})},621:(e,t,o)=>{function n(e,t,o){if(e&&(e.value=t,!o))for(let o in e)if(o.startsWith("__reactProps")){e[o].onChange({target:{value:t},currentTarget:e});break}}o.d(t,{e:()=>n})},900:(e,t,o)=>{o.d(t,{nx:()=>i,aQ:()=>a});var n=o(621);const r="ztMod_",a="\n.autocomplete {\n position: relative;\n display: inline-block;\n}\n\n.autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n}\n\n.autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n}\n\n/*when hovering an item:*/\n.autocomplete-items div:hover {\n background-color: #e9e9e9;\n}\n\n/*when navigating through the items using the arrow keys:*/\n.autocomplete-active {\n background-color: DodgerBlue !important;\n color: #ffffff;\n}";function i(e,t=[],o=!1,a,i,l,s,c){if(!e)return;e.setAttribute("autocomplete","off");let u=-1;function d(t){if(a)return String(t?.[a]??t??"");if(c){const o="string"==typeof c?new RegExp(c,"g"):c,n=e?e.value:"",r=n.match(o);return r&&r.length&&r[0]?n.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function m(e,t){if(!t)return!1;if(t=t.toLowerCase(),c){const e="string"==typeof c?new RegExp(c,"g"):c,o=t.match(e);if(!o||!o.length||!o[0])return!1;t=o[0]}return String(d(e)).toLowerCase().includes(t.toLowerCase())}function g(t){if(l&&l.length){var o="";for(let e=0;e<l.length;e++){const n=t[l[e]];if("string"==typeof n&&(o=o+" "+n),Array.isArray(n))for(let e=0;e<n.length;e++)o=o+" "+n[e]}return o.trim()}if(c){const o="string"==typeof c?new RegExp(c,"g"):c,n=e?e.value:"",r=n.match(o);return r&&r.length&&r[0]?n.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function h(t){for(var o=document.getElementsByClassName("autocomplete-items"),n=0;n<o.length;n++)t!=o[n]&&t!=e&&o[n].parentNode.removeChild(o[n])}function f(o){if(!o||!o.value)return;let a,i;h(),u=-1,a=document.createElement("DIV");const l=r+(o.id||"")+"autocomplete-list";a.setAttribute("id",l),a.setAttribute("class","autocomplete-items"),o.parentNode.appendChild(a);for(let o=0;o<t.length;o++){i=document.createElement("DIV");const r=g(t[o]);i.appendChild(document.createTextNode(r));const l=document.createElement("input");l.type="hidden",l.title=d(t[o]),l.value=r,i.appendChild(l),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,n.e)(e,a),h(),"function"==typeof s&&s(t[o])}),a.appendChild(i)}}function p(e){if(!e)return!1;!function(e){if(e)for(let t=0;t<e.length;t++)e[t].classList.remove("autocomplete-active")}(e),u>=e.length&&(u=0),u<0&&(u=e.length-1),e[u].classList.add("autocomplete-active")}o&&e.addEventListener("focusin",function(e){f(this)}),e.addEventListener("input",function(o){let a,i,l=this.value;if(!l)return void f(this);h(),u=-1,a=document.createElement("DIV");const c=r+(this.id||"")+"autocomplete-list";a.setAttribute("id",c),a.setAttribute("class","autocomplete-items"),this.parentNode.appendChild(a);for(let o=0;o<t.length;o++)if(m(t[o],l)){i=document.createElement("DIV");const r=g(t[o]),c=r.toLowerCase().indexOf(l.toLowerCase());if(c<0)i.appendChild(document.createTextNode(r));else{c>0&&i.appendChild(document.createTextNode(r.substring(0,c)));const e=document.createElement("strong");e.textContent=r.substring(c,c+l.length),i.appendChild(e),i.appendChild(document.createTextNode(r.substring(c+l.length)))}const u=document.createElement("input");u.type="hidden",u.title=d(t[o]),u.value=g(t[o]),i.appendChild(u),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,n.e)(e,a),h(),"function"==typeof s&&s(t[o])}),a.appendChild(i)}}),e.addEventListener("keydown",function(e){const t=document.getElementById(r+(this.id||"")+"autocomplete-list");let o=t?t.getElementsByTagName("div"):null;40==e.keyCode?(u++,p(o)):38==e.keyCode?(u--,p(o)):13==e.keyCode&&(e.preventDefault(),u>-1&&o&&o[u].click())}),document.addEventListener("click",function(e){h(e.target&&e.target instanceof Element?e.target:null)})}"undefined"!=typeof window&&(window.zaubertoolAutocomplete={autocomplete:i})}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=["team.m2-loesung.de","team-staging.m2-loesung.de"];function r(e){try{if(!e)return"undefined"!=typeof location&&n.includes(location.hostname);let t="";return t="string"==typeof e?e:e instanceof URL?e.hostname:e.hostname||"",n.includes(t)}catch(e){return!1}}function a(){try{const e=new URL(location.href);if(!r(e))return!1;if(!/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname))return!1;const t=e.searchParams.get("tab");return!!(t&&"overview"===t.toLowerCase()||e.hash&&e.hash.toLowerCase().includes("overview")||location.href.includes("tab=overview")||document.getElementById("comments")||document.querySelector("textarea#comments"))}catch(e){return!1}}const i=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});function l(){const e=["#comments","textarea#comments"];for(let t of e){const e=document.querySelector(t);if(e)return e}return null}function s(e){const t="zt-large-comments-style",o=document.getElementById(t);if(a())if(e){if(o)return;const e=document.createElement("style");e.id=t,e.textContent="textarea#comments, #comments { height: 350px !important; max-height: 350px !important; }",(document.head||document.documentElement).appendChild(e);const n=l();n&&n.style.removeProperty("height"),console.log("Zaubertool: applied large comments style")}else{o&&o.remove();const e=l();e&&e.style.removeProperty("height"),console.log("Zaubertool: removed large comments style")}else if(!e){o&&o.remove();const e=l();e&&e.style.removeProperty("height")}}i.largeCase||(i.largeCase=!0);try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&s(!0)}).catch(()=>{})}catch(e){}try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t&&"largeComments"in e){const t=e.largeComments.newValue;s(Boolean(t))}})}catch(e){}const c=()=>{try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&s(!0)}).catch(()=>{})}catch(e){}};window.addEventListener("popstate",c);const u=history.pushState;history.pushState=function(){const e=u.apply(this,arguments);return c(),e};const d=history.replaceState;history.replaceState=function(){const e=d.apply(this,arguments);return c(),e};var m=o(311),g=o(900);const h=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});h.tasksSuggestions||(h.tasksSuggestions=!0);const f=["auf Antwort von VN warten","auf Antwort von KP warten","Klagereife hergestellt","auf Daten von VN warten","spätestens rückmelden bis","VN nicht erreichbar, löschen","KP anrufen","VN anrufen","schließen, wenn keine Rückmeldung","Posteingang prüfen","Posteingang prüfen (beA)","Achtung! Frist bis","Status Abfragen"];let p=null,y=null,b=!1;function v(){try{const e=new URL(location.href);if(!r(e))return!1;const t=/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname);if(!t)return!1;const o=e.searchParams.get("tab");if(o&&"processing"===o.toLowerCase())return!0;if(e.hash&&e.hash.toLowerCase().includes("processing"))return!0;const n=location.href.includes("tab=processing"),a=Boolean(o&&"processing"===o.toLowerCase())||Boolean(e.hash&&e.hash.toLowerCase().includes("processing"))||n;return console.debug("Zaubertool(tasks): isProcessingTabPage",{href:location.href,hostname:e.hostname,pathMatches:t,queryTab:o,result:a}),!(!document.getElementById("tasks-content")&&!document.querySelector("form[id='add-task-form']"))}catch(e){return console.debug("Zaubertool(tasks): isProcessingTabPage - error",e),!1}}function w(){try{y||(y=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterTasks - injected CSS",{cssElId:y?.id||null});const e=document.getElementById("tasks-content")||document.body,t={attributes:!1,childList:!0,subtree:!0},o=(e,t)=>{console.debug("Zaubertool(tasks): mutation callback",{mutationCount:e?.length||0});const o=document.querySelectorAll("form[id='add-task-form']");console.debug("Zaubertool(tasks): found add-task forms",{count:o?.length||0}),o&&o.length&&o.forEach(e=>{!function(e){if(e)try{console.debug("Zaubertool(tasks): attachToAddTaskForm called",{formId:e.id});const t=e.dataset?e.dataset.zaubertoolAutocomplete:void 0,o=e.getAttribute("data-zaubertool-autocomplete");if(t||"1"===o)return;const n=e.querySelector('input[type="text"], input:not([type]), textarea');if(!n)return;console.debug("Zaubertool(tasks): attachToAddTaskForm - attaching autocomplete",{formId:e.id,inputId:n.id||null,tagName:n.tagName});try{e.dataset?e.dataset.zaubertoolAutocomplete="1":e.setAttribute("data-zaubertool-autocomplete","1")}catch(t){e.setAttribute("data-zaubertool-autocomplete","1")}(0,g.nx)(n,f,!0)}catch(e){console.error("Zaubertool(tasks): attachToAddTaskForm error",e)}}(e)})};o(),p=new MutationObserver(o),p.observe(e,t),console.debug("Zaubertool(tasks): suggestionSetterTasks - MutationObserver connected",{target:e?.id||e?.tagName})}catch(e){console.error("Zaubertool(tasks): suggestionSetterTasks - error",e)}}function E(){try{y||(y=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - injected CSS",{cssElId:y?.id||null});const e=document.getElementById("nextTaskAtTitle");console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - found nextTaskAtTitle",{found:!!e,elId:e?.id||null}),e&&(0,g.nx)(e,f,!0)}catch(e){console.error("Zaubertool(tasks): suggestionSetterFirstContactTask - error",e)}}function x(){b?console.debug("Zaubertool(tasks): init - already initialized"):(b=!0,v()?(console.log("Zaubertool(tasks): init - initializing suggestions"),w(),E()):console.debug("Zaubertool(tasks): init - not a processing page; aborting init"))}const S={init:x,destroy:function(){b=!1,console.log("Zaubertool(tasks): destroy - cleaning up");try{p&&(console.debug("Zaubertool(tasks): destroy - disconnecting observer"),p.disconnect(),p=null)}catch(e){console.error("Zaubertool(tasks): destroy - observer disconnect error",e)}try{y&&(console.debug("Zaubertool(tasks): destroy - removing injected css"),(0,m.XY)(y),y=null)}catch(e){console.error("Zaubertool(tasks): destroy - css removal error",e)}},suggestionSetterTasks:w,suggestionSetterFirstContactTask:E,isProcessingTabPage:v};try{v()&&x()}catch(e){}var L=o(621);const A=["@kabelmail.de","@arcor.de","@netcologne.de","@yahoo.com","@myyahoo.com","@gmail.com","@outlook.de","@outlook.com","@web.de","@live.com","@live.de","@icloud.com","@hotmail.com","@hotmail.de","@protonmail.com","@t-online.de","@freenet.de","@unitybox.de","@gmx.de","@gmx.net","@posteo.de","@aol.com"],C=["policyholderAttributes.email","conflictPartnerAttributes.email","contactPersonAttributes.email","conflictContactAttributes.email"],M=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});M.emailAutocomplete||(M.emailAutocomplete=!0);let k=null,T=null,D=!1;const O=new Map;function Z(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const o=document.getElementById(e);if(o){const e=o.querySelector("input, textarea");if(e)return e}const n=e.split("."),r=n[n.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function _(e){if(!e)return;if(O.has(e))return;console.debug("Zaubertool(email): setup for",{id:e.id,name:e.getAttribute("name")}),k||(k=(0,m.db)(g.aQ));const t=t=>{try{const o=t.clipboardData?.getData("text")||"",n=o.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@");if(n!==o){t.preventDefault();const r=e.selectionStart||0,a=e.selectionEnd||0,i=e.value.substring(0,r)+n+e.value.substring(a||r);(0,L.e)(e,i);try{const t=r+n.length;e.selectionStart=e.selectionEnd=t}catch(e){}console.debug("Zaubertool(email): paste sanitized",{pasteText:o,sanitized:n,newVal:i})}}catch(e){console.error("Zaubertool(email): paste handler error",e)}},o=t=>{try{let t=e.value||"";const o=/\(\s*at\s*\)|\[\s*at\s*\]/gi;if(o.test(t))try{const n=e.selectionStart||0;let r=0;for(const e of Array.from(t.matchAll(o)))"number"==typeof e.index&&e.index<n&&(r+=e[0].length-1);const a=t.replace(o,"@");if(a!==t){(0,L.e)(e,a);const o=Math.max(0,n-r);setTimeout(()=>{try{e.selectionStart=e.selectionEnd=o}catch(e){}},0),t=a,console.debug("Zaubertool(email): live paste replacement performed",{old:e.value,newValue:a})}}catch(e){console.error("Zaubertool(email): live replacement error",e)}const n=t.trim();t!==n&&((0,L.e)(e,n),t=n,console.debug("Zaubertool(email): trimmed value",{newValue:n})),/@\s*$/.test(t)&&console.debug("Zaubertool(email): found trailing @ - suggestions available",{id:e.id,value:t})}catch(e){console.error("Zaubertool(email): input handler error",e)}},n=()=>{try{const o=e.value||"",n=(t=o)?t.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@").trim():t;o!==n&&((0,L.e)(e,n),console.debug("Zaubertool(email): blur sanitized",{old:o,new:n}))}catch(e){console.error("Zaubertool(email): blur error",e)}var t};e.addEventListener("paste",t),e.addEventListener("input",o),e.addEventListener("blur",n);try{(0,g.nx)(e,A,!1,void 0,void 0,void 0,void 0,"@(.*)")}catch(e){}O.set(e,{input:o,paste:t,blur:n})}function P(){D||(D=!0,a()?(console.log("Zaubertool(email): initializing"),k||(k=(0,m.db)(g.aQ)),function(){for(let e of C){const t=Z(e);t?_(t):console.debug("Zaubertool(email): field not found",{id:e})}}(),T=new MutationObserver(e=>{try{for(let t of e)for(let e of C){const t=Z(e);t&&!O.has(t)&&(console.debug("Zaubertool(email): MutationObserver found field; attaching",{id:e}),_(t))}}catch(e){console.error("Zaubertool(email): mutation observer error",e)}}),T.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(email): not on overview processing page, skipping init"))}const B={init:P,destroy:function(){D=!1,console.log("Zaubertool(email): destroy");try{T&&(T.disconnect(),T=null)}catch(e){console.error("Zaubertool(email): destroy observer error",e)}try{for(const[e,t]of O.entries())try{e.removeEventListener("input",t.input),e.removeEventListener("paste",t.paste),e.removeEventListener("blur",t.blur)}catch(e){}O.clear()}catch(e){console.error("Zaubertool(email): destroy handlers error",e)}try{k&&((0,m.XY)(k),k=null)}catch(e){console.error("Zaubertool(email): destroy css error",e)}}};try{browser.storage.local.get({emailAutocomplete:!1}).then(e=>{Boolean(e.emailAutocomplete)&&a()&&P()}).catch(()=>{})}catch(e){}const q=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});q.relationAutocomplete||(q.relationAutocomplete=!0);const z=["Ehefrau","Ehemann","Tochter","Sohn","Vater","Mutter","Partnerin","Partner","Prokurist/in","Vertreter/in","Übersetzer/in"],N=["contactPersonAttributes.relationToPolicyholder"];let I=null,R=null,U=!1;const $=new Map;function V(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const o=document.getElementById(e);if(o){const e=o.querySelector("input, textarea");if(e)return e}const n=e.split("."),r=n[n.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function F(e){if(!e)return;if($.has(e))return;console.debug("Zaubertool(relation): setup for",{id:e.id,name:e.getAttribute("name")}),I||(I=(0,m.db)(g.aQ));const t=t=>{try{const t=e.value||"";t&&t.trim().length}catch(e){console.error("Zaubertool(relation) input handler error",e)}};e.addEventListener("input",t);try{(0,g.nx)(e,z,!0)}catch(e){}$.set(e,{input:t})}function j(){U||(U=!0,a()?(console.log("Zaubertool(relation): initializing"),I||(I=(0,m.db)(g.aQ)),function(){for(let e of N){const t=V(e);t?F(t):console.debug("Zaubertool(relation): field not found",{id:e})}}(),R=new MutationObserver(e=>{try{for(let t of e)for(let e of N){const t=V(e);t&&!$.has(t)&&(console.debug("Zaubertool(relation): MutationObserver found field; attaching",{id:e}),F(t))}}catch(e){console.error("Zaubertool(relation): mutation observer error",e)}}),R.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(relation): not on overview processing page, skipping init"))}const H={init:j,destroy:function(){U=!1,console.log("Zaubertool(relation): destroy");try{R&&(R.disconnect(),R=null)}catch(e){console.error("Zaubertool(relation): destroy observer error",e)}try{for(const[e,t]of $.entries())try{e.removeEventListener("input",t.input)}catch(e){}$.clear()}catch(e){console.error("Zaubertool(relation): destroy handlers error",e)}try{I&&((0,m.XY)(I),I=null)}catch(e){console.error("Zaubertool(relation): destroy css error",e)}}};try{browser.storage.local.get({relationSuggestions:!1}).then(e=>{Boolean(e.relationSuggestions)&&a()&&j()}).catch(()=>{})}catch(e){}function W(e){return function(e){if(!e)return"unknown";const t=e.toLowerCase().trim();return t.includes("dokumentation")&&t.includes("kontakt")?"contact_documentation":t.includes("nachricht")&&t.includes("versicherungsnehmer")?"contact_vn":t.includes("vollmacht")&&t.includes("anfordern")?"letter_of_attorney":t.includes("notiz")&&t.includes("anlegen")?"note":"unknown"}(function(e){try{const t=e||document.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!t)return null;const o=["h2.MuiDialogTitle-root",'h2[role="heading"]',"h2"];for(const e of o){const o=t.querySelector(e);if(o){const e=(o.textContent||"").trim();if(e.length>0)return e}}const n=t.querySelector(".MuiTypography-root.MuiTypography-h6, .MuiDialogTitle-root, .dialog-title, .modal-title");return n&&(n.textContent||"").trim()||null}catch(e){return null}}(e))}let K=null;const Q=new Map;function X(e){const t=e;if(!t)return{destroy:()=>{}};if(Q.has(t))return Q.get(t);const o=t.querySelector(".MuiDialogTitle-root")||t.querySelector("h2")||null;if(!o)return{destroy:()=>{}};o.classList.add("zt-draggable-handle");try{const e=W(t);console.debug("Zaubertool(draggable): attach for modal type",e)}catch(e){}let n=0,r=0,a=0,i=0,l=!1,s="",c="",u="",d="",m="",g="",h="";function f(e){try{e.preventDefault(),l=!0;const o=e.touches?e.touches[0]:e;n=o.clientX,r=o.clientY;const f=t.getBoundingClientRect(),b=window.getComputedStyle(t);a=f.left,i=f.top,s=t.style.position||"",c=t.style.left||"",u=t.style.top||"",d=t.style.width||"",m=t.style.height||"",g=t.style.maxHeight||"",h=t.style.transform||"",t.style.position="fixed",t.style.width=`${Math.round(f.width)}px`,t.style.height=`${Math.round(f.height)}px`,b&&b.maxHeight&&(t.style.maxHeight=b.maxHeight),t.style.transform="none",t.style.left=`${a}px`,t.style.top=`${i}px`,window.addEventListener("mousemove",p,!0),window.addEventListener("mouseup",y,!0),window.addEventListener("touchmove",p,{passive:!1}),window.addEventListener("touchend",y,!0)}catch(e){}}function p(e){if(l)try{const o=e.touches?e.touches[0]:e,l=o.clientX-n,s=o.clientY-r;t.style.left=`${a+l}px`,t.style.top=`${i+s}px`,e.preventDefault()}catch(e){}}function y(){l&&(l=!1,window.removeEventListener("mousemove",p,!0),window.removeEventListener("mouseup",y,!0),window.removeEventListener("touchmove",p,!0),window.removeEventListener("touchend",y,!0))}o.addEventListener("mousedown",f,!0),o.addEventListener("touchstart",f,{passive:!1});const b={destroy:()=>{try{o.removeEventListener("mousedown",f,!0),o.removeEventListener("touchstart",f,!0),window.removeEventListener("mousemove",p,!0),window.removeEventListener("mouseup",y,!0),window.removeEventListener("touchmove",p,!0),window.removeEventListener("touchend",y,!0),o.classList.remove("zt-draggable-handle"),""===s?t.style.removeProperty("position"):t.style.position=s,""===c?t.style.removeProperty("left"):t.style.left=c,""===u?t.style.removeProperty("top"):t.style.top=u,""===d?t.style.removeProperty("width"):t.style.width=d,""===m?t.style.removeProperty("height"):t.style.height=m,""===g?t.style.removeProperty("max-height"):t.style.maxHeight=g,""===h?t.style.removeProperty("transform"):t.style.transform=h}catch(e){}}};return Q.set(t,b),b}function Y(){try{!function(){const e="zt-draggable-modal-css";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .zt-draggable-handle { cursor: move; user-select: none; }\n ",document.head.appendChild(t)}();const e=Array.from(document.querySelectorAll(".MuiDialog-paper, dialog, .dialog, .modal"));for(const t of e)Q.has(t)||X(t)}catch(e){}}const G={init:function(){try{if(Y(),K)return;K=new MutationObserver(e=>{for(const t of e)t.target.querySelector&&Y()}),K.observe(document.body,{childList:!0,subtree:!0})}catch(e){}},destroy:function(){try{K&&(K.disconnect(),K=null);for(const[e,t]of Q.entries())try{t.destroy()}catch(e){}Q.clear()}catch(e){}}};globalThis.__ZAUBERTOOL_MODULE_LOADED=globalThis.__ZAUBERTOOL_MODULE_LOADED||{},globalThis.__ZAUBERTOOL_MODULE_LOADED.draggableModals=!0;let J=null,ee=null,te=!1;function oe(){if(!J)return;const e=window.devicePixelRatio||1;J.width=Math.floor(window.innerWidth*e),J.height=Math.floor(window.innerHeight*e),J.style.width=`${window.innerWidth}px`,J.style.height=`${window.innerHeight}px`;const t=J.getContext("2d");t&&t.scale(e,e)}function ne(){te&&(ee&&cancelAnimationFrame(ee),ee=null,J&&(J.remove(),J=null),window.removeEventListener("resize",oe),te=!1)}function re(e){return"zt_case_settings_"+e}async function ae(e){try{const t=re(e),o=await browser.storage.local.get(t);if(console.debug("zt.caseSettings.getCaseSettings",{key:t,obj:o}),o&&Object.prototype.hasOwnProperty.call(o,t)){return o[t]||null}return null}catch(t){return console.warn("zt.caseSettings.getCaseSettings error",{caseId:e,error:t}),null}}async function ie(e){return async function(e,t){try{const o=await ae(e);return o&&Object.prototype.hasOwnProperty.call(o,t)?o[t]:null}catch(o){return console.warn("zt.caseSettings.getCaseSetting error",{caseId:e,name:t,error:o}),null}}(e,"progressState")}async function le(e,t){try{if(null==t)return;const o=await ae(e)||{};o.progressState=t,o.updatedAt=new Date,await async function(e,t){try{const o=re(e);null==t?(await browser.storage.local.remove(o),console.debug("zt.caseSettings.setCaseSettings remove",{key:o})):(await browser.storage.local.set({[o]:t}),console.debug("zt.caseSettings.setCaseSettings set",{key:o,settings:t}))}catch(t){console.warn("zt.caseSettings.setCaseSettings error",{caseId:e,error:t})}}(e,o)}catch(e){}}new Map;const se=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});se.gamefication||(se.gamefication=!0);let ce=null,ue=null,de=null,me=!1,ge=null,he=null,fe=null;async function pe(){try{const e=function(){try{const e=location.pathname.match(/\/cases\/([^/]+)/i)||location.pathname.match(/\/case\/([^/]+)/i);if(e&&e[1])return e[1]}catch(e){}return null}();if(!e)return void(de=null);de=e;const t=document.querySelector("header.MuiPaper-root.MuiPaper")||document.querySelector("header")||document.querySelector(".MuiPaper-root.MuiPaper"),o=function(e){if(!e)return"none";try{const t=Array.from(e.querySelectorAll('button, a, [role="button"]'));let o=!1,n=!1;for(const e of t){const t=(e.textContent||"").trim(),r=(t.normalize&&t.normalize("NFKD")?t.normalize("NFKD"):t).replace(/[\u0300-\u036f]/g,"").toLowerCase();r&&(r.includes("nachricht")&&r.includes("m2")&&(n=!0),r.includes("bearbeitung")&&r.includes("abschliessen")&&(o=!0))}return n?"completed":o?"in_progress":"none"}catch(e){return"none"}}(t),n=await ie(e);if(await ae(e),n!==o&&(n||"none"!==o?await le(e,"none"===o?null:o):await le(e,"in_progress"),"in_progress"===n&&"completed"===o))try{!function(e=4e3){if(te)return;te=!0,J=function(){const e=document.createElement("canvas");e.id="zt-gamification-canvas",e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.zIndex="999999999",e.style.pointerEvents="none";const t=window.devicePixelRatio||1;e.width=Math.floor(window.innerWidth*t),e.height=Math.floor(window.innerHeight*t),e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`;const o=e.getContext("2d");return o&&o.scale(t,t),e}(),document.body.appendChild(J);const t=J.getContext("2d"),o=[],n=(e,t)=>Math.random()*(t-e)+e,r=Math.max(3,Math.floor(window.innerWidth/300));let a=0;const i=setInterval(()=>{!function(e,t){for(let r=0;r<40;r++){const r=Math.random()*Math.PI*2,a=n(2,8),i={x:e,y:t,vx:Math.cos(r)*a,vy:Math.sin(r)*a,life:n(60,120),age:0,size:n(1,3),color:`hsl(${n(0,360)}, ${n(50,100)}%, ${n(50,70)}%)`};o.push(i)}}(n(100,window.innerWidth-100),n(100,window.innerHeight/2)),a++,a>=r&&clearInterval(i)},300);!function e(){if(J){t.clearRect(0,0,J.width,J.height);for(let e=o.length-1;e>=0;e--){const n=o[e];n.x+=n.vx,n.y+=n.vy,n.vy+=.05,n.vx*=.99,n.vy*=.99,n.age++;const r=Math.max(0,1-n.age/n.life);t.beginPath(),t.fillStyle=n.color,t.globalAlpha=r,t.arc(n.x,n.y,n.size,0,2*Math.PI),t.fill(),t.globalAlpha=1,n.age>n.life&&o.splice(e,1)}ee=requestAnimationFrame(e)}}(),window.addEventListener("resize",oe),setTimeout(()=>{ne()},e+500)}(3e3)}catch(e){}if(ue){try{ue.disconnect()}catch(e){}ue=null}t&&(ue=new MutationObserver(()=>{setTimeout(()=>pe(),40)}),ue.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-hidden"]}))}catch(e){}}async function ye(){try{await pe()}catch(e){}}function be(){if(!ce)try{pe(),me||(ge=history.pushState,history.pushState=function(){const e=ge.apply(this,arguments);return setTimeout(()=>{pe()},40),e},he=history.replaceState,history.replaceState=function(){const e=he.apply(this,arguments);return setTimeout(()=>{pe()},40),e},fe=()=>{pe()},window.addEventListener("popstate",fe),me=!0)}catch(e){}}const ve={init:be,destroy:function(){ce&&(document.body.removeEventListener("click",ce,!0),ce=null);try{ne()}catch(e){}try{ue&&(ue.disconnect(),ue=null)}catch(e){}try{me&&(ge&&(history.pushState=ge),he&&(history.replaceState=he),fe&&window.removeEventListener("popstate",fe),me=!1,ge=null,he=null,fe=null)}catch(e){}}};try{browser.storage.local.get({gamification:!1}).then(e=>{Boolean(e.gamification)&&be()}).catch(()=>{})}catch(e){}const we="zt-contact-doc-toolbar",Ee="zt-contact-doc-toolbar",xe=[{label:"eingehend beA",text:"eingegangen bei und per beA"},{label:"ausgehend beA",text:"per beA gesendet"},{label:"eingehend E-Mail",text:"eingegangen bei und per E-Mail"},{label:"ausgehend E-Mail",text:"per E-Mail gesendet"},{label:"eingehend Post",text:"eingegangen bei und per Post"},{label:"ausgehend Post",text:"per Post gesendet"},{label:"Leeren",text:""}],Se=`\n .${we} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${we} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${we} button:hover { background: #f3f3f3; }\n`;let Le=null,Ae=!1,Ce=null;function Me(e){try{if("contact_documentation"!==W(e))return;const t=function(e){try{const t=Array.from(e.querySelectorAll("p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("notiz"===t||t.startsWith("notiz")||"note"===t||t.startsWith("note"))return e}return null}catch(e){return null}}(e);if(!t)return;if(e.querySelector(`#${Ee}`))return;const o=function(){const e=document.createElement("div");e.className=we,e.id=Ee;for(const t of xe){const o=document.createElement("button");o.type="button",o.textContent=t.label,o.dataset.template=t.text,o.addEventListener("click",e=>{try{const t=e.target.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!t)return;const o=t.querySelector('.tiptap.ProseMirror[contenteditable="true"], .tiptap .ProseMirror[contenteditable="true"], .rich-text-field [contenteditable="true"]');if(!o)return;const n=e.target.dataset.template||"";if(""===n)return void(o.innerHTML='<p><br class="ProseMirror-trailingBreak"></p>');o.focus();try{document.execCommand("insertText",!1,n)}catch(e){o.innerText=n}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}}catch(e){}}),e.appendChild(o)}return e}();let n=function(e){try{if(!e)return null;let t=e.nextElementSibling,o=0;for(;t&&o<6;){if(o++,t.matches&&(t.matches(".tiptap")||t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]"))))return t;const e=t.querySelector&&t.querySelector(".ProseMirror, .tiptap, [contenteditable]");if(e)return e;t=t.nextElementSibling}const n=e.parentElement;if(n){const e=n.querySelector(".tiptap, .ProseMirror, [contenteditable], .rich-text-field, .MuiTiptap-RichTextContent-root");if(e)return e;let t=n.nextElementSibling;for(o=0;t&&o<5;){if(o++,t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]")))return t.querySelector(".tiptap, .ProseMirror, [contenteditable]");t=t.nextElementSibling}}return null}catch(e){return null}}(t);if(!n){const e=t.nextElementSibling;n=e&&e.matches&&(e.matches(".tiptap")||e.querySelector&&e.querySelector(".tiptap"))&&e||t.parentElement&&t.parentElement.querySelector(".tiptap")}if(n&&n.parentElement)n.parentElement.insertBefore(o,n),console.debug("Zaubertool(contactDocs): toolbar inserted above rich editor");else{const n=t.parentElement?.nextElementSibling||t.nextElementSibling;n&&n.parentElement?(n.parentElement.insertBefore(o,n),console.debug("Zaubertool(contactDocs): toolbar inserted (via fallback insertion)")):t.parentElement?(t.parentElement.appendChild(o),console.debug("Zaubertool(contactDocs): toolbar appended to notiz parent")):(e.appendChild(o),console.debug("Zaubertool(contactDocs): toolbar appended to modal as last fallback"))}}catch(e){}}const ke={init:function(){Ae||(Ae=!0,console.debug("Zaubertool(contactDocs): init"),Ce=(0,m.db)(Se),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Me(t)}catch(e){}}(),Le=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Me(t);continue}const o=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');o&&Me(o)}}),Le.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Ae=!1,console.debug("Zaubertool(contactDocs): destroy");try{Le&&(Le.disconnect(),Le=null),Ce&&(Ce.remove(),Ce=null);const e=document.querySelectorAll(`#${Ee}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t)}catch(e){}}},Te="zt-attorney-toolbar",De="zt-attorney-toolbar",Oe=[{label:"Unberechtigte Forderung",text:"Unberechtigte Forderung"},{label:"Mängel Kaufvertrag",text:"Mängel Kaufvertrag"},{label:"Leeren",text:""}],Ze=`\n .${Te} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${Te} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${Te} button:hover { background: #f3f3f3; }\n`;let _e=null,Pe=null,Be=!1;function qe(e){try{const t=Array.from(e.querySelectorAll("label, p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("begründung"===t||t.startsWith("begründung")||"grund"===t||"reason"===t)return e}}catch(e){}return null}function ze(e){if(!e)return null;const t=e.parentElement;if(t){const e=Array.from(t.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}}const o=e.nextElementSibling;if(o){const e=Array.from(o.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}if(o.tagName&&"textarea"===o.tagName.toLowerCase())return o}const n=Array.from(document.querySelectorAll('textarea#attorneyReason, textarea[name*="attorney"], textarea[name*="reason"], textarea[id*="attorney"], textarea[id*="reason"]'));for(const e of n){if("true"===e.getAttribute("aria-hidden"))continue;const t=e.getBoundingClientRect&&e.getBoundingClientRect();if(!t||0!==t.height)return e}return null}function Ne(e){try{if("letter_of_attorney"!==W(e))return;const t=qe(e);if(!t)return;if(e.querySelector(`#${De}`))return;const o=function(){const e=document.createElement("div");e.className=Te,e.id=De;for(const t of Oe){const o=document.createElement("button");o.type="button",o.textContent=t.label,o.dataset.template=t.text,o.addEventListener("click",e=>{try{const t=e.target.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!t)return;const o=ze(qe(t))||t.querySelector("textarea");if(!o)return;const n=e.target.dataset.template||"";if(""===n)o.value="";else{o.focus();try{o.value=n}catch(e){o.value=n}}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}try{for(const e in o)if(e.startsWith("__reactProps")){o[e].onChange&&o[e].onChange({target:o,currentTarget:o});break}}catch(e){}}catch(e){}}),e.appendChild(o)}return e}(),n=ze(t),r=n?n.closest(".MuiInputBase-root, .MuiFormControl-root"):null;r&&r.parentElement?r.parentElement.insertBefore(o,r):n&&n.parentElement?(n.parentElement.insertBefore(o,n),console.debug("Zaubertool(letterOfAttorney): toolbar inserted above textarea")):t.parentElement?t.parentElement.appendChild(o):e.appendChild(o),console.debug("Zaubertool(letterOfAttorney): toolbar inserted")}catch(e){}}const Ie={init:function(){Be||(Be=!0,Pe=(0,m.db)(Ze),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Ne(t)}catch(e){}}(),_e=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Ne(t);continue}const o=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');o&&Ne(o)}}),_e.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Be=!1;try{_e&&(_e.disconnect(),_e=null),Pe&&(Pe.remove(),Pe=null);const e=document.querySelectorAll(`#${De}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t)}catch(e){}}};let Re=!1,Ue=!1,$e=!1,Ve=!1,Fe=!1,je=null,He=null,We=null;async function Ke(){if(!Re){Re=!0;try{ve&&ve.init&&ve.init()}catch(e){console.error("Zaubertool(case): enableGamification error",e)}}}async function Qe(){if(Re){Re=!1;try{ve&&ve.destroy&&ve.destroy()}catch(e){console.error("Zaubertool(case): disableGamification error",e)}}}async function Xe(){try{const e=await browser.storage.local.get({gamification:!1,emailAutocomplete:!1,relationSuggestions:!1,draggableModals:!1});Re=Boolean(e.gamification),Ue=Boolean(e.emailAutocomplete),Ve=Boolean(e.relationSuggestions),$e=Boolean(e.draggableModals),Re&&await Ke(),Ue&&a()&&B&&B.init&&B.init(),Ve&&a()&&H&&H.init&&H.init(),$e&&G&&G.init&&G.init();try{ke&&ke.init&&ke.init()}catch(e){}try{Ie&&Ie.init&&Ie.init()}catch(e){}}catch(e){}}browser.runtime.onMessage.addListener(async e=>{if(e&&e.id)switch(e.id){case"large-comments":s("On"===e.value);break;case"gamification":"On"===e.value?await Ke():await Qe();break;case"email-autocomplete":Ue="On"===e.value,Ue&&a()?B&&B.init&&B.init():B&&B.destroy&&B.destroy();break;case"relation-suggestions":Ve="On"===e.value,Ve&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy();break;case"draggable-modals":$e="On"===e.value,$e?G&&G.init&&G.init():G&&G.destroy&&G.destroy()}});try{S&&S.isProcessingTabPage&&S.isProcessingTabPage()&&S.init&&S.init(),$e&&G&&G.init&&G.init&&G.init()}catch(e){}const Ye=async()=>{try{await Xe(),S&&S.isProcessingTabPage&&S.isProcessingTabPage()?S.init&&S.init():S.destroy&&S.destroy(),Ue&&a()?B&&B.init&&B.init():B&&B.destroy&&B.destroy(),Ve&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy(),$e?G.init&&G.init():G.destroy&&G.destroy(),Re&&ye&&ye&&ye()}catch(e){}};window.addEventListener("popstate",Ye);const Ge=history.pushState;history.pushState=function(){const e=Ge.apply(this,arguments);return Ye(),e};const Je=history.replaceState;history.replaceState=function(){const e=Je.apply(this,arguments);return Ye(),e};try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t){if("gamification"in e){const t=e.gamification.newValue;Boolean(t)?Ke():Qe()}if("emailAutocomplete"in e){const t=e.emailAutocomplete.newValue;Ue=Boolean(t),Ue&&a()?B.init&&B.init():B.destroy&&B.destroy()}if("draggableModals"in e){const t=e.draggableModals.newValue;$e=Boolean(t),$e?G.init&&G.init():G&&G.destroy&&G.destroy()}if("relationSuggestions"in e){const t=e.relationSuggestions.newValue;Ve=Boolean(t),Ve&&a()?H.init&&H.init():H.destroy&&H.destroy()}}})}catch(e){}try{(function(){try{if(Fe)return;Fe=!0;const e=e=>{try{const t=e.target;if(!t)return;t.closest('[role="tab"], [data-tab], a[href*="tab="]')&&(We&&window.clearTimeout(We),We=window.setTimeout(()=>Ye(),40))}catch(e){}};document.body.addEventListener("click",e,!0),je=e,document.addEventListener("visibilitychange",Ye),window.addEventListener("focus",Ye);const t=e=>{try{for(const t of e){if("attributes"===t.type){const e=t.attributeName;if("class"===e||"aria-selected"===e){We&&window.clearTimeout(We),We=window.setTimeout(()=>Ye(),40);break}}if("childList"===t.type&&t.addedNodes&&t.addedNodes.length>0){We&&window.clearTimeout(We),We=window.setTimeout(()=>Ye(),40);break}}}catch(e){}};let o=document;const n=document.querySelector('[role="tablist"]');if(n)o=n;else{const e=document.querySelector("#tabs, .tabs, .tablist, [data-tabs]");e&&(o=e)}He=new MutationObserver(t),He.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","aria-selected"]})}catch(e){}})(),Xe().then(()=>Ye()).catch(()=>{})}catch(e){}})();
{
"manifest_version": 2,
"name": "Zaubertool Add-On",
"version": "1.0.3",
"version": "1.0.4",
"description": "Add-On f\u00fcr das M2-Zaubertool",

@@ -6,0 +6,0 @@ "icons": {

@@ -76,4 +76,4 @@ <!DOCTYPE html>

<p style="font-size: small">Version: 1.0.3</p>
<p style="font-size: small">Version: 1.0.4</p>
</body>
</html>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet