1!function(){"use strict";var e;const t=(e=>{const t={environment:null==e?void 0:e.MODE,isDevelopment:e.DEV,isProduction:e.PROD,apiPath:e.VITE_APP_API_PATH,botPath:e.VITE_APP_BOT_PATH,appVersion:e.VITE_APP_VERSION,useSRI:"true"===e.VITE_APP_USE_SRI,sri:{SRI_PRIMUS:e.VITE_SRI_PRIMUS,SRI_CSS:e.VITE_SRI_CSS,SRI_MAIN:e.VITE_SRI_MAIN,SRI_FONT_500:e.VITE_SRI_FONT_500,SRI_FONT_REG:e.VITE_SRI_FONT_REG}};if(!t.apiPath)throw new Error("env variable is missing: VITE_APP_API_PATH");if(!t.botPath)throw new Error("env variable is missing: VITE_APP_BOT_PATH");return t})({DEV:!1,MODE:"production",PROD:!0,VITE_APP_API_PATH:"https://api.moin.ai",VITE_APP_BOT_PATH:"https://bot.moin.ai/",VITE_APP_USE_SRI:"true",VITE_APP_VERSION:"6.1.2",VITE_SRI_CSS:"sha512-ak9Wn3vqvaxXaD8BwflwKNAsPg3WE7miGld68dM/I9/7/RPR5m38pW/RMIoShHi5X6GrTi0OT/GAJHcXIdraDw==",VITE_SRI_FONT_500:"sha512-9oxeRUpbIanCEMjIyweDoUpYemmGDboqDFtN/U3KI6iayN/7PtZH7+WgWzyXqZZwdNl333i470X581+p9tBnLQ==",VITE_SRI_FONT_REG:"sha512-ErbTso5df8Ed6iNJVLeUsfWcnRc8SRA0lgYX5f4GET6YSN3qRmfMV+r8LmOoWgxK8qNegAyPhFzAthS6grFsoQ==",VITE_SRI_MAIN:"sha512-DUvlLYy5brlY9qx+hs2bHTvHJSbnhLnHIMQiPcgMNb2P3pSWJ6sI2ztUyLt+dtgc1PViYnkXxIExhHlmcGJdXw==",VITE_SRI_PRIMUS:"sha512-G0CYKPi+WUdQuphA5mSF7EC5s19GFOU9RUxnF7MQxNvYUNI4OIx4VNEjFOxUVvMobb6VwXKQSIw4lO03lxdhkg=="}),n=t.isProduction,o=e=>"[object Object]"===Object.prototype.toString.call(e);let i=!1;(function(){let e=!0;try{e=!!window,e=!!window.sessionStorage,e=!!window.sessionStorage.getItem}catch{console.error("crash without window / sessionStorage"),e=!1}return e})()&&(i="true"===(null==(e=null==window?void 0:window.sessionStorage)?void 0:e.getItem("moindebug")));const r={log:window.console.log.bind(window.console,"�[1mlog�[0m: %s"),warn:window.console.warn.bind(window.console,"�[33mwar�[0m: %s"),error:window.console.error.bind(window.console,"�[31merr�[0m: %s")},a=window.console.log.bind(window.console,"%s"),s=function(){const e=arguments[0];let t="";for(let i=1;i<arguments.length;i++){t+=` ${o(arguments[i])||Array.isArray(arguments[i])?JSON.stringify(arguments[i]):arguments[i]}`}const n=(new Date).toLocaleTimeString("de-de");a(`${n} | ${e} | ${t}`)};!i&&n&&(r.log=()=>{},r.warn=()=>{},r.error=()=>{}),i&&(r.log=s.bind(console.log),r.warn=s.bind(console.warn),r.error=s.bind(console.error)),r.log("log",`logger isProduction: ${n}, isDebugMode ${i}`);const d={...r};let c=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function l(e,t){window.__moinrpc.exposedFunctions.has(e)?console.error("function with this name already has been exposed"):window.__moinrpc.exposedFunctions.set(e,t)}function w(e={target:null,targetOrigin:"*",service:"moin-rpc"}){let t=e.target;if(!t)throw new Error("target must be set");if(window.__moinrpc.targets.has(t.postMessage))return window.__moinrpc.targets.get(t.postMessage);{const n=m(e);return window.__moinrpc.targets.set(t.postMessage,n),n}}window.__moinrpc={exposedFunctions:new Map,targets:new Map};const m=(e={target:null,targetOrigin:"*",service:"moin-rpc"})=>{const t=new Map,n=c();let o=e.target,i=e.targetOrigin||"*",r=e.service||"moin-rpc";const a=(e,t,n)=>({instanceId:n,service:r,type:"error",result:t,id:e}),s=e=>{const{func:t,args:n,id:o,instanceId:s}=e.data,d=e.source,c=window.__moinrpc.exposedFunctions.get(t);if(!c)return void d.postMessage(a(o,new Error("function not found"),s),i);const l=c.call(null,JSON.parse(n));Promise.resolve(l).then(e=>{d.postMessage(((e,t,n)=>({instanceId:n,service:r,type:"response",result:t,id:e}))(o,e),i)}).catch(e=>{d.postMessage(a(o,e),i)})},d=e=>{if(!e.data)return;if(e.data.service!==r)return;const{type:n,id:o,result:i}=e.data;switch(n){case"call":s(e);break;case"response":((e,n)=>{t.get(e).onSuccess(n),t.delete(e)})(o,i);break;case"error":((e,n)=>{t.get(e).onError(n),t.delete(e)})(o,i);break;default:console.error("rpc unknown message type",e.data)}};return window.addEventListener("message",d),{call:(e,a={})=>{var s;const d=(null==o?void 0:o.readyState)||(null==(s=null==o?void 0:o.document)?void 0:s.readyState),l="complete"===d||"interactive"===d;return new Promise((s,w)=>{"interactive"===d&&console.warn("iframe is not fully loaded"),l||w(new Error("target not ready")),o||w(new Error(`cant call ${e}, target set`));try{JSON.stringify(a)}catch{w(new Error(`cant call ${e}
1, args not valid`))}const m=c();t.set(m,{name:e,onSuccess:e=>s(e),onError:e=>w(e)}),o.postMessage(((e,t,n,o)=>({instanceId:o,service:r,type:"call",func:e,id:n,args:JSON.stringify(t)}))(e,a,m,n),i)})},closeChannel:()=>{t.clear(),window.__moinrpc.exposedFunctions.clear(),window.removeEventListener("message",d)}}},u={animation:"none",animationName:"none",backfaceVisibility:"visible",background:"transparent",backgroundAttachment:"scroll",border:"0",borderStyle:"none",borderWidth:"medium",borderColor:"inherit",boxShadow:"none",boxSizing:"content-box",color:"inherit",cursor:"auto",display:"inline",height:"auto",left:"auto",margin:"0",maxWidth:"none",maxHeight:"100dvh",minWidth:"unset",minHeight:"unset",opacity:1,outline:"0",outlineColor:"invert",outlineStyle:"none",outlineWidth:"medium",overflow:"visible",overflowX:"visible",overflowY:"visible",padding:"0",perspective:"none",position:"static",top:"auto",transform:"none",transition:"none",visibility:"visible",whiteSpace:"normal",widows:0,width:"auto",zIndex:"auto"},h={position:"absolute",bottom:"0px",right:"0px",width:"0px",height:"0px",overflow:"hidden"};function g(e,t,n,o,i){const r=document.createElement("div");r.id="moinai-container",r.style.height="100%",r.style.width="100%",e.contentDocument.body.appendChild(r),e.contentDocument.height="100%";const a=`${o.map(e=>{return t=e,Object.keys(t).reduce((e,n)=>e+n.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+t[n]+";","");var t}).join(" ")}`;
1e.contentDocument.body.style=a,i.forEach(t=>{e.contentDocument.body.setAttribute(t.attrName,t.value)}),t.forEach(t=>{const n=function(e){const{id:t,sri:n,href:o}=e,i=document.createElement("link");return i.rel="stylesheet",i.href=o,t&&(i.id=t),n&&(i.integrity=n,i.crossOrigin="anonymous"),i}(t);e.contentDocument.head.appendChild(n)}),n.forEach(t=>{const n=function(e){const{id:t,src:n,sri:o,type:i}=e,r=document.createElement("script");return r.src=n,t&&(r.id=t),o&&(r.integrity=o,r.crossOrigin="anonymous"),i&&(r.type=i),r}(t);e.contentDocument.body.appendChild(n)})}class p{constructor(e,t={title:"moinai-iframe",name:"moinai-iframe"}){const n=t.title;this._id=e,this._iframetitle=n,this._css=[],this._scripts=[],this._frameStyles=[],this._attributes=[],this._innerBodyStyles=[]}addInnerAttribute(e,t){return this._attributes.push({attrName:e,value:t}),this}addCSS(e){return this._css.push(e),this}addScript(e){return this._scripts.push(e),this}addIFrameStyles(e){return this._frameStyles.push(e),this}addInnerBodyStyles(e){return this._innerBodyStyles.push(e),this}async injectInto(e){return new Promise(async t=>{const n=await function(e,t,n,o,i,r,a,s){const d=document.createElement("iframe");d.id=t,d.title=s,d.classList.add(t),d.name=t,e.appendChild(d);const c=Object.assign({},u,h,...r);return Object.assign(d.style,c),new Promise(async e=>{setTimeout(async()=>{await g(d,n,o,i,a),e(d)},300)})}(e,this._id,this._css,this._scripts,this._innerBodyStyles,this._frameStyles,this._attributes,this._iframetitle);t(n)})}}const I={position:"fixed",bottom:"0px",right:"0px",width:"100vw",height:"0px",zIndex:"100000"},y={margin:"0",height:"100%",display:"grid",justifyContent:"center",alignContent:"center",alignItems:"center",justifyItems:"center"},b=function(e,t){Object.assign(e.style,t)};var _=new RegExp("^(?:[a-z+]+:)?//","i");const f=function(e){let t=null;const n=e.trim();if(function(e){return!_.test(e.trim())}(n))d.log("url is relative, we need to build the absolute url"),t=new URL(window.location.origin+n);else{t=n.startsWith("//")?new URL(location.protocol+n):new URL(n)}const o=t.href.indexOf("moin-loader.js"),i=`${t.href.substring(0,o-1)}`,r=t.pathname.indexOf("moin-loader.js"),a=t.pathname.substring(0,r-1);return{href:t.href,origin:t.origin,pathname:t.pathname,path:a,basePath:i}},S=["3ed4453af983019fa5e2ae6a1c061671e8c93f551b2223949e815493b0a41cbe","3ed4453af983019fa5e2ae6a1c061671e8c93f551b2223949e815493b0a41cbe-it"];let v,E={};window.moin=Object.assign({},window.moin),window.knowhere={},window.knowhere.api={};const P=e=>{d.log("mount legacy widget");try{const t=function(e,t){const n=document.createElement("script");return n.id=e,n.src=t,n.async=!1,n}("knw-botscript",e.replace("moin-loader.js","kn-widget-loader.js"));!function(e,t){e.appendChild(t),t.addEventListener("error",()=>{throw new Error("error while loading injected tag")},!1)}(document.getElementsByTagName("head")[0],t)}catch{}},R=async({botId:e,channelId:n,basePath:o})=>{d.log("loader | mount default widget",e,n);const i=function(e,t){const n=document.createElement("div");return n.id=e,t.appendChild(n),n}("moin-ai-container",document.body);b(i,I);const r=t.isDevelopment?"":o+"/main.css",a=new p("moin-ai-teaser",{title:"Chat Gesprächseinstieg",name:"moin-ai-teaser"}).addCSS({id:"moin-styles",href:r,sri:t.useSRI?t.sri.SRI_CSS:null}).addInnerBodyStyles(y);await a.injectInto(i);const s=new p("moin-ai-button",{title:"Starte neue Chat Konversation",name:"moin-ai-button"}).addCSS({id:"moin-styles",href:r,sri:t.useSRI?t.sri.SRI_CSS:null}).addInnerBodyStyles(y);await s.injectInto(i);const c=new p("moin-ai-widget",{title:"Chatfenster",name:"moin-ai-widget"}).addInnerAttribute("data-bot",e).addInnerAttribute("data-channel",n).addInnerAttribute("data-width",window.innerWidth.toString()).addInnerAttribute("data-height",window.innerHeight.toString()).addCSS({id:"moin-styles",href:r,sri:t.useSRI?t.sri.SRI_CSS:null}).addScript({id:"primus",src:t.isDevelopment?"/primus.js":o+"/primus.js",sri:t.useSRI?t.sri.SRI_PRIMUS:null}).addScript({id:"mainmoinjs",src:t.isDevelopment?"/src/main.ts":o+"/main.js",type:t.isDevelopment?"module":null,sri:t.useSRI?t.sri.SRI_MAIN:null}).addInnerBodyStyles({margin:"0px",width:"100%",height:"100%"}),l=window.self!==window.parent;c.addInnerAttribute("data-mode",l?"iframe":"default"),v=await c.injectInto(i)},T=(e={},t,n)=>{const{preserveSession:o=!1}=e;w({target:v.contentWindow}).call("unmount"),setTimeout(()=>{var e,i,r,a,s,c;try{document.body.style.removeProperty("--knowhere-vh"),document.body.classList.remove("knowhere-ScrollLock"),document.body.classList.remove("moin-scolllock"),null==(e=
1document.getElementById("moin-ai-teaser"))||e.remove(),null==(i=document.getElementById("moin-ai-button"))||i.remove(),null==(r=document.getElementById("moin-ai-widget"))||r.remove(),null==(a=document.getElementById("moin-ai-container"))||a.remove(),null==(s=document.getElementById("knw-botscript"))||s.remove(),null==(c=document.getElementById("moinloader"))||c.remove()}catch(l){d.log("error removing widget",l)}E={},window.moin=null,window.knowhere=null,window.___moinloader=null,o||(window.localStorage.removeItem(`knowhere_jwt_${t}_${n}`),window.localStorage.removeItem("knowhere_widget_open"))},400)},A=function(e,t){Object.hasOwnProperty.call(E,e)||(E[e]=[]),E[e].push(t)},O=e=>{d.log("the widget iframe called ready",e.botId,e.channelId);w({target:v.contentWindow}).call("resize",{height:window.innerHeight,width:window.innerWidth}),(()=>{try{window.chatWidgetReady&&(e=window.chatWidgetReady)&&e.constructor&&e.call&&e.apply&&window.chatWidgetReady()}catch(t){d.log("error in chatWidgetReady function",t)}var e})(),window.moin.unmount=t=>{T(t,e.botId,e.channelId)}};l("widgetIsReady",e=>O(e)),l("signal",e=>
1{return n=(t=e).signal,void(t.payload&&n&&E[n]&&E[n].forEach(function(e){e(t.payload)}));var t,n});const x=async({mode:e,botId:n,channelId:o,url:i,basePath:r})=>{try{if("legacy"===e)P(i);else{await R({botId:n,channelId:o,basePath:r}),(()=>{const e=w({target:v.contentWindow});["addContext","getContext","toggle","toggle_Widget","close","open","typing","alwaysOpen","setThemeOption","setWidgetzIndex","showWidget","hideWidget","setPosition","initLivechat","getLivechatAvailable","startLivechat","stopLivechat","teaser","sendIntent","clearQR","setWidgetPosition","setAlignmentOrigin"].forEach(t=>{window.moin[t]=function(){return e.call(t,arguments[0])},window.knowhere.api[t]=function(){return console.warn("window.knowhere.api is deprecated, use window.moin"),e.call(t,arguments[0])}}),window.knowhere.api.setWidgetPosition=function(){console.warn("window.knowhere.api is deprecated, use window.moin.setPosition instead");var t=[];return Array.prototype.push.apply(t,arguments),e.call("setPosition",{bottom:t[0],right:t[1],unit:t[2]})},window.knowhere.api.setWidgetzIndex=function(){console.warn("window.knowhere.api is deprecated, use window.moin.setWidgetzIndex instead");var t=[];return Array.prototype.push.apply(t,arguments),e.call("setWidgetzIndex",{index:t[0]})}})();const e=w({target:v.contentWindow}),i=()=>{e.call("resize",{height:window.innerHeight,width:window.innerWidth})};window.addEventListener("resize",function(e,t){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)}}(i,50)),window.moin.mount=()=>{R({botId:n,channelId:o,basePath:r})},window.moin.unmount=e=>{T(e,n,o)},window.moin.on=A,window.knowhere.api.on=A,t.isDevelopment&&(()=>{const e=document.getElementById("moin-ai-widget").contentDocument.head,t=document.getElementById("moin-ai-button").contentDocument.head,n=document.getElementById("moin-ai-teaser").contentDocument.head;[...e.children].forEach(e=>{t.appendChild(e.cloneNode(!0)),n.appendChild(e.cloneNode(!0))}),new MutationObserver(e=>{e.forEach(e=>{[...e.addedNodes].forEach(e=>{t.appendChild(e.cloneNode(!0)),n.appendChild(e.cloneNode(!0))})})}).observe(e,{attributes:!0,childList:!0,subtree:!0})})()}}catch(a){(e=>{d.error("moin-widget critical error, entering failsafe",e);const t=document.getElementById("moin-ai-container");t&&b(t,{display:"none",background:"red"})})(a)}};if(window.___moinloader)d.warn("bot already loaded");else try{window.___moinloader=!0,window.moin=Object.assign({},window.moin),d.log("loader |Â start loading",t);const e=document.getElementById("moinloader")||document.getElementById("knw-botscript")||document.currentScript;if(!e)throw new Error("Could not find script tag");const n=e.getAttribute("src"),o=e.getAttribute("data-loadingDelay"),i=f(n);let r=parseInt(o,10)||0;
1isNaN(r)&&(d.warn("delay seems not to be a number, continue with zero delay"),r=0);const{botId:a,channelId:s}=function(e){try{const t=new URL(e.src);let n=t.searchParams.get("id"),o=t.searchParams.get("channelid")?t.searchParams.get("channelid"):"";const i=new URL(window.location.href);return i.searchParams.get("bot")&&(n=i.searchParams.get("bot")),i.searchParams.get("channelid")&&(o=i.searchParams.get("channelid")),{botId:n,channelId:o}}catch{throw new Error("error parsing bot id")}}(e),c={mode:S.includes(a)?"legacy":"default",botId:a,channelId:s,url:i.href,basePath:i.basePath,delay:r};d.log("loader | ",c,document.readyState),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>x(c),r)}):setTimeout(()=>x(c),r)}catch(N){d.error("error in loader",N)}}(); 2//# sourceMappingURL=moin-loader.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.