PageSourceSearch

https://mudblazor-extensions.pages.dev/_content/MudBlazor.Extensio…dBlazor.Extensions.zttux18naz.lib.module.js

js mudblazor-extensions.pages.dev collected 2026-10-03 05:26:28 UTC 71,592 bytes, 1 lines download raw bytes

1function toBytes(n){const t=atob(n),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}function toBase64(n){let t="";for(let i=0;i<n.length;i+=32768)t+=String.fromCharCode.apply(null,n.subarray(i,i+32768));return btoa(t)}class MudExCapture{static recordings={};static _preselected={};static setText(n,t){n=MudExObserver.getElement(n);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=640;i.height=480;r.fillStyle="black";r.fillRect(0,0,i.width,i.height);r.font="48px Arial";r.fillStyle="white";r.translate(i.width/2,i.height/2);r.rotate(-Math.PI/4);r.textAlign="center";r.fillText(t,0,0);const u=i.captureStream(30);n&&typeof n.play=="function"&&(n.autoplay=!0,n.muted=!0,n.srcObject=u,n.play())}static switchSrcObject(n,t,i){const r=MudExObserver.getElement(n),u=MudExObserver.getElement(t);if(r&&u&&i){var f=r.srcObject;r.srcObject=u.srcObject;u.srcObject=f}}static async selectCaptureSource(n,t){try{var r=this.removeOptionsWithoutNullProperties(n),i=null;i=n.video?.deviceId?await navigator.mediaDevices.getUserMedia(this.prepareVideoConstraints(n.video.deviceId,n.video)):n.audio?.deviceId?await navigator.mediaDevices.getUserMedia(this.prepareAudioConstraints(n.audio.deviceId,n.audio)):await navigator.mediaDevices.getDisplayMedia(r);const u=i.getVideoTracks()[0],f=MudExObserver.getElement(t);return f&&typeof f.play=="function"&&(f.autoplay=!0,f.muted=!0,f.srcObject=i,f.play()),this._preselected[u.id]=i,{id:u.id,label:u.label,kind:u.kind,deviceId:u.getSettings().deviceId,stats:u.stats,enabled:u.enabled,muted:u.muted,readyState:u.readyState}}catch(u){return console.error("Error selecting capture source",u),null}}static stopPreviewCapture(n){const t=this._preselected[n];t&&(t.getTracks().forEach(n=>n.stop()),delete this._preselected[n])}static async takePhoto(n,t){const r=this.generateUniqueId();console.warn("PHOTO TAKER");const u=await this.setupCapture(n,r,t);await new Promise(n=>setTimeout(n,10));this.recordings[r]=u;const i={},f="image/png";return u.screenStream&&(i.captureData=await this.captureImageFromStream(u.screenStream,f)),u.cameraStream&&(i.cameraData=await this.captureImageFromStream(u.cameraStream,f)),i.captureData&&i.cameraData&&(i.combinedData=await this.combineCapturedImages(i.captureData,i.cameraData,n,f)),i.options=n,i.captureId=r,this.stopCapture(r,t),t&&t.invokeMethodAsync&&t.invokeMethodAsync("Invoke",i),r}static async startCapture(n,t){if(n.takePhoto)return await this.takePhoto(n,t);const i=this.generateUniqueId(),r=await this.setupCapture(n,i,t);return r.recorders.forEach(n=>{setTimeout(()=>{n.start()},1)}),this.recordings[i]=r,i}static stopCapture(n,t){t&&t.invokeMethodAsync&&t.invokeMethodAsync("OnStopped",n);const i=this.recordings[n];if(i){i.recorders.forEach(n=>{try{n.stop()}catch(t){}});const t=i.borrowedTracks||[];if(i.streams.forEach(n=>{n&&typeof n.getTracks=="function"&&n.getTracks().forEach(n=>{if(t.indexOf(n)===-1)try{n.stop()}catch(i){}})}),i.audioContext)try{i.audioContext.close()}catch(r){}delete this.recordings[n]}this._preselected[n]=null;delete this._preselected[n]}static removeOptionsWithoutNullProperties(n){var i={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==null&&(i[t]=n[t]);return i}static prepareAudioConstraints(n,t){return this.constraintsAsMediaOptions(n,t,"audio")}static prepareVideoConstraints(n,t){return this.constraintsAsMediaOptions(n,t,"video")}static constraintsAsMediaOptions(n,t,i){const u=t?{...t}:{};n=n||u.deviceId;const r={};return r[i]={...u},r[i].deviceId=n&&n!=="default"?{exact:n}:undefined,r}static async setupCapture(n,t,i){var a=this.removeOptionsWithoutNullProperties(n.captureMediaOptions);n.contentType=n.contentType||"video/webm; codecs=vp9";const s=n.audioContentType||"audio/webm";n.captureScreen||n.videoDevice||n.videoSource||n.videoConstraints?.deviceId||(n.contentType=s);const r={screen:null,camera:null,audio:null,systemAudio:null,audioContext:null},c=[],l=t=>(t&&n.keepSourceStreamsAlive&&t.getTracks().forEach(n=>c.push(n)),t);if(n.captureScreen)try{let i;n.screenSource&&this._preselected[n.screenSource.id]?(i=this._preselected[t]=l(this._preselected[n.screenSource.id]),delete this._preselected[n.screenSource.id]):i=await navigator.mediaDevices.getDisplayMedia(a);r.screen=new MediaStream(i.getVideoTracks());const u=i.getAudioTracks();u.length>0&&(r.systemAudio=new MediaStream(u))}catch(v){console.warn("System Audio konnte nicht erfasst werden:",v)}if(n.videoSource&&this._preselected[n.videoSource.id]){const t=l(this._preselected[n.videoSource.id]);delete this._preselected[n.videoSource.id];r.camera=new MediaStream(t.getVideoTracks());const i=t.getAudioTracks();i.length>0&&!r.systemAudio&&(r.systemAudio=new MediaStream(i))}else if(n.videoDevice){let t=typeof n.videoDevice=="string"?n.videoDevice:n.videoDevice?.deviceId;const i=typeof n.videoDevice=="string"?{}:n.videoDevice,u=this.prepareVideoConstraints(t,i);try{r.camera=await navigator.mediaDevices.getUserMedia(u)}catch(f){console.error("Error while accessing the camera:",f)}}const y=await this.getAudioStreams(n.audioDevices),{stream:p,audioContext:w}=this.mixAudioStreams(y);r.audio=p;r.audioContext=w;const{combinedStream:h,canvas:e}=this.createCombinedStream(r,n,t),u={screen:[],camera:[],audio:[],systemAudio:[],combined:[]},f=[];if(r.screen){const t=new MediaRecorder(r.screen,{mimeType:n.contentType});t.ondataavailable=n=>u.screen.push(n.data);f.push(t)}if(r.systemAudio){const n=new MediaRecorder(r.systemAudio,{mimeType:s});n.ondataavailable=n=>u.systemAudio.push(n.data);f.push(n)}if(r.camera){const t=new MediaRecorder(r.camera,{mimeType:n.contentType});t.ondataavailable=n=>u.camera.push(n.data);f.push(t)}if(r.audio){const n=new MediaRecorder(r.audio,{mimeType:s});n.ondataavailable=n=>u.audio.push(n.data);f.push(n)}if(h){const r=new MediaRecorder(h,{mimeType:n.contentType});r.ondataavailable=n=>u.combined.push(n.data);r.onstop=async()=>
1{e&&e.stream&&e.stream.getTracks().forEach(n=>n.stop()),await this.saveVideoData(u,i,t,n)};f.push(r)}const o={streams:Object.values(r).filter(n=>n!==null),borrowedTracks:c,recorders:f,screenStream:r.screen,cameraStream:r.camera,audioStream:r.audio,systemAudioStream:r.systemAudio,combinedStream:h,canvas:e,audioContext:r.audioContext};return o.screenStream&&(o.screenStream.addEventListener("inactive",()=>{this.stopCapture(t,i)}),o.screenStream.getVideoTracks()[0].addEventListener("ended",()=>{this.stopCapture(t,i)})),o}static async combineCapturedImages(n,t,i,r="image/png"){return new Promise(async u=>{const e=new Image;e.src=n.blobUrl;const s=new Image;s.src=t.blobUrl;await Promise.all([new Promise(n=>{e.onload=n}),new Promise(n=>{s.onload=n})]);const f=document.createElement("canvas");f.width=e.width;f.height=e.height;const h=f.getContext("2d");h.drawImage(e,0,0,f.width,f.height);const o=this.calculateOverlayPosition(i,f.width,f.height);h.drawImage(s,o.x,o.y,o.width,o.height);const c=await this.captureImageFromCanvas(f,r);u(c)})}static calculateOverlayPosition(n,t,i){let r=0,u=0,e,f;try{const r=typeof n.overlaySize=="string"?JSON.parse(n.overlaySize):n.overlaySize;e=r.width.cssValue.includes("%")?t*parseFloat(r.width.cssValue)/100:parseFloat(r.width.cssValue);f=r.height.cssValue.includes("%")?i*parseFloat(r.height.cssValue)/100:parseFloat(r.height.cssValue)}catch(o){e=t*.2;f=t*.2*(9/16)}if(n.overlayPosition==="Custom"&&n.overlayCustomPosition)try{const f=typeof n.overlayCustomPosition=="str
1ing"?JSON.parse(n.overlayCustomPosition):n.overlayCustomPosition;r=f.left.cssValue.includes("%")?t*parseFloat(f.left.cssValue)/100:parseFloat(f.left.cssValue);u=f.top.cssValue.includes("%")?i*parseFloat(f.top.cssValue)/100:parseFloat(f.top.cssValue)}catch(o){console.warn("Fehler beim Parsen der Custom Position:",o);r=20;u=i-f-20}else switch(n.overlayPosition){case"Center":r=(t-e)/2;u=(i-f)/2;break;case"CenterLeft":r=20;u=(i-f)/2;break;case"CenterRight":r=t-e-20;u=(i-f)/2;break;case"TopCenter":r=(t-e)/2;u=20;break;case"TopLeft":r=20;u=20;break;case"TopRight":r=t-e-20;u=20;break;case"BottomCenter":r=(t-e)/2;u=i-f-20;break;case"BottomLeft":r=20;u=i-f-20;break;case"BottomRight":default:r=t-e-20;u=i-f-20}return{x:r,y:u,width:e,height:f}}static createCombinedStream(n,t,i){const{screen:u,camera:f,audio:w,systemAudio:b,audioContext:k}=n,d=[w,b].filter(n=>n),{stream:e}=this.mixAudioStreams(d);if(n.audioContext=k,!u&&!f)return{combinedStream:e,canvas:null};if(!u||!f){const n=u||f;return{combinedStream:this.combineStreams(n,e),canvas:null}}const r=document.createElement("canvas"),l=r.getContext("2d"),g=u.getVideoTracks()[0],a=g.getSettings();r.width=a.width;r.height=a.height;const o=document.createElement("video"),s=document.createElement("video"),v=t.overlaySource==="VideoDevice";o.srcObject=v?u:f;s.srcObject=v?f:u;o.play();s.play();const y=t.frameRate||30,nt=1e3/y;let h=0;const p=n=>{if(this.recordings[i]){if(!h||n-h>=nt){h=n;l.drawImage(o,0,0,r.width,r.height);const i=this.calculateOverlayPosition(t,r.width,r.height);l.drawImage(s,i.x,i.y,i.width,i.height)}requestAnimationFrame(p)}};requestAnimationFrame(p);const c=r.captureStream(y);return e&&e.getAudioTracks().forEach(n=>c.addTrack(n)),{combinedStream:c,canvas:{element:r,stream:c,videos:[o,s]}}}static async getAudioStreams(n){if(!n||n.length===0)return[];const t=await Promise.all(n.map(async n=>{try{const t=typeof n=="string"?n:n.deviceId,i=typeof n=="string"?{}:n;return await navigator.mediaDevices.getUserMedia(this.prepareAudioConstraints(t,i))}catch(t){return console.warn(`Audio device with ID ${deviceId} konnte nicht abgerufen werden.`,t),null}}));return t.filter(n=>n!==null)}static combineStreams(n,t){const i=new MediaStream;return n&&(n.getVideoTracks().forEach(n=>i.addTrack(n)),n.getAudioTracks().forEach(n=>n.stop())),t&&t.getAudioTracks().forEach(n=>i.addTrack(n)),i}static mixAudioStreams(n){if(!n||n.length===0)return{stream:null,audioContext:null};const t=new(window.AudioContext||window.webkitAudioContext),i=t.createMediaStreamDestination();return n.forEach(n=>{const r=t.createMediaStreamSource(n);r.connect(i)}),{stream:i.stream,audioContext:t}}static generateUniqueId(){return`${(new Date).getTime()}`}static async saveVideoData(n,t,i,r){const{screen:f,camera:e,audio:o,systemAudio:s,combined:h}=n,u=async(n,t)=>{if(!n||n.length===0)return null;const i=new Blob(n,{type:t}),r=await i.arrayBuffer();return{bytes:new Uint8Array(r),blobUrl:URL.createObjectURL(i),contentType:t}},c={captureData:await u(f,r.contentType),cameraData:await u(e,r.contentType),audioData:await u(o,r.audioContentType||"audio/webm"),systemAudioData:await u(s,r.audioContentType||"audio/webm"),combinedData:await u(h,r.contentType),options:r,captureId:i};t.invokeMethodAsync&&t.invokeMethodAsync("Invoke",c)}static captureImageFromCanvas(n,t){return new Promise(i=>{n.toBlob(n=>{n?n.arrayBuffer().then(r=>{i({bytes:new Uint8Array(r),blobUrl:URL.createObjectURL(n),contentType:t})}):i(null)},t)}
1)}static async captureImageFromVideo(n,t){const i=document.createElement("canvas");i.width=n.videoWidth||640;i.height=n.videoHeight||480;const r=i.getContext("2d");return r.drawImage(n,0,0,i.width,i.height),await this.captureImageFromCanvas(i,t)}static async captureImageFromStream(n,t){return new Promise(i=>{const r=document.createElement("video");r.srcObject=n;r.muted=!0;r.play();r.addEventListener("loadedmetadata",async()=>{const n=await this.captureImageFromVideo(r,t);i(n)})})}static async getDevices(){return await navigator.mediaDevices.enumerateDevices()}static async getAvailableAudioDevices(){try{await navigator.mediaDevices.getUserMedia({video:!1,audio:!0})}catch(t){}const n=await navigator.mediaDevices.enumerateDevices();return n.filter(n=>n.kind==="audioinput")}static async getAvailableVideoDevices(){try{await navigator.mediaDevices.getUserMedia({video:!0,audio:!1})}catch(t){}const n=await navigator.mediaDevices.enumerateDevices();return n.filter(n=>n.kind==="videoinput")}}window.MudExCapture=MudExCapture;class MudExColorHelper{static ensureHex(n){try{return!this.isHex(n)&&n.toLowerCase().startsWith("rgb")&&(n=this.rgbaToHex(n)),n}catch(t){return n}}static isHex(n){if(!n)return!1;n=n.replace("#","");var t=parseInt(n,16);return t.toString(16)===n}static hexToRgbA(n){try{var t;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(n))return t=n.substring(1).split(""),t.length==3&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]),t="0x"+t.join(""),"rgba("+[t>>16&255,t>>8&255,t&255].join(",")+",1)"}catch(i){return""}return""}static rgbaToHex(n){try{var i,t=n.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i),r=(t&&t[4]||"").trim(),u=t?(t[1]|256).toString(16).slice(1)+(t[2]|256).toString(16).slice(1)+(t[3]|256).toString(16).slice(1):n;return i=r!==""?r:1,i=(i*255|256).toString(16).slice(1),u+i}catch(f){return""}}static isTransparent(n){return n&&(n.toLowerCase()==="transparent"||n.includes("NaN"))}static isNone(n){return n&&(n.toLowerCase()==="none"||n.includes("ed"))}static isTransparentOrNone(n){return this.isNone(n)||this.isTransparent(n)}static argbToHex(n){return"#"+("000000"+(n&16777215).toString(16)).slice(-6)}static hexToArgb(n){return parseInt(n.replace("#","FF"),16)<<32}static hexToHsl(n){return this.rgbToHsl(this.hexToRgb(n))}static hslToHex(n){return this.rgbToHex(this.hslToRgb(n))}static setLuminance(n,t){if(!n)return n;var i=this.rgbToHsl(this.hexToRgb(n));return i.l=Math.max(Math.min(1,t),0),this.rgbToHex(this.hslToRgb(i))}static hexToRgb(n){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}static rgbIntToHex(n){let t=Number(n).toString(16);return t.length<6&&(t="000000".substring(t.length)+t),t}static hslToRgb(n){const e=n.h,r=n.s,t=n.l;let u,o,s,h,f,i;return r===0?o=s=h=t:(u=function(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n},i=t<.5?t*(1+r):t+r-t*r,f=2*t-i,o=u(f,i,e+1/3),s=u(f,i,e),h=u(f,i,e-1/3)),{r:MudExNumber.constrain(Math.round(o*255),0,255),g:MudExNumber.constrain(Math.round(s*255),0,255),b:MudExNumber.constrain(Math.round(h*255),0,255)}}static rgbToHsl(n){if(!n)return n;const e=n.r/255,t=n.g/255,i=n.b/255,r=Math.max(e,t,i),o=Math.min(e,t,i),h=(r+o)/2;let u,s,f;if(r===o)u=s=0;else{f=r-o;s=h>.5?f/(2-r-o):f/(r+o);switch(r){case e:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-e)/f+2;break;case i:u=(e-t)/f+4}u/=6}return{h:u,s,l:h}}static rgbToHex(n){const t=function(n){const t=n.toString(16);return t.length===1?"0"+t:t};return"#"+t(n.r)+t(n.g)+t(n.b)}static getOptimalForegroundColor(n,t,i){return this.perceivedBrightness(n)>190?i||"#000000":t||"#FFFFFF"}static perceivedBrightness(n){return n?(typeof n!="object"&&(n=this.hexToRgb(n)),Math.sqrt(n.r*n.r*.241+n.g*n.g*.691+n.b*n.b*.068)):0}}window.MudExColorHelper=MudExColorHelper;class MudExCssHelper{static getCssVariables(){const n=Array.from(document.styleSheets).filter(n=>n.href===null||n.href.startsWith(window.location.origin)).reduce((n,t)=>n=[...n,...Array.from(t.cssRules).reduce((n,t)=>n=t.selectorText===":root"?[...n,...Array.from(t.style).filter(n=>n.startsWith("--"))]:n,[])],[]),t=document.documentElement.style,i=Array.from(t).filter(n=>n.startsWith("--")),r=Array.from(new Set([...n,...i]));return r.map(n=>({key:n,value:this.getCssVariableValue(n)}))}static findCssVariables(n){n=n.toLowerCase();const t=MudExColorHelper;return this.getCssVariables().filter(i=>i.value.toLowerCase().includes(n)||t.ensureHex(i.value).includes(t.ensureHex(n))
1)}static getCssVariableValue(n){return n.startsWith("--")||(n="--"+n),getComputedStyle(document.documentElement).getPropertyValue(n).trim()}static setCssVariableValue(n,t){n.startsWith("--")||(n="--"+n);document.documentElement.style.setProperty(n,t)}static setElementAppearance(n,t,i,r){var u=document.querySelector(n);this.setElementAppearanceOnElement(u,t,i,r)}static setElementAppearanceOnElement(n,t,i,r){n&&(n.className=r&&n.className?n.className+" "+t:t,n.style.cssText=r&&n.style.cssText?n.style.cssText+" "+i:i)}static removeElementAppearance(n,t,i){var r=document.querySelector(n);this.removeElementAppearanceOnElement(r,t,i)}static removeElementAppearanceOnElement(n,t,i){if(n&&(t&&n.classList.remove(t),i)){let t=n.style.cssText.split(";").map(n=>n.trim()).filter(n=>n!==i&&!n.startsWith(i.split(":")[0])).join("; ");n.style.cssText=t}}static createTemporaryClass(n,t){t=t||"class_"+Math.random().toString(36).substr(2,9);t=t.startsWith(".")?t.slice(1):t;let i=document.getElementById("mud-ex-dynamic-styles");return i||(i=document.createElement("style"),i.type="text/css",i.id="mud-ex-dynamic-styles",document.head.appendChild(i)),i.sheet.insertRule("."+t+" { "+n+" }",0),t}static floatPopupAtAnchor(n,t){const o=document.getElementById(n),i=document.getElementById(t);if(!o||!i)return;i.style.maxWidth="";const u=o.getBoundingClientRect(),v=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,r=8;i.style.position="fixed";const y=Math.max(u.width,i.offsetWidth||0);i.style.minWidth=y+"px";const e=v-u.bottom-r,h=u.top-r,c=i.offsetHeight;let l=!1;if(c>e&&h>e&&(l=!0),l){const n=Math.max(120,h);i.style.maxHeight=n+"px";i.style.top=Math.max(r,u.top-2-Math.min(c,n))+"px"}else{const n=Math.max(120,e);i.style.maxHeight=n+"px";i.style.top=u.bottom+2+"px"}let f=u.left;const a=i.offsetWidth;f+a>s-r&&(f=Math.max(r,s-a-r));f<r&&(f=r);i.style.left=f+"px";i.style.right="auto"}static deleteClassRule(n){var r,i;let u=document.getElementById("mud-ex-dynamic-styles");if(!u)return;let t=u.sheet;for(r=t.cssRules||t.rules,n=n.startsWith(".")?n.slice(1):n,i=0;i<r.length;i++)if(r[i].selectorText==="."+n){t.deleteRule?t.deleteRule(i):t.removeRule&&t.removeRule(i);break}}static getAllCssClasses(n){n=n||{};const s=n.includeStyles!==!1,u=(n.prefix||"").toString(),f=(n.sourceFilter||"").toString().toLowerCase(),e=/\.([a-zA-Z_][\w-]*)/g,t=new Map,i=new Map,h=n=>{if(!n)return"inline";if(n.href)try{const t=new URL(n.href,window.location.href);return(t.pathname||n.href).split("/").pop()||n.href}catch{return n.href}return n.ownerNode&&n.ownerNode.id?"#"+n.ownerNode.id:"inline"},o=(n,t)=>{if(!n)return;if(n.cssRules&&n.cssRules.length&&!n.selectorText){Array.from(n.cssRules).forEach(n=>o(n,t));return}const r=n.selectorText;if(!r)return;let f;for(e.lastIndex=0;(f=e.exec(r))!==null;){const o=f[1];if(!u||o.startsWith(u)){const h=o;let e=i.get(h);e||(e={name:o,selectors:[],source:t,styles:""},i.set(h,e));e.selectors.indexOf(r)===-1&&e.selectors.push(r);s&&n.style&&n.style.cssText&&!e.styles&&(e.styles=n.style.cssText.trim())}}};Array.from(document.styleSheets).forEach(n=>{const i=h(n);if(f&&i.toLowerCase().indexOf(f)===-1)return;let t;try{t=n.cssRules}catch{return}t&&Array.from(t).forEach(n=>o(n,i))});i.forEach(n=>{const i=t.get(n.source)||[];i.push(n);t.set(n.source,i)});const r=[];return t.forEach((n,t)=>{n.sort((n,t)=>n.name.localeCompare(t.name)),r.push({source:t,classes:n})}),r.sort((n,t)=>n.source.localeCompare(t.source)),r}static getClassStyles(n){if(!n)return"";n.startsWith(".")&&(n=n.slice(1));const r="."+n,u=Array.from(document.styleSheets),t=[],i=n=>{if(!n)return;if(n.cssRules&&!n.selectorText){Array.from(n.cssRules).forEach(i);return}if(!n.selectorText)return;const u=n.selectorText.split(",").map(n=>n.trim());for(const i of u)if(i===r){n.style&&n.style.cssText&&t.push(n.style.cssText.trim());return}};for(const n of u){let t;try{t=n.cssRules}catch{continue}t&&Array.from(t).forEach(i)}return t.join(" ")}static getComputedStyleFor(n,t){const r=document.querySelector(n);if(!r)return"";const i=window.getComputedStyle(r);if(t&&t.length)return t.map(n=>`${n}: ${i.getPropertyValue(n)}`).join("; ");const u=[];for(let n=0;n<i.length;n++){const t=i[n];u.push(`${t}: ${i.getPropertyValue(t)}`)}return u.join("; ")}}window.MudExCssHelper=MudExCssHelper;class MudExDomHelper{dom;constructor(n){this.dom=n}_asArray(n){return Array.isArray(n)?n:[n]}down(n){var t=this.dom.querySelector(n);return t?new MudExDomHelper(t):null}isVisible(n){var i,r,e,t,o;if(!n)return this.dom.style.display!=="none"&&this.dom.style.visibility!=="hidden";if(i=this.dom,i.offsetWidth===0||i.offsetHeight===0)return!1;var u=document.documentElement.clientHeight,f=i.getClientRects(),s=function(n){var t=(n.left+n.right)/2,r=(n.top+n.bottom)/2;return document.elementFromPoint(t,r)===i};for(r=0,e=f.length;r<e;
1r++)if(t=f[r],o=t.top>0?t.top<=u:t.bottom>0&&t.bottom<=u,o&&s(t))return!0;return!1}setStyle(n){return Object.assign(this.dom.style,n),this}getStyleValue(n){return this.dom.style.getPropertyValue(n)}addCls(n){return this._asArray(n).forEach(n=>this.dom.classList.add(n)),this}removeCls(n){return this._asArray(n).forEach(n=>this.dom.classList.remove(n)),this}toggleCls(n){return this._asArray(n).forEach(n=>{this.dom.classList.contains(n)?this.removeCls(n):this.addCls(n)}),this}show(){return this.dom.style.display="",this}hide(){return this.dom.style.display="none",this}getBounds(){return this.dom.getBoundingClientRect()}getWidth(){return this.getBounds().width}getHeight(){return this.getBounds().height}getX(){return this.getXY()[0]}getY(){return this.getXY()[1]}getXY(){var r=Math.round,u=document.body,n=this.dom,f=0,e=0,t,i;if(n!==document&&n!==u)try{t=u.getBoundingClientRect();i=n.getBoundingClientRect();f=i.left-t.left;e=i.top-t.top}catch(o){}return[r(f),r(e)]}forcefocus(){this.dom.focus({focusVisible:!0})}focusDelayed(n){return this.forcefocus(),setTimeout(()=>this.forcefocus(),n||50),this}static focusElementDelayed(n,t,i){let r=this.create(n);return i&&(i.stopPropagation(),i.preventDefault()),r?r.focusDelayed(t):null}static scrollParent(n){for(let t=n?.parentElement;t&&t!==document.body;t=t.parentElement){const n=getComputedStyle(t).overflowY;if(/(auto|scroll|overlay)/.test(n)&&t.scrollHeight>t.clientHeight)return t}return null}static scrollIntoContainer(n,t=true){const r=MudExDomHelper.ensureElement(n),i=MudExDomHelper.scrollParent(r);if(!r||!i)return!1;const u=r.getBoundingClientRect().top-i.getBoundingClientRect().top+i.scrollTop;return i.scrollTop=t?u-Math.max(0,(i.clientHeight-r.offsetHeight)/2):u,!0}static ensureElement(n){return typeof n=="string"?document.querySelector(n):n}static create(n){let t=this.ensureElement(n);return t?new MudExDomHelper(t):null}static toRelative(n,t=false){if(!n||!(n instanceof HTMLElement)){console.error("Das angegebene Element ist ungültig.");return}const i=n.offsetParent,u=t||!i?window.innerWidth:i.offsetWidth,f=t||!i?window.innerHeight:i.offsetHeight;if(!u||!f){console.warn("No reference to set relatives");return}const r=getComputedStyle(n),e=parseFloat(r.left),o=parseFloat(r.top),s=parseFloat(r.width),h=parseFloat(r.height),c=e/u*100,l=o/f*100,a=s/u*100,v=h/f*100;n.style.left=`${c}%`;n.style.top=`${l}%`;n.style.width&&n.style.width!=="auto"&&(n.style.width=`${a}%`);n.style.height&&n.style.height!=="auto"&&(n.style.height=`${v}%`)}static toAbsolute(n,t){n.style.position="absolute";var i=n.getBoundingClientRect();n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.width=t?"auto":i.width+"px"}static ensureElementIsInScreenBounds(n){var t=n.getBoundingClientRect(),r=t.width===0&&t.height===0,i;if(r){const t=new ResizeObserver(()=>{t.disconnect(),this.ensureElementIsInScreenBounds(n)});t.observe(n);return}if(i=!!n.getAnimations().length,i){n.addEventListener("animationend",()=>this.ensureElementIsInScreenBounds(n),{once:!0});return}t.left<0&&(n.style.left="0px");t.top<0&&(n.style.top="0px");t.right>window.innerWidth&&(n.style.left=window.innerWidth-n.offsetWidth+"px");t.bottom>window.innerHeight&&(n.style.top=window.innerHeight-n.offsetHeight+"px")}static syncSize(n,t,i,r){function s(){var n=u.getBoundingClientRect(),t,e;i.width&&(t=n.width,f.style.width=t+"px",i.minWidth&&(f.style.minWidth=i.minWidth));i.height&&(e=n.height,f.style.height=e+"px",i.minHeight&&(f.style.minHeight=i.minHeight));r&&r.invokeMethodAsync("OnSyncResized",n,null,null)}var u,f,e;if(i=i||{width:!0,height:!1,live:!0,minWidth:"auto"},u=MudExObserver.getElement(n),f=MudExObserver.getElement(t),u=u?.parentElement||u,u&&f){var o=f.getBoundingClientRect(),h=o.width+"px",c=o.height+"px";i.minWidth==="auto"&&(i.minWidth=h);i.minHeight==="auto"&&(i.minHeight=c);s();i.live&&(e=new ResizeObserver(()=>{if(!u.isConnected){e.disconnect();return}s()}),e.observe(u))}}}window.MudExDomHelper=MudExDomHelper;class MudExEventHelper{static isWithin(n,t){if(!t||!n)return!1;let i=t.getBoundingClientRect();return n.clientX>i.left&&n.clientX<i.right&&n.clientY<i.bottom&&n.clientY>i.top}static clickElementById(n){function i(){var r=document.querySelector("#"+n)||document.getElementById(n);r?r.click():t>0&&(t--,setTimeout(i,100))}var t=5;i()}static stringifyEvent(n){const t={};for(let i in n)t[i]=n[i];return JSON.stringify(t,(n,t)=>t instanceof Node?"Node":t instanceof Window?"Window":t," ")}static stopFor(n,t,i){n!==undefined&&n!==null&&(n.__internalDispatched=!0,n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i&&setTimeout(()=>{t.dispatchEvent(n)},i))}static cloneEvent(n,t){function r(){}if(t)return JSON.parse(this.stringifyEvent(event));if(n===undefined||n===null)return undefined;let i=new r;for(let t in n){let r=Object.getOwnPropertyDescriptor(n,t);r&&(r.get||r.set)?Object.defineProperty(i,t,r):i[t]=n[t]}return Object.setPrototypeOf(i,n),i}static addEventListenerCallback(n,t,i,r){var u=n=>{const t={type:n.type,targetId:n.target.id,clientX:n.clientX,clientY:n.clientY};r.invokeMethodAsync(i,t)};n!==undefined&&n!==null&&(n.addEventListener?n.addEventListener(t,u):n.attachEvent("on"+t,u))}}window.MudExEventHelper=MudExEventHelper;window.MudExExternalFileDrop={attach:function(n,t,i){const o='[data-mudex-drop-zone="'+n+'"][data-mudex-drop-target]';function r(n){const t=n.target instanceof Element?n.target.closest(o):null;return t?t.getAttribute("data-mudex-drop-target"):null}function u(n){return!!n.dataTransfer&&Array.from(n.dataTransfer.types||[]).indexOf("Files")>=0}function f(n){u(n)&&r(n)!==null&&n.preventDefault()}async function e(n){if(!u(n))return;const f=r(n);if(f===null)return;n.preventDefault();n.stopPropagation();await i.invokeMethodAsync("SetExternalDropTargetKey",f);const e=new DataTransfer;
1Array.from(n.dataTransfer.files).forEach(n=>e.items.add(n));t.files=e.files;t.dispatchEvent(new Event("change",{bubbles:!0}))}return document.addEventListener("dragover",f,!0),document.addEventListener("drop",e,!0),{dispose:()=>{document.removeEventListener("dragover",f,!0),document.removeEventListener("drop",e,!0)}}}};window.MudExFileGridSelection={attach:function(n,t,i){function rt(){return n.querySelector(".mud-ex-file-grid-scroll")||n}if(!n)return null;const a=48,w=18;let e=null,u=null;function b(){if(u=null,e===null)return;const n=rt(),t=n.getBoundingClientRect(),i=e-t.top,r=t.bottom-e;i<a?n.scrollTop-=w*(1-Math.max(i,0)/a):r<a&&(n.scrollTop+=w*(1-Math.max(r,0)/a));u=requestAnimationFrame(b)}function k(n){e=n;u===null&&(u=requestAnimationFrame(b))}function f(){e=null;u!==null&&(cancelAnimationFrame(u),u=null)}function d(n){k(n.clientY)}function g(t){n.contains(t.relatedTarget)||f()}function ut(){return Array.from(n.querySelectorAll("[data-file-grid-key]")).map(n=>({key:n.getAttribute("data-file-grid-key"),element:n,rect:n.getBoundingClientRect()}))}function ft(n,t){return n.left<t.right&&n.right>t.left&&n.top<t.bottom&&n.bottom>t.top}n.addEventListener("dragover",d);n.addEventListener("dragleave",g);document.addEventListener("dragend",f);document.addEventListener("drop",f);let r=null,o=0,s=0,v=!1,h=!1,c=[];function et(){const n=r.getBoundingClientRect();return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}function tt(t){t.button!==0||t.target instanceof Element&&t.target.closest("[data-file-grid-key]")||(v=t.ctrlKey||t.metaKey||t.shiftKey,o=t.clientX,s=t.clientY,r=document.createElement("div"),r.className="mud-ex-file-grid-band",r.style.position="fixed",r.style.left=o+"px",r.style.top=s+"px",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.zIndex="10",r.style.visibility="hidden",document.body.appendChild(r),h=!1,c=[],n.setPointerCapture?.(t.pointerId),window.addEventListener("pointermove",y),window.addEventListener("pointerup",p),window.addEventListener("pointercancel",l),window.addEventListener("keydown",it))}function ot(){const n=et();c=[];for(const t of ut()){const i=ft(n,t.rect);i&&c.push(t.key);t.element.classList.toggle("mud-ex-file-grid-band-hit",i)}}function st(){for(const t of n.querySelectorAll(".mud-ex-file-grid-band-hit"))t.classList.remove("mud-ex-file-grid-band-hit")}const nt=4;function y(n){r&&(!h&&Math.abs(n.clientX-o)<nt&&Math.abs(n.clientY-s)<nt||(h=!0,r.style.visibility="visible",k(n.clientY),r.style.left=Math.min(o,n.clientX)+"px",r.style.top=Math.min(s,n.clientY)+"px",r.style.width=Math.abs(n.clientX-o)+"px",r.style.height=Math.abs(n.clientY-s)+"px",ot()))}function it(n){n.key==="Escape"&&r&&l()}function l(){window.removeEventListener("pointermove",y);window.removeEventListener("pointerup",p);window.removeEventListener("pointercancel",l);window.removeEventListener("keydown",it);f();st();r?.remove();r=null;h=!1;c=[]}async function p(){const n=h,i=c.slice();l();n?await t.invokeMethodAsync("RubberBandSelected",i,v):v||await t.invokeMethodAsync("RubberBandSelected",[],!1)}return i&&n.addEventListener("pointerdown",tt),{dispose:()=>{l(),n.removeEventListener("pointerdown",tt),n.removeEventListener("dragover",d),n.removeEventListener("dragleave",g),document.removeEventListener("dragend",f),document.removeEventListener("drop",f),window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",p),f(),r?.remove()}}}};class MudExFileSystemAccess{static _handles={};static isSupported(){return typeof showDirectoryPicker=="function"}static async pickDirectory(n){if(!MudExFileSystemAccess.isSupported())return null;try{const t=await window.showDirectoryPicker({mode:n?"readwrite":"read"});return MudExFileSystemAccess._handles={"/":t},{id:"/",name:t.name,writable:await MudExFileSystemAccess.canWrite(t)}}catch(t){if(t&&t.name==="AbortError")return null;throw t;}}static async canWrite(n){return n.queryPermission?await n.queryPermission({mode:"readwrite"})==="granted":!1}static async listDirectory(n){const t=MudExFileSystemAccess._handles[n];if(!t)return[];const i=[];for await(const[r,u]of t.entries()){const t=n==="/"?"/"+r:n+"/"+r;MudExFileSystemAccess._handles[t]=u;const f=u.kind==="directory";let e=0,o=null,s=null;if(!f){const n=await u.getFile();e=n.size;o=new Date(n.lastModified).toISOString();s=n.type||null}i.push({id:t,name:r,isDirectory:f,size:e,lastModified:o,contentType:s})}return i}static async createFileUrl(n){const t=MudExFileSystemAccess._handles[n];return!t||t.kind!=="file"?null:URL.createObjectURL(await t.getFile())}static revokeUrl(n){URL.revokeObjectURL(n)}static _join(n,t){return n==="/"?"/"+t:n+"/"+t}static _forget(n){const t=n==="/"?"/":n+"/";
1Object.keys(MudExFileSystemAccess._handles).forEach(i=>{(i===n||i.startsWith(t))&&delete MudExFileSystemAccess._handles[i]})}static async _entry(n,t,i){if(MudExFileSystemAccess._handles[n]=i,i.kind==="directory")return{id:n,name:t,isDirectory:!0,size:0,lastModified:null,contentType:null};const r=await i.getFile();return{id:n,name:t,isDirectory:!1,size:r.size,lastModified:new Date(r.lastModified).toISOString(),contentType:r.type||null}}static async entryExists(n,t){const i=MudExFileSystemAccess._handles[n];if(!i||i.kind!=="directory")return!1;try{return await i.getFileHandle(t),!0}catch(r){}try{return await i.getDirectoryHandle(t),!0}catch(r){return!1}}static async createDirectory(n,t){const i=MudExFileSystemAccess._handles[n];if(!i||i.kind!=="directory")return null;const r=await i.getDirectoryHandle(t,{create:!0});return await MudExFileSystemAccess._entry(MudExFileSystemAccess._join(n,t),t,r)}static async writeFile(n,t,i){const r=MudExFileSystemAccess._handles[n];if(!r||r.kind!=="directory")return null;const e=await i.arrayBuffer(),u=await r.getFileHandle(t,{create:!0}),f=await u.createWritable();return await f.write(e),await f.close(),await MudExFileSystemAccess._entry(MudExFileSystemAccess._join(n,t),t,u)}static async remove(n){const t=MudExFileSystemAccess._handles[n];if(!t)return!1;if(typeof t.remove=="function")await t.remove({recursive:!0});else{const i=n.lastIndexOf("/"),r=MudExFileSystemAccess._handles[i<=0?"/":n.substring(0,i)];if(!r)return!1;await r.removeEntry(t.name,{recursive:!0})}return MudExFileSystemAccess._forget(n),!0}static async moveEntry(n,t,i){const r=MudExFileSystemAccess._handles[n],u=MudExFileSystemAccess._handles[t];if(!r||!u||u.kind!=="directory")return null;const f=i||r.name;r.kind==="file"&&typeof r.move=="function"?(await r.move(u,f),MudExFileSystemAccess._forget(n)):(await MudExFileSystemAccess._copyInto(r,u,f),await MudExFileSystemAccess.remove(n));const e=MudExFileSystemAccess._join(t,f),o=r.kind==="directory"?await u.getDirectoryHandle(f):await u.getFileHandle(f);return await MudExFileSystemAccess._entry(e,f,o)}static async _copyInto(n,t,i){if(n.kind==="file"){const f=await n.getFile(),r=await t.getFileHandle(i,{create:!0}),u=await r.createWritable();return await u.write(f),await u.close(),r}const r=await t.getDirectoryHandle(i,{create:!0});for await(const[t,i]of n.entries())await MudExFileSystemAccess._copyInto(i,r,t);return r}static relativePaths(n){const t=n&&n.files?n.files:[];return Array.from(t).map(n=>({relativePath:n.webkitRelativePath||n.name,size:n.size,lastModified:new Date(n.lastModified).toISOString(),contentType:n.type||null}))}}window.MudExFileSystemAccess=MudExFileSystemAccess;class MudExNumber{static constrain(n,t,i){var r=parseFloat(n);return t===null&&(t=n),i===null&&(i=n),r<t?t:r>i?i:r}static async md5(n){return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(n.trim().toLowerCase())))).map(n=>n.toString(16).padStart(2,"0")).join("")}}window.MudExNumber=MudExNumber;class MudExObserver{static observer=null;static observedElements=new Map;static initObserver(){MudExObserver.observer==null&&(MudExObserver.observer=new IntersectionObserver(n=>{n.forEach(async n=>{const t=MudExObserver.observedElements.get(n.target),u=n.target.getAttribute("data-apply-styles-first")==="true",f=n.target.getAttribute("data-virtualize")==="true";if(!t||u&&f||await t.invokeMethodAsync("OnVisibilityChanged",n.isIntersecting),!f)return;const e=n.target.getAttribute("data-intersect-style")||"",o=n.target.getAttribute("data-no-intersect-style")||"",i=n.target.getAttribute("data-intersect-class")||"",r=n.target.getAttribute("data-no-intersect-class")||"";n.target.setAttribute("data-intersecting",n.isIntersecting);n.isIntersecting?(n.target.style.cssText+=e,n.target.style.cssText=n.target.style.cssText.replace(o,""),i&&n.target.classList.add(...i.split(" ")),r&&n.target.classList.remove(...r.split(" "))):(n.target.style.cssText+=o,n.target.style.cssText=n.target.style.cssText.replace(e,""),r&&n.target.classList.add(...r.split(" ")),i&&n.target.classList.remove(...i.split(" ")));t&&u&&await t.invokeMethodAsync("OnVisibilityChanged",n.isIntersecting)})}
1))}static observeVisibility(n,t){MudExObserver.initObserver();const i=MudExObserver.getElement(n);i&&(MudExObserver.observedElements.set(i,t),MudExObserver.observer.observe(i))}static unObserveVisibility(n){const t=MudExObserver.getElement(n);t&&MudExObserver.observedElements.has(t)&&(MudExObserver.observer.unobserve(t),MudExObserver.observedElements.delete(t))}static getElement(n){return typeof n=="string"?document.querySelector(n)||document.getElementById(n):n instanceof Element?n:null}}window.MudExObserver=MudExObserver;window.MudExPkcs12={decryptPbes2:async function(n,t,i,r,u,f,e){try{const o=await crypto.subtle.importKey("raw",(new TextEncoder).encode(n),"PBKDF2",!1,["deriveKey"]),s=await crypto.subtle.deriveKey({name:"PBKDF2",salt:toBytes(t),iterations:i,hash:r},o,{name:"AES-CBC",length:u},!1,["decrypt"]),h=await crypto.subtle.decrypt({name:"AES-CBC",iv:toBytes(f)},s,toBytes(e));return toBase64(new Uint8Array(h))}catch(o){return null}}};class MudExScriptLoader{static _pending={};static loadScript(n){return this._pending[n]?this._pending[n]:(this._pending[n]=new Promise((t,i)=>{const f=document.querySelector(`script[data-mudex-src="${n}"]`);if(f){t();return}const e=window.define,u=()=>{window.define=e},r=document.createElement("script");r.src=n;r.async=!1;r.dataset.mudexSrc=n;r.onload=()=>{u(),t()};r.onerror=()=>{u(),delete MudExScriptLoader._pending[n],i(new Error("Failed to load "+n))};window.define=undefined;document.head.appendChild(r)}),this._pending[n])}static async loadScripts(n){for(const t of n)await this.loadScript(t)}static loadStyle(n){const t="style:"+n;return this._pending[t]?this._pending[t]:(this._pending[t]=new Promise(t=>{if(document.querySelector(`link[data-mudex-src="${n}"]`)){t();return}const i=document.createElement("link");i.rel="stylesheet";i.href=n;i.dataset.mudexSrc=n;i.onload=()=>t();i.onerror=()=>{console.warn("MudExScriptLoader: stylesheet failed to load",n),t()};document.head.appendChild(i)}),this._pending[t])}static resolve(n){return n.split(".").reduce((n,t)=>n==null?n:n[t],window)}static async require(n,t){await this.loadScripts(n);const i=(t||[]).filter(n=>this.resolve(n)===undefined);if(i.length)throw new Error("Loaded "+n.length+" script(s) but these globals are missing: "+i.join(", "));}}window.MudExScriptLoader=MudExScriptLoader;class MudExSpeechRecognition{static recordings={};static async startRecording(n,t){if(!this.isSupported())return console.error("Speech Recognition or MediaRecorder is not supported in this browser."),null;const i=this.generateUniqueId(),{recognition:r,stream:f}=await this.setupRecognition(n,i,t),u=this.setupMediaRecorder(f,t,i);return r.onresult=n=>this.handleRecognitionResult(n,i,t),r.onend=()=>this.handleRecognitionEnd(u,i,t),u.start(),r.start(),this.recordings[i]={recognition:r,mediaRecorder:u,options:n},i}static isSupported(){return"webkitSpeechRecognition"in window&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}static generateUniqueId(){return`${(new Date).getTime()}`}static async setupRecognition(n){const t=new webkitSpeechRecognition;n?.lang&&(t.lang=n.lang);t.continuous=n.continuous;t.interimResults=n.interimResults;var i=typeof n?.device=="string"?n.device:n.device?.deviceId;const r=i?{audio:{deviceId:{exact:i}}}:{audio:!0},u=await navigator.mediaDevices.getUserMedia(r);return{recognition:t,stream:u}}static async getAvailableAudioDevices(){try{await navigator.mediaDevices.getUserMedia({video:!1,audio:!0})}catch(t){}const n=await navigator.mediaDevices.enumerateDevices();return n.filter(n=>n.kind==="audioinput")}static setupMediaRecorder(n,t,i){const r=new MediaRecorder(n),u=[];return r.ondataavailable=n=>u.push(n.data),r.onstop=async()=>this.saveAudioData(u,t,i),r}static async saveAudioData(n,t,i){const r=new Blob(n),u=await r.arrayBuffer(),f=new Uint8Array(u);t.invokeMethodAsync&&t.invokeMethodAsync("Invoke",{...this.recordings[i]?.lastParam,audioData:f});delete this.recordings[i]}static handleRecognitionResult(n,t,i){let r=this.recordings[t]?.options,f="",e="",u=!1;for(let t=n.resultIndex;t<n.results.length;++t)f+=e=n.results[t][0].transcript,n.results[t].isFinal&&(u=!0);let o={transcript:f,transcriptChanges:e,isFinalResult:u,options:r};this.recordings&&this.recordings[t]&&(this.recordings[t].lastParam=o);r&&r.finalResultsOnly&&!u||i.invokeMethodAsync&&i.invokeMethodAsync("Invoke",o)}static handleRecognitionEnd(n,t,i){n.stop();i.invokeMethodAsync&&i.invokeMethodAsync("OnStopped",t)}static stopRecording(n){const t=this.recordings[n];t&&(t.recognition.stop(),t.mediaRecorder.stop())}
1static stopAllRecordings(){Object.keys(this.recordings).forEach(n=>this.stopRecording(n))}}window.MudExSpeechRecognition=MudExSpeechRecognition;class MudExUriHelper{static createBlobUrlFromByteArray(n,t){const i=new Blob([new Uint8Array(n)],{type:t});return URL.createObjectURL(i)}static async readBlobAsText(n){const t=await fetch(n),i=await t.blob();return await i.text()}static async readBlobAsByteArray(n){const t=await fetch(n),i=await t.blob();return await this.blobToByteArray(i)}static blobToByteArray(n){return new Promise((t,i)=>{const r=new FileReader;r.onload=function(){const n=this.result,i=new Uint8Array(n);t(i)};r.onerror=i;r.readAsArrayBuffer(n)})}static blobToBase64(n){return new Promise((t,i)=>{const r=new FileReader;r.onload=function(){const n=btoa(String.fromCharCode(...new Uint8Array(this.result)));t(n)};r.onerror=i;r.readAsArrayBuffer(n)})}static revokeBlobUrl(n){URL.revokeObjectURL(n)}}window.MudExUriHelper=MudExUriHelper;class MudExDialogHandlerBase{constructor(n,t,i,r){this.options=n;this.dotNet=t;this.dotNetService=i;this.onDone=r;this.mudDialogSelector=n.mudDialogSelector||".mud-dialog:not([data-mud-extended=true])";this.mudDialogHeaderSelector=n.mudDialogHeaderSelector||".mud-dialog-title";this._updateDialog(document.querySelector(this.mudDialogSelector));this.disposed=!1;MudExDialogHandlerBase._listeners={}}order=99;on(n,t){MudExDialogHandlerBase._listeners[n]||(MudExDialogHandlerBase._listeners[n]=[]);MudExDialogHandlerBase._listeners[n].push(t)}un(n,t){this.off(n,t)}off(n,t){MudExDialogHandlerBase._listeners[n]&&(MudExDialogHandlerBase._listeners[n]=MudExDialogHandlerBase._listeners[n].filter(n=>n!==t))}_emit(n,...t){if(MudExDialogHandlerBase._listeners[n])for(const i of MudExDialogHandlerBase._listeners[n])try{i(...t)}catch(r){console.error(r)}}async raiseDialogEvent(n){var r=window.innerHeight||document.documentElement.clientHeight,u=window.innerWidth||document.documentElement.clientWidth,f=window.pageXOffset||document.documentElement.scrollLeft,e=window.pageYOffset||document.documentElement.scrollTop,o={windowHeight:r,windowWidth:u,scrollX:f,scrollY:e},t=null;const i=Object.assign(o,JSON.parse(JSON.stringify(this.dialog.getBoundingClientRect())));return this.dotNetService&&(t=await this.dotNetService.invokeMethodAsync("PublishEvent",n,this.dialog.id,this.dotNet,i)),this._emit(n,{dialogId:this.dialog.id,dialog:this.dialog,rect:i}),t}restoreSizeConstraintsIf(){!this.options.keepMaxSizeConstraints&&this._savedMaxConstraints&&(this._savedMaxConstraints?.maxWidth?this.dialog.style.maxWidth=this._savedMaxConstraints.maxWidth:this.dialog.style.removeProperty("max-width"),this._savedMaxConstraints?.maxHeight?this.dialog.style.maxHeight=this._savedMaxConstraints.maxHeight:this.dialog.style.removeProperty("max-height"),this._savedMaxConstraints=null)}removeSizeConstraintsIf(){this.options.keepMaxSizeConstraints||(this._savedMaxConstraints={maxWidth:this.dialog.style.maxWidth,maxHeight:this.dialog.style.maxHeight},this.dialog.style.maxWidth="none",this.dialog.style.maxHeight="none")}isInternalHandler(){return this.dialog.getAttribute("data-mud-ex-internal-handler")==="true"}setRelativeIf(){if(this.options.keepRelations&&MudExDomHelper.toRelative){this.dialog.setAttribute("data-mud-ex-internal-handler","true");var n=this.getHandler(MudExDialogResizeHandler)?.resizeObserver;n&&n.unobserve(this.dialog);MudExDomHelper.toRelative(this.dialog);n&&n.observe(this.dialog);this.removeInternalHandler()}}removeInternalHandler(){setTimeout(()=>this.dialog.removeAttribute("data-mud-ex-internal-handler"),100)}getAnimationDuration(){return this.options.animationDurationInMs+150}awaitAnimation(n){setTimeout(()=>n(this.dialog),this.getAnimationDuration())}handle(n){this._updateDialog(n)}handleAll(n){const t=this.getHandlers();t.forEach(t=>{t.handle(n),t._handlersCache=this._handlersCache})}dispose(){this.disposed=!0;this._handlersCache.forEach(n=>{n.disposed||n.dispose()});delete this._handlersCache;delete this.dialog;delete this.dialogHeader;delete this.dotNet;delete this.dotNetService;delete this.onDone;delete this.options}getHandlers(){if(this._handlersCache)return this._handlersCache;const n=[];for(const t in window)if(window.hasOwnProperty(t)&&typeof window[t]=="function")try{const i=Object.getPrototypeOf(window[t].prototype);if(i&&i.constructor===MudExDialogHandlerBase&&window[t].prototype.constructor!==this.constructor){const i=new window[t](this.options,this.dotNet,this.dotNetService,this.onDone);n.push(i)}}catch(i){}return this._handlersCache=n.sort((n,t)=>n.order-t.order),n}getHandler(n){return this.getHandlers().find(t=>t instanceof n)}_updateDialog(n){this.dialog=n||this.dialog;this.dialog&&(this.dialog.style.position="absolute",this.dialog.options=this.options,this.dialogHeader=this.dialog.querySelector(this.mudDialogHeaderSelector),this.dialogTitleEl=this.dialog.querySelector(".mud-dialog-title"),this.dialogTitle=this.dialogTitleEl?this.dialogTitleEl.innerText.trim():"",this.dialogId=this.dialog.id,this.dialogContainerReference=this.dialog.parentElement,this.dialogContainerReference&&(this.dialogOverlay=this.dialogContainerReference.querySelector(".mud-overlay")))}}window.MudExDialogHandlerBase=MudExDialogHandlerBase;class MudExDialogAnimationHandler extends MudExDialogHandlerBase{handle(n){super.handle(n);this.options.animations!=null&&Array.isArray(this.options.animations)&&this.options.animations.length?(this.animate(),this.awaitAnimation(()=>this.raiseDialogEvent("OnAnimated"))):this.raiseDialogEvent("OnAnimated");this.extendCloseEvents()}async checkCanClose(){const n=this.options.canCloseCallbackName,t=this.options.canCloseCallbackReference||this.dotNet;if(n&&t)try{const i=await t.invokeMethodAsync(n);if(i===!1)return!1}catch(i){console.error(i)}const r=await this.raiseDialogEvent("OnDialogClosing");return r?.cancel===!0?!1:!0}extendCloseEvents(){const n=n=>{const t=async i=>{if(!i.__internalDispatched){i.__internalDispatched=!0;i.preventDefault();i.stopPropagation();const t=await this.checkCanClose();t&&setTimeout(()=>{n.dispatchEvent(i)},1);return}this.options.animateClose&&(this.closeAnimation(),n.removeEventListener("click",t),MudExEventHelper.stopFor(i,n,this.options.animationDurationInMs))};n.addEventListener("click",t)},t=this.dialog.querySelector(".mud-button-close");t&&n(t);this.dialogOverlay&&this.options.modal&&this.options.backdropClick!==!1&&n(this.dialogOverlay)}animate(){this.dialog.style.animation=`${this.options.animationStyle}`}closeAnimation(){return MudExDialogAnimationHandler.playCloseAnimation(this.dialog)}static playCloseAnimation(n){if(!n)return Promise.resolve();var t=n.options?.animationDurationInMs||500;return n.style["animation-duration"]=`${t}ms`,new Promise(i=>{MudExDialogAnimationHandler._playCloseAnimation(n),setTimeout(()=>{n.classList.add("mud-ex-dialog-initial"),i()},t)})}static _playCloseAnimation(n){const t=n.style.animationName;n.style.animationName="";n.style.animationDirection="reverse";n.style["animation-play-state"]="paused";requestAnimationFrame(()=>{n.style.animationName=t,n.style["animation-play-state"]="running"})}}window.MudExDialogAnimationHandler=MudExDialogAnimationHandler;class MudExDialogButtonHandler extends MudExDialogHandlerBase{handle(n){if(super.handle(n),this.options.maximizeButton&&this.dialogHeader&&this.dialogHeader.addEventListener("dblclick",this.onDoubleClick.bind(this)),this.options.buttons&&this.options.buttons.length){var t=document.createElement("div");t.classList.add("mud-ex-dialog-header-actions");this.options.closeButton||(t.style.right="8px");this.dialogHeader&&(t=this.dialogHeader.insertAdjacentElement("beforeend",t));
1this.options.buttons.reverse().forEach(n=>{if(t){t.insertAdjacentHTML("beforeend",n.html);var i=t.querySelector("#"+n.id);i.onclick=()=>{if(n.id.indexOf("mud-button-maximize")>=0){this.getHandler(MudExDialogPositionHandler).maximize();return}if(n.id.indexOf("mud-button-minimize")>=0){this.getHandler(MudExDialogPositionHandler).minimize();return}n.callBackReference&&n.callbackName&&n.callBackReference.invokeMethodAsync(n.callbackName)}}})}}onDoubleClick(n){this.dialogHeader&&MudExEventHelper.isWithin(n,this.dialogHeader)&&this.getHandler(MudExDialogPositionHandler).maximize()}dispose(){this.dialogHeader&&this.dialogHeader.removeEventListener("dblclick",this.onDoubleClick)}}window.MudExDialogButtonHandler=MudExDialogButtonHandler;class MudExDialogDragHandler extends MudExDialogHandlerBase{static Direction={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",TOP_HALF:"top-half",TOP_LEFT:"top-left",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",CUSTOM_HEIGHT:"custom-height",CUSTOM_WIDTH:"custom-width"};static DragMode={NONE:0,DRAG:1,DRAG_WITHOUT_BOUNDS:2,SNAP:3};constructor(n,t,i,r){super(n,t,i,r);this.snapAnimationDuration=200;this.snappedTo=null;this._preSnapState=null;this._preview=null;this._handlers=[];this._threshold=20;this._thresholdTopHalf=80;this._transition=`all ${this.snapAnimationDuration}ms ease`;this._isDragging=!1;this.animateSnap=!0;this._snapPreviewClassName="snap-preview";this._savedMaxConstraints=null;this._touchMoveThreshold=10}handle(n){if(super.handle(n),!this.dialog)return;const t=document.body;this._cleanupHandlers();switch(this.options.dragMode){case MudExDialogDragHandler.DragMode.DRAG:this._attachDrag(this.dialog,this.dialogHeader,t,!1);break;case MudExDialogDragHandler.DragMode.DRAG_WITHOUT_BOUNDS:this._attachDrag(this.dialog,this.dialogHeader,t,!0);break;case MudExDialogDragHandler.DragMode.SNAP:this._createPreview(t);this._attachResizeSnap();this._attachMouseSnap();this._attachTouchSnap();this._attachKeySnap();this._attachResizeHandler()}}_attachDrag(n,t,i,r){const o=t||n;o.style.cursor="move";let f={x:0,y:0},u=!1,h=null,e=!1;const c=n=>{this._isClickable(n.target)||(u=!0,f={x:n.clientX,y:n.clientY},document.addEventListener("mousemove",l),document.addEventListener("mouseup",a))},l=t=>{u&&(t.preventDefault(),this._raiseDragStartIfNeeded(),this._performDrag(t.clientX,t.clientY,n,i,r,f,n=>{f=n}))},a=()=>{u&&(u=!1,this._raiseDragEnd(),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a))},v=n=>{if(n.touches.length!==1)return;if(this._isClickable(n.target)){setTimeout(()=>this._simulateClick(n.target),1);return}const t=n.touches[0];h=t.identifier;f={x:t.clientX,y:t.clientY};e=!1;u=!1;document.addEventListener("touchmove",y,{passive:!1});document.addEventListener("touchend",s);document.addEventListener("touchcancel",s)},y=t=>{const o=this._findTouchById(t,h);if(!o)return;const s=Math.abs(o.clientX-f.x),c=Math.abs(o.clientY-f.y);!e&&(s>this._touchMoveThreshold||c>this._touchMoveThreshold)&&(e=!0,u=!0);e&&u&&(t.preventDefault(),this._raiseDragStartIfNeeded(),this._performDrag(o.clientX,o.clientY,n,i,r,f,n=>{f=n}))},s=()=>{e&&u&&this._raiseDragEnd(),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",s),document.removeEventListener("touchcancel",s),u=!1,e=!1,h=null};o.addEventListener("mousedown",c);o.addEventListener("touchstart",v,{passive:!0});this._handlers.push([o,"mousedown",c]);this._handlers.push([o,"touchstart",v])}_performDrag(n,t,i,r,u,f,e){const h={x:f.x-n,y:f.y-t},s={x:r.offsetWidth-i.offsetWidth,y:r===document.body?window.innerHeight-i.offsetHeight:r.offsetHeight-i.offsetHeight},o={x:i.offsetLeft-h.x,y:i.offsetTop-h.y};i.style.position="absolute";u||o.x>=0&&o.x<=s.x?i.style.left=o.x+"px":o.x>s.x&&(i.style.left=s.x+"px");u||o.y>=0&&o.y<=s.y?i.style.top=o.y+"px":o.y>s.y&&(i.style.top=s.y+"px");e&&e({x:n,y:t});this.raiseDialogEvent("OnDragging")}_isClickable(n){return n.closest('button, [role="button"], a, input, textarea, select, [tabindex]:not([tabindex="-1"])')}_simulateClick(n){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});n.dispatchEvent(t)}_findTouchById(n,t){if(!n.touches||n.touches.length===0)return null;for(const i of n.touches)if(i.identifier===t)return i;return n.touches[0]}_raiseDragStartIfNeeded(){this._didDragStart||(this._didDragStart=!0,this.raiseDialogEvent("OnDragStart"))}_raiseDragEnd(){this._didDragStart=!1;this.raiseDialogEvent("OnDragEnd");this.setRelativeIf&&this.setRelativeIf()}toggleSnap(n){this.snappedTo===n?this._lastSnap?(this._doSnap(this._lastSnap,this.animateSnap),this._lastSnap=null):this.unsnap(this.animateSnap):(this._lastSnap=this.snappedTo,this.snap(n))}isSnapped(){return this.snappedTo!==null}snap(n){this._doSnap(n,this.animateSnap)}unsnap(n){this.snappedTo&&this._unsnap(n??this.animateSnap)}_isMinimizable(){return this.options.minimizeButton}_hidePreview(){const n=this._preview;n&&(n.style.transform="scale(0)")}_createPreview(n){if(this._preview)return;const t=document.createElement("div");t.className=this._snapPreviewClassName;t.style.height=0;t.style.width=0;n.appendChild(t);this._preview=t}_attachResizeSnap(){if(this.options.resizeable){this.on("OnResizing",this._onResize);this.on("OnResized",this._onResized)}}_onResize(){}_onResized(){}_attachMouseSnap(){const n=this.dialogHeader||this.dialog;n.style.cursor="move";const t=n=>
1{if(this._isClickable(n.target))return;n.preventDefault();this._startSnapDrag(n.clientX,n.clientY);const t=this._onMouseMoveSnap.bind(this),i=this._onMouseUpSnap.bind(this);document.addEventListener("mousemove",t);document.addEventListener("mouseup",i);this._handlers.push([document,"mousemove",t],[document,"mouseup",i])};n.addEventListener("mousedown",t);this._handlers.push([n,"mousedown",t])}_attachTouchSnap(){const e=this.dialogHeader||this.dialog;let r=null,n=!1,t=!1,u=0,f=0;const o=e=>{if(e.touches.length!==1)return;if(this._isClickable(e.target)){setTimeout(()=>this._simulateClick(e.target),1);return}const o=e.touches[0];r=o.identifier;u=o.clientX;f=o.clientY;n=!1;t=!1;document.addEventListener("touchmove",s,{passive:!1});document.addEventListener("touchend",i);document.addEventListener("touchcancel",i)},s=i=>{const e=this._findTouchById(i,r);if(!e)return;const o=Math.abs(e.clientX-u),s=Math.abs(e.clientY-f);!n&&(o>this._touchMoveThreshold||s>this._touchMoveThreshold)&&(n=!0,t=!0,this._startSnapDrag(u,f));n&&t&&(i.preventDefault(),this._onMoveSnap(e.clientX,e.clientY))},i=()=>{n&&t&&this._onEndSnap(),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",i),document.removeEventListener("touchcancel",i),t=!1,n=!1,r=null};e.addEventListener("touchstart",o,{passive:!0});this._handlers.push([e,"touchstart",o])}_startSnapDrag(n,t){this.raiseDialogEvent("OnDragStart");this.snappedTo||this._captureState();this._isDragging=!0;this._hasMoved=!1;this._pendingZone=null;this._startX=n;this._startY=t;this._origX=this.dialog.offsetLeft;this._origY=this.dialog.offsetTop}_onMouseMoveSnap(n){this._isDragging&&this._onMoveSnap(n.clientX,n.clientY)}_onMoveSnap(n,t){this.raiseDialogEvent("OnDragging");const r=n,u=t,o=window.innerWidth,s=window.innerHeight;!this._hasMoved&&this.snappedTo&&this._unsnap(!1);this._hasMoved=!0;const f=MudExDialogDragHandler.Direction;let i=null;if(r<=this._threshold&&u<=this._thresholdTopHalf?i=f.TOP_LEFT:r>=o-this._threshold&&u<=this._thresholdTopHalf?i=f.TOP_RIGHT:r<=this._threshold&&u>=s-this._thresholdTopHalf?i=f.BOTTOM_LEFT:r>=o-this._threshold&&u>=s-this._thresholdTopHalf?i=f.BOTTOM_RIGHT:u<=this._threshold?i=f.TOP:u>=s-this._threshold?i=f.BOTTOM:r<=this._threshold?i=f.LEFT:r>=o-this._threshold&&(i=f.RIGHT),!i){const n=r-this._startX,t=u-this._startY;Object.assign(this.dialog.style,{transition:"none",position:"absolute",left:this._origX+n+"px",top:this._origY+t+"px"});this._hidePreview();this._pendingZone=null;return}const e=this._calcRect(i,o,s),h=r-e.x,c=u-e.y;Object.assign(this._preview.style,{display:"block",left:`${e.x}px`,top:`${e.y}px`,width:`${e.w}px`,height:`${e.h}px`,transformOrigin:`${h}px ${c}px`,transform:"scale(1)"});this._pendingZone=i}_onMouseUpSnap(){this._isDragging&&this._onEndSnap()}_onEndSnap(){this.raiseDialogEvent("OnDragEnd");this._isDragging=!1;this._pendingZone?this._doSnap(this._pendingZone,this.animateSnap):this.snappedTo||this._captureState();this._hidePreview()}_attachKeySnap(){const n=n=>{if(!n.ctrlKey)return;let t=null;const i=MudExDialogDragHandler.Direction;switch(n.key){case"ArrowLeft":t=i.LEFT;break;case"ArrowRight":t=i.RIGHT;break;case"ArrowUp":t=i.TOP;break;case"ArrowDown":t=i.BOTTOM;break;default:return}n.preventDefault();this._handleKeySnap(t)};window.addEventListener("keydown",n,!0);this._handlers.push([window,"keydown",n,!0])}_handleKeySnap(n){const t=MudExDialogDragHandler.Direction,r=this.snappedTo,i=n=>this._doSnap(n,this.animateSnap),u=()=>this._unsnap(this.animateSnap);if(!r)return i(n);if(r===t.RIGHT){if(n===t.RIGHT)return i(t.LEFT);if(n===t.LEFT)return u();if(n===t.TOP)return i(t.TOP_RIGHT);if(n===t.BOTTOM)return i(t.BOTTOM_RIGHT)}if(r===t.TOP_RIGHT){if(n===t.TOP)return i(t.TOP);if(n===t.LEFT)return i(t.TOP_LEFT);if(n===t.RIGHT)return i(t.RIGHT);if(n===t.BOTTOM)return i(t.BOTTOM_RIGHT)}if(r===t.BOTTOM_RIGHT){if(n===t.TOP)return i(t.TOP_RIGHT);if(n===t.LEFT)return i(t.BOTTOM_LEFT);if(n===t.RIGHT)return i(t.RIGHT);if(n===t.BOTTOM)return i(t.BOTTOM)}if(r===t.LEFT){if(n===t.LEFT)return i(t.RIGHT);if(n===t.RIGHT)return u();if(n===t.TOP)return i(t.TOP_LEFT);if(n===t.BOTTOM)return i(t.BOTTOM_LEFT)}if(r===t.TOP_LEFT){if(n===t.TOP)return i(t.TOP);if(n===t.RIGHT)return i(t.TOP_RIGHT);if(n===t.LEFT)return i(t.LEFT);if(n===t.BOTTOM)return i(t.BOTTOM_LEFT)}if(r===t.BOTTOM_LEFT){if(n===t.TOP)return i(t.TOP_LEFT);if(n===t.RIGHT)return i(t.BOTTOM_RIGHT);if(n===t.LEFT)return i(t.LEFT);if(n===t.BOTTOM)return i(t.BOTTOM)}if(r===t.TOP){if(n===t.TOP)return i(t.TOP_HALF);if(n===t.LEFT||n===t.RIGHT)return i(n);if(n===t.BOTTOM)return u()}if(r===t.TOP_HALF){if(n===t.RIGHT)return i(t.TOP_RIGHT);if(n===t.LEFT)return i(t.TOP_LEFT);if(n===t.TOP)return i(t.TOP);if(n===t.LEFT||n===t.RIGHT)return i(n);if(n===t.BOTTOM)return u()}if(r===t.BOTTOM)return n===t.RIGHT?i(t.BOTTOM_RIGHT):n===t.LEFT?i(t.BOTTOM_LEFT):n===t.BOTTOM?this._isMinimizable()?this.getHandler(
1MudExDialogPositionHandler).minimize():i(t.TOP):u()}_doSnap(n,t){this.removeSizeConstraintsIf&&this.removeSizeConstraintsIf();this._preSnapState||this._captureState();this.raiseDialogEvent("OnSnapStart",{position:n});const i=this._calcRect(n,window.innerWidth,window.innerHeight);this._applyRect(i,t);this.snappedTo=n;this.raiseDialogEvent("OnSnap",{position:n});this.raiseDialogEvent("OnSnapEnd",{position:n});setTimeout(()=>{this.dialog.style.transition="none"},this.snapAnimationDuration)}_unsnap(n){if(!this._preSnapState)return;this.raiseDialogEvent("OnSnapStart",{position:null});const t=this._preSnapState;this._applyRect({x:t.x,y:t.y,w:t.width,h:t.height},n);this.snappedTo=null;this._preSnapState=null;this.raiseDialogEvent("OnSnapEnd",{position:null});this.restoreSizeConstraintsIf&&this.restoreSizeConstraintsIf();setTimeout(()=>{this.dialog.style.transition="none"},this.snapAnimationDuration)}_captureState(){this._preSnapState={x:this.dialog.offsetLeft,y:this.dialog.offsetTop,width:this.dialog.offsetWidth,height:this.dialog.offsetHeight}}_calcRect(n,t,i){const r=MudExDialogDragHandler.Direction,u=Math.floor(t/2),f=Math.floor(i/2);switch(n){case r.TOP:return{x:0,y:0,w:t,h:i};case r.TOP_HALF:return{x:0,y:0,w:t,h:f};case r.BOTTOM:return{x:0,y:f,w:t,h:f};case r.LEFT:return{x:0,y:0,w:u,h:i};case r.RIGHT:return{x:u,y:0,w:u,h:i};case r.TOP_LEFT:return{x:0,y:0,w:u,h:f};case r.TOP_RIGHT:return{x:u,y:0,w:u,h:f};case r.BOTTOM_LEFT:return{x:0,y:f,w:u,h:f};case r.BOTTOM_RIGHT:return{x:u,y:f,w:u,h:f};default:return{x:0,y:0,w:t,h:i}}}_applyRect({x:i,y:r,w:t,h:n},u){const f=this.dialog;f.style.transition=u?this._transition:"none";Object.assign(f.style,{position:"absolute",left:i+"px",top:r+"px",width:t+"px",height:n+"px"})}_attachResizeHandler(){const n=()=>
1{if(!this.snappedTo)return;const n=this._calcRect(this.snappedTo,window.innerWidth,window.innerHeight);Object.assign(this.dialog.style,{left:n.x+"px",top:n.y+"px",width:n.w+"px",height:n.h+"px"})};window.addEventListener("resize",n);this._handlers.push([window,"resize",n])}_cleanupHandlers(){this._preview&&(this._preview.remove(),this._preview=null);this._handlers.forEach(([r,n,t,i])=>r.removeEventListener(n,t,i));this._handlers=[];this.snappedTo=null;this._preSnapState=null;this._isDragging=!1;this._pendingZone=null;this._hasMoved=!1;this.options.resizeable&&(this.un("OnResizing",this._onResize),this.un("OnResized",this._onResized))}dispose(){this._cleanupHandlers();super.dispose()}}window.MudExDialogDragHandler=MudExDialogDragHandler;class MudExDialogFinder{constructor(n){this.options=n;this.mudDialogSelector=n.mudDialogSelector||".mud-dialog:not([data-mud-extended=true])"}findDialog(){return Array.from(document.querySelectorAll(this.mudDialogSelector)).find(n=>!n.__extended)}observeDialog(n){const t=new MutationObserver(i=>{const r=this.findDialog();if(r){const u=i.find(n=>n.addedNodes[0]===r);u&&(t.disconnect(),n(r))}});t.observe(document,{characterData:!0,childList:!0,subtree:!0})}}window.MudExDialogFinder=MudExDialogFinder;class MudExDialogHandler extends MudExDialogHandlerBase{handle(n){setTimeout(()=>{super.handle(n),setTimeout(()=>{n.classList.remove("mud-ex-dialog-initial")},50),n.__extended=!0,n.setAttribute("data-mud-extended",!0),n.classList.add("mud-ex-dialog"),this.handleAll(n),this.awaitAnimation(()=>{window.MudBlazorExtensions.focusAllAutoFocusElements()}),this.onDone&&this.onDone()},50)}}window.MudExDialogHandler=MudExDialogHandler;class MudExDialogNoModalHandler extends MudExDialogHandlerBase{static handled=[];handle(n){super.handle(n);this.options.modal||(this._updateHandledDialogs(n),this.appOrBody=this.dialogContainerReference.parentElement,this._modifyDialogAppearance(),this.dialog.onmousedown=this._handleDialogMouseDown.bind(this),this.observer=new MutationObserver(this._checkMutationsForRemove.bind(this)),this.observer.observe(this.appOrBody,{childList:!0}))}_updateHandledDialogs(n){const t=MudExDialogNoModalHandler.handled.findIndex(t=>t.id===n.id);t!==-1&&MudExDialogNoModalHandler.handled.splice(t,1);MudExDialogNoModalHandler.handled.push({id:this.dialog.id,dialog:this.dialog,options:this.options,dotNet:this.dotNet})}_modifyDialogAppearance(){this.changeCls();this.awaitAnimation(()=>{this.dialog.style["animation-duration"]="0s",MudExDomHelper.toAbsolute(this.dialog,!this.options.customSize),this.appOrBody.insertBefore(this.dialog,this.appOrBody.firstChild),Object.assign(this.dialogContainerReference.style,{display:"none",height:"2px",width:"2px"})})}_handleDialogMouseDown(n){this.dialogHeader&&Array.from(this.dialogHeader.querySelectorAll("button")).some(t=>MudExEventHelper.isWithin(n,t))||MudExDialogNoModalHandler.bringToFront(this.dialog)}reInitOtherDialogs(){const n=Array.from(document.querySelectorAll(".mud-ex-dialog-initial")).filter(n=>n.getAttribute("data-mud-extended")!=="true");n.forEach(this.reInitDialog.bind(this))}reInitDialog(n){const t=MudExDialogNoModalHandler.handled.find(t=>t.id===n.id);if(t){const i=n.style,u={top:i.top,left:i.left,width:i.width,height:i.height,position:i.position};n.style.display="none";const r={...t,options:{...t.options,animations:null}},f=MudExDialogNoModalHandler.handled.indexOf(t);MudExDialogNoModalHandler.handled.splice(f,1);const e=new MudExDialogHandler(r.options,r.dotNet,r.dotNetService,r.onDone);e.handle(n);n.style.display="block";Object.assign(n.style,u)}}_checkMutationsForRemove(n){for(const t of n)if(t.type==="childList")for(const n of t.removedNodes)if(n===this.dialogContainerReference){this.observer.disconnect();const n=MudExDialogNoModalHandler.handled.findIndex(n=>n.id===this.dialog.id);n!==-1&&MudExDialogNoModalHandler.handled.splice(n,1);this.dialog.remove();this.reInitOtherDialogs();break}}changeCls(){this.dialog.classList.add("mudex-dialog-no-modal");this.dialog.style.setProperty("z-index","var(--mud-zindex-dialog)");this.dialogContainerReference.classList.add("mudex-dialog-ref-no-modal");this.dialogContainerReference.setAttribute("data-modal",!1);this.dialogContainerReference.setAttribute("data-dialog-id",this.dialog.id);this.dialogOverlay.remove()}static bringToFront(n){const t=this.getAllNonModalDialogs();if(n){const r=n.parentElement,i=t[t.length-1];i&&n&&n!==i&&r.insertBefore(n,i.nextSibling)}}static getDialogReference(n){return MudExDialogNoModalHandler.getAllDialogReferences().filter(t=>
1t&&t.getAttribute("data-dialog-id")===n.id)[0]||n.parentElement}static getAllDialogReferences(){return Array.from(document.querySelectorAll(".mud-dialog-container")).filter(n=>n.getAttribute("data-modal")==="false")}static getAllNonModalDialogs(){return Array.from(document.querySelectorAll(".mudex-dialog-no-modal"))}}window.MudExDialogNoModalHandler=MudExDialogNoModalHandler;class MudExDialogPositionHandler extends MudExDialogHandlerBase{handle(n){super.handle(n);this.options.showAtCursor?this.moveElementToMousePosition(n):this.options.customPosition&&(this.dialog.style.position="absolute",this.dialog.style.left=this.options.customPosition.left.cssValue,this.dialog.style.top=this.options.customPosition.top.cssValue);this.options.fullWidth&&this.options.disableSizeMarginX&&(this.dialog.classList.remove("mud-dialog-width-full"),this.dialog.classList.add("mud-dialog-width-full-no-margin"),this.dialog.classList.contains("mud-dialog-width-false")&&this.dialog.classList.remove("mud-dialog-width-false"))}minimize(){let n=document.querySelector(`.mud-ex-task-bar-item-for-${this.dialog.id}`);this.moveToElement(this.dialog,n,()=>{this.dialog.style.visibility="hidden"})}moveToElement(n,t,i){var r=t.getBoundingClientRect(),u=n.getBoundingClientRect(),f=r.width/u.width,e=r.height/u.height,o=r.left-u.left,s=r.top-u.top,h=n.style["animation-duration"];n.style["animation-duration"]=".3s";n.style.transform=`translate(${o}px, ${s}px) scale(${f}, ${e})`;n.style.transition="transform 0.3s ease-in-out";setTimeout(()=>{n.style.removeProperty("transform"),n.style.removeProperty("transition"),n.style["animation-duration"]=h,i&&i()},300)}restore(){this.dialog.style.visibility="visible"}maximize(){var n=this.getHandler(MudExDialogDragHandler);n.toggleSnap(MudExDialogDragHandler.Direction.TOP)}moveElementToMousePosition(n){var u=MudBlazorExtensions.getCurrentMousePosition(),i=u.clientX,r=u.clientY,t=this.options.cursorPositionOriginName.split("-"),f=this.options.maxWidth===6||this.options.maxWidth===4;setTimeout(()=>{this.options.fullWidth&&f||(t[1]==="left"?n.style.left=i+"px":t[1]==="right"?n.style.left=i-n.offsetWidth+"px":t[1]==="center"&&(n.style.left=i-n.offsetWidth/2+"px")),this.options.fullHeight||(t[0]==="top"?n.style.top=r+"px":t[0]==="bottom"?n.style.top=r-n.offsetHeight+"px":t[0]==="center"&&(n.style.top=r-n.offsetHeight/2+"px")),MudExDomHelper.ensureElementIsInScreenBounds(n)},50)}}window.MudExDialogPositionHandler=MudExDialogPositionHandler;class MudExDialogResizeHandler extends MudExDialogHandlerBase{handle(n){this.resizeTimeout=null;this.resizedSometimes=!1;super.handle(n);this.dialog=n;this.dialog.addEventListener("mousedown",this.onMouseDown.bind(this));this.dialog.addEventListener("mouseup",this.onMouseUp.bind(this));this.resizeObserver=new ResizeObserver(n=>{for(let t of n)t.target===this.dialog&&(this.isInternalHandler()||(!this.resizedSometimes&&(this.mouseDown||this.touchDown)&&(this.resizedSometimes=!0,this.setBounds()),this.raiseDialogEvent("OnResizing"),this.debounceResizeCompleted()))});this.awaitAnimation(()=>this.checkResizeable())}onMouseUp(){this.mouseDown=!1}onMouseDown(){this.mouseDown=!0}onTouchStart(n){this.touchDown=!0;n.touches.length===1&&n.preventDefault()}onTouchEnd(){this.touchDown=!1}debounceResizeCompleted(){this.resizeTimeout&&clearTimeout(this.resizeTimeout);this.resizeTimeout=setTimeout(()=>{this.setRelativeIf(),this.raiseDialogEvent("OnResized")},500)}checkResizeable(){MudExDomHelper.toAbsolute(this.dialog,!1);this.setRelativeIf();this.options.resizeable&&(this.resizeObserver.observe(this.dialog),this.dialog.style.resize="both",this.dialog.style.overflow="auto",this.dialog.style["touch-action"]="manipulation")}setBounds(){this.options.keepMaxSizeConstraints||(this.dialog.style.maxWidth||(this.dialog.style.maxWidth=this.dialog.style.maxWidth||window.innerWidth+"px"),this.dialog.style.maxHeight||(this.dialog.style.maxHeight=this.dialog.style.maxHeight||window.innerHeight+"px"));this.dialog.style.minWidth||(this.dialog.style.minWidth=this.dialog.style.minWidth||"150px");this.dialog.style.minHeight||(this.dialog.style.minHeight=this.dialog.style.minHeight||"150px")}dispose(){this.resizeObserver&&this.resizeObserver.unobserve(this.dialog);this.resizeTimeout&&clearTimeout(this.resizeTimeout);this.dialog.removeEventListener("mousedown",this.onMouseDown);this.dialog.removeEventListener("mouseup",this.onMouseUp)}}window.MudExDialogResizeHandler=MudExDialogResizeHandler;class MudBlazorExtensionHelper{constructor(n,t,i,r){this.dialogFinder=new MudExDialogFinder(n);this.dialogHandler=new MudExDialogHandler(n,t,i,r)}init(){const n=this.dialogFinder.findDialog();n?this.dialogHandler.handle(n):this.dialogFinder.observeDialog(n=>this.dialogHandler.handle(n))}}window.MudBlazorExtensionHelper=MudBlazorExtensionHelper;window.MudBlazorExtensions={helper:null,currentMouseArgs:null,__bindEvents:function(){var n=function(n){window.MudBlazorExtensions.currentMouseArgs=n};document.addEventListener("mousemove",n,!1);document.addEventListener("mouseenter",n,!1)},getCurrentMousePosition:function(){return window.MudBlazorExtensions.currentMouseArgs},setNextDialogOptions:function(n,t,i){new MudBlazorExtensionHelper(n,t,i,()=>{MudBlazorExtensions.helper=null,delete MudBlazorExtensions.helper}).init()},addCss:function(n){var i=n,r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");r.appendChild(t);t.type="text/css";t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i))},openWindowAndPostMessage:function(n,t){var i=window.open(n);i.onload=function(){i.postMessage(t,n)}},downloadFile(n){var t=n.url||"data:"+n.mimeType+";base64,"+n.base64String;fetch(t).then(n=>n.blob()).then(t=>{var i=window.document.createElement("a");i.href=window.URL.createObjectURL(t);
1i.download=n.fileName;document.body.appendChild(i);i.click();document.body.removeChild(i)})},async saveFileAs(n){var e=n.url||"data:"+n.mimeType+";base64,"+n.base64String,o=await fetch(e),s=await o.blob(),t,i,u,r;if(window.showSaveFilePicker)try{return t=n.fileName?n.fileName.split(".").pop():"",i={suggestedName:n.fileName||"download",types:[]},t&&n.mimeType&&i.types.push({description:t.toUpperCase()+" file",accept:{[n.mimeType]:["."+t]}}),u=await window.showSaveFilePicker(i),r=await u.createWritable(),await r.write(s),await r.close(),!0}catch(f){if(f.name==="AbortError")return!1;throw f;}else return this.downloadFile(n),!0},attachDialog(n){if(n){let t=document.getElementById(n);if(t){let n=t.querySelector(".mud-dialog-title"),i=null;if(n){const r=n.querySelectorAll("svg"),t=Array.from(r).filter(n=>!n.parentElement.classList.contains("mud-ex-dialog-header-actions"));t.length>0&&(i=t[0])}return{title:n?n.innerText:"Unnamed window",icon:i?i.innerHTML:""}}}return null},closeDialogAnimated(n,t){if(n){let i=document.getElementById(n);if(!t||i.options?.animateClose)return MudExDialogAnimationHandler.playCloseAnimation(i)}return Promise.resolve()},getElement(n){return document.querySelector(n)},showDialog(n){if(n){let t=document.getElementById(n);t&&(t.style.visibility="visible",MudExDialogNoModalHandler.bringToFront(t,!0))}},focusAllAutoFocusElements:function(){const n=document.querySelectorAll('[data-auto-focus="true"]');n.forEach(n=>{try{n.removeAttribute("data-auto-focus");(window.__originalBlazorFocusMethod||window.Blazor._internal.domWrapper.focus)(n)}catch(t){}})}};window.MudBlazorExtensions.__bindEvents(),function(){window.__originalBlazorFocusMethod||(window.__originalBlazorFocusMethod=window.Blazor._internal.domWrapper.focus,Blazor._internal.domWrapper.focus=function(n,t){if(n)try{n.setAttribute("data-auto-focus","true");window.__originalBlazorFocusMethod(n,t)}catch(i){}})}()

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.